WebKit Bugzilla
New
Browse
Search+
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
[patch]
Patch
bug-79653-20210220123206.patch (text/plain), 17.76 KB, created by
Sam Weinig
on 2021-02-20 12:32:06 PST
(
hide
)
Description:
Patch
Filename:
MIME Type:
Creator:
Sam Weinig
Created:
2021-02-20 12:32:06 PST
Size:
17.76 KB
patch
obsolete
>Index: Source/WebCore/ChangeLog >=================================================================== >--- Source/WebCore/ChangeLog (revision 273202) >+++ Source/WebCore/ChangeLog (working copy) >@@ -1,3 +1,39 @@ >+2021-02-20 Sam Weinig <weinig@apple.com> >+ >+ Remove getMatchedCSSRules >+ https://bugs.webkit.org/show_bug.cgi?id=79653 >+ <rdar://problem/16354443> >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ Remove getMatchedCSSRules and some code that only existed only for it (such >+ as hasDocumentSecurityOrigin). I am sure there is more that can be cleaned >+ up once it is gone, but this is the first step. >+ >+ Firefox and Chrome have had it removed for a while now. >+ >+ * css/CSSStyleRule.cpp: >+ (WebCore::CSSStyleRule::setSelectorText): >+ * css/StyleRule.cpp: >+ (WebCore::StyleRule::StyleRule): >+ (WebCore::StyleRule::create): >+ (WebCore::StyleRule::createForSplitting): >+ (WebCore::StyleRule::splitIntoMultipleRulesWithMaximumSelectorComponentCount const): >+ * css/StyleRule.h: >+ (WebCore::StyleRuleBase::StyleRuleBase): >+ (WebCore::StyleRuleBase::hasDocumentSecurityOrigin const): Deleted. >+ * css/parser/CSSParserContext.cpp: >+ (WebCore::operator==): >+ * css/parser/CSSParserContext.h: >+ (WebCore::CSSParserContextHash::hash): >+ * css/parser/CSSParserImpl.cpp: >+ (WebCore::CSSParserImpl::consumeStyleRule): >+ * page/DOMWindow.cpp: >+ (WebCore::DOMWindow::getMatchedCSSRules const): Deleted. >+ * page/DOMWindow.h: >+ * page/DOMWindow.idl: >+ * page/Settings.yaml: >+ > 2021-02-20 Zalan Bujtas <zalan@apple.com> > > [LFC][Integration] Enclosing top and bottom value are relative to the containing block's border box >Index: Source/WebCore/css/CSSStyleRule.cpp >=================================================================== >--- Source/WebCore/css/CSSStyleRule.cpp (revision 273199) >+++ Source/WebCore/css/CSSStyleRule.cpp (working copy) >@@ -85,11 +85,6 @@ String CSSStyleRule::selectorText() cons > > void CSSStyleRule::setSelectorText(const String& selectorText) > { >- // FIXME: getMatchedCSSRules can return CSSStyleRules that are missing parent stylesheet pointer while >- // referencing StyleRules that are part of stylesheet. Disallow mutations in this case. >- if (!parentStyleSheet()) >- return; >- > CSSParser p(parserContext()); > auto selectorList = p.parseSelector(selectorText); > if (!selectorList) >Index: Source/WebCore/css/StyleRule.cpp >=================================================================== >--- Source/WebCore/css/StyleRule.cpp (revision 273199) >+++ Source/WebCore/css/StyleRule.cpp (working copy) >@@ -171,8 +171,8 @@ unsigned StyleRule::averageSizeInBytes() > return sizeof(StyleRule) + sizeof(CSSSelector) + StyleProperties::averageSizeInBytes(); > } > >-StyleRule::StyleRule(Ref<StylePropertiesBase>&& properties, bool hasDocumentSecurityOrigin, CSSSelectorList&& selectors) >- : StyleRuleBase(StyleRuleType::Style, hasDocumentSecurityOrigin) >+StyleRule::StyleRule(Ref<StylePropertiesBase>&& properties, CSSSelectorList&& selectors) >+ : StyleRuleBase(StyleRuleType::Style) > , m_properties(WTFMove(properties)) > , m_selectorList(WTFMove(selectors)) > { >@@ -187,9 +187,9 @@ StyleRule::StyleRule(const StyleRule& o) > > StyleRule::~StyleRule() = default; > >-Ref<StyleRule> StyleRule::create(Ref<StylePropertiesBase>&& properties, bool hasDocumentSecurityOrigin, CSSSelectorList&& selectors) >+Ref<StyleRule> StyleRule::create(Ref<StylePropertiesBase>&& properties, CSSSelectorList&& selectors) > { >- return adoptRef(*new StyleRule(WTFMove(properties), hasDocumentSecurityOrigin, WTFMove(selectors))); >+ return adoptRef(*new StyleRule(WTFMove(properties), WTFMove(selectors))); > } > > Ref<StyleRule> StyleRule::copy() const >@@ -218,7 +218,7 @@ Ref<StyleRule> StyleRule::createForSplit > for (unsigned i = 0; i < selectors.size(); ++i) > new (NotNull, &selectorListArray[i]) CSSSelector(*selectors.at(i)); > selectorListArray[selectors.size() - 1].setLastInSelectorList(); >- return StyleRule::create(WTFMove(properties), hasDocumentSecurityOrigin, CSSSelectorList(WTFMove(selectorListArray))); >+ return StyleRule::create(WTFMove(properties), CSSSelectorList(WTFMove(selectorListArray))); > } > > Vector<RefPtr<StyleRule>> StyleRule::splitIntoMultipleRulesWithMaximumSelectorComponentCount(unsigned maxCount) const >@@ -234,7 +234,7 @@ Vector<RefPtr<StyleRule>> StyleRule::spl > componentsInThisSelector.append(component); > > if (componentsInThisSelector.size() + componentsSinceLastSplit.size() > maxCount && !componentsSinceLastSplit.isEmpty()) { >- rules.append(createForSplitting(componentsSinceLastSplit, const_cast<StyleProperties&>(properties()), hasDocumentSecurityOrigin())); >+ rules.append(createForSplitting(componentsSinceLastSplit, const_cast<StyleProperties&>(properties()))); > componentsSinceLastSplit.clear(); > } > >@@ -242,7 +242,7 @@ Vector<RefPtr<StyleRule>> StyleRule::spl > } > > if (!componentsSinceLastSplit.isEmpty()) >- rules.append(createForSplitting(componentsSinceLastSplit, const_cast<StyleProperties&>(properties()), hasDocumentSecurityOrigin())); >+ rules.append(createForSplitting(componentsSinceLastSplit, const_cast<StyleProperties&>(properties()))); > > return rules; > } >Index: Source/WebCore/css/StyleRule.h >=================================================================== >--- Source/WebCore/css/StyleRule.h (revision 273199) >+++ Source/WebCore/css/StyleRule.h (working copy) >@@ -66,27 +66,23 @@ public: > Ref<CSSRule> createCSSOMWrapper(CSSRule* parentRule) const; > > protected: >- explicit StyleRuleBase(StyleRuleType, bool hasDocumentSecurityOrigin = false); >+ explicit StyleRuleBase(StyleRuleType); > StyleRuleBase(const StyleRuleBase&); > ~StyleRuleBase() = default; > >- bool hasDocumentSecurityOrigin() const { return m_hasDocumentSecurityOrigin; } >- > private: > WEBCORE_EXPORT void destroy(); > > Ref<CSSRule> createCSSOMWrapper(CSSStyleSheet* parentSheet, CSSRule* parentRule) const; > > unsigned m_type : 5; // StyleRuleType >- // This is only needed to support getMatchedCSSRules. >- unsigned m_hasDocumentSecurityOrigin : 1; > }; > > DECLARE_ALLOCATOR_WITH_HEAP_IDENTIFIER(StyleRule); > class StyleRule final : public StyleRuleBase { > WTF_MAKE_STRUCT_FAST_ALLOCATED_WITH_HEAP_IDENTIFIER(StyleRule); > public: >- static Ref<StyleRule> create(Ref<StylePropertiesBase>&&, bool hasDocumentSecurityOrigin, CSSSelectorList&&); >+ static Ref<StyleRule> create(Ref<StylePropertiesBase>&&, CSSSelectorList&&); > Ref<StyleRule> copy() const; > ~StyleRule(); > >@@ -96,8 +92,6 @@ public: > MutableStyleProperties& mutableProperties(); > const StyleProperties* propertiesWithoutDeferredParsing() const; > >- using StyleRuleBase::hasDocumentSecurityOrigin; >- > void wrapperAdoptSelectorList(CSSSelectorList&&); > > Vector<RefPtr<StyleRule>> splitIntoMultipleRulesWithMaximumSelectorComponentCount(unsigned) const; >@@ -110,10 +104,10 @@ public: > static unsigned averageSizeInBytes(); > > private: >- StyleRule(Ref<StylePropertiesBase>&&, bool hasDocumentSecurityOrigin, CSSSelectorList&&); >+ StyleRule(Ref<StylePropertiesBase>&&, CSSSelectorList&&); > StyleRule(const StyleRule&); > >- static Ref<StyleRule> createForSplitting(const Vector<const CSSSelector*>&, Ref<StyleProperties>&&, bool hasDocumentSecurityOrigin); >+ static Ref<StyleRule> createForSplitting(const Vector<const CSSSelector*>&, Ref<StyleProperties>&&); > > mutable Ref<StylePropertiesBase> m_properties; > CSSSelectorList m_selectorList; >@@ -260,16 +254,14 @@ private: > AtomString m_uri; > }; > >-inline StyleRuleBase::StyleRuleBase(StyleRuleType type, bool hasDocumentSecurityOrigin) >+inline StyleRuleBase::StyleRuleBase(StyleRuleType type) > : m_type(static_cast<unsigned>(type)) >- , m_hasDocumentSecurityOrigin(hasDocumentSecurityOrigin) > { > } > > inline StyleRuleBase::StyleRuleBase(const StyleRuleBase& o) > : WTF::RefCountedBase() > , m_type(o.m_type) >- , m_hasDocumentSecurityOrigin(o.m_hasDocumentSecurityOrigin) > { > } > >Index: Source/WebCore/css/parser/CSSParserContext.cpp >=================================================================== >--- Source/WebCore/css/parser/CSSParserContext.cpp (revision 273199) >+++ Source/WebCore/css/parser/CSSParserContext.cpp (working copy) >@@ -65,7 +65,6 @@ CSSParserContext::CSSParserContext(const > , charset { charset } > , mode { document.inQuirksMode() ? HTMLQuirksMode : HTMLStandardMode } > , isHTMLDocument { document.isHTMLDocument() } >- , hasDocumentSecurityOrigin { sheetBaseURL.isNull() || document.securityOrigin().canRequest(baseURL) } > , useSystemAppearance { document.page() ? document.page()->useSystemAppearance() : false } > , aspectRatioEnabled { document.settings().aspectRatioEnabled() } > , colorFilterEnabled { document.settings().colorFilterEnabled() } >@@ -101,7 +100,6 @@ bool operator==(const CSSParserContext& > && a.mode == b.mode > && a.enclosingRuleType == b.enclosingRuleType > && a.isHTMLDocument == b.isHTMLDocument >- && a.hasDocumentSecurityOrigin == b.hasDocumentSecurityOrigin > && a.isContentOpaque == b.isContentOpaque > && a.useSystemAppearance == b.useSystemAppearance > && a.aspectRatioEnabled == b.aspectRatioEnabled >Index: Source/WebCore/css/parser/CSSParserContext.h >=================================================================== >--- Source/WebCore/css/parser/CSSParserContext.h (revision 273199) >+++ Source/WebCore/css/parser/CSSParserContext.h (working copy) >@@ -50,9 +50,6 @@ public: > Optional<StyleRuleType> enclosingRuleType; > bool isHTMLDocument { false }; > >- // This is only needed to support getMatchedCSSRules. >- bool hasDocumentSecurityOrigin { false }; >- > bool isContentOpaque { false }; > bool useSystemAppearance { false }; > >@@ -103,7 +100,6 @@ struct CSSParserContextHash { > if (!key.charset.isEmpty()) > hash ^= StringHash::hash(key.charset); > unsigned bits = key.isHTMLDocument << 0 >- & key.hasDocumentSecurityOrigin << 1 > & key.isContentOpaque << 2 > & key.useSystemAppearance << 3 > & key.aspectRatioEnabled << 4 >Index: Source/WebCore/css/parser/CSSParserImpl.cpp >=================================================================== >--- Source/WebCore/css/parser/CSSParserImpl.cpp (revision 273199) >+++ Source/WebCore/css/parser/CSSParserImpl.cpp (working copy) >@@ -713,12 +713,12 @@ RefPtr<StyleRule> CSSParserImpl::consume > CSSParserTokenRange blockCopy = block; > blockCopy.consumeWhitespace(); > if (!blockCopy.atEnd()) { >- return StyleRule::create(createDeferredStyleProperties(block), m_context.hasDocumentSecurityOrigin, WTFMove(*selectorList)); >+ return StyleRule::create(createDeferredStyleProperties(block), WTFMove(*selectorList)); > } > } > > consumeDeclarationList(block, StyleRuleType::Style); >- return StyleRule::create(createStyleProperties(m_parsedProperties, m_context.mode), m_context.hasDocumentSecurityOrigin, WTFMove(*selectorList)); >+ return StyleRule::create(createStyleProperties(m_parsedProperties, m_context.mode), WTFMove(*selectorList)); > } > > void CSSParserImpl::consumeDeclarationList(CSSParserTokenRange range, StyleRuleType ruleType) >Index: Source/WebCore/page/DOMWindow.cpp >=================================================================== >--- Source/WebCore/page/DOMWindow.cpp (revision 273199) >+++ Source/WebCore/page/DOMWindow.cpp (working copy) >@@ -1586,44 +1586,6 @@ Ref<CSSStyleDeclaration> DOMWindow::getC > return CSSComputedStyleDeclaration::create(element, false, pseudoElt); > } > >-RefPtr<CSSRuleList> DOMWindow::getMatchedCSSRules(Element* element, const String& pseudoElement, bool authorOnly) const >-{ >- if (!isCurrentlyDisplayedInFrame()) >- return nullptr; >- >- unsigned colonStart = pseudoElement[0] == ':' ? (pseudoElement[1] == ':' ? 2 : 1) : 0; >- auto pseudoType = CSSSelector::parsePseudoElementType(StringView { pseudoElement }.substring(colonStart)); >- if (pseudoType == CSSSelector::PseudoElementUnknown && !pseudoElement.isEmpty()) >- return nullptr; >- >- auto* frame = this->frame(); >- frame->document()->styleScope().flushPendingUpdate(); >- >- unsigned rulesToInclude = Style::Resolver::AuthorCSSRules; >- if (!authorOnly) >- rulesToInclude |= Style::Resolver::UAAndUserCSSRules; >- >- PseudoId pseudoId = CSSSelector::pseudoId(pseudoType); >- >- auto matchedRules = frame->document()->styleScope().resolver().pseudoStyleRulesForElement(element, pseudoId, rulesToInclude); >- if (matchedRules.isEmpty()) >- return nullptr; >- >- bool allowCrossOrigin = frame->settings().crossOriginCheckInGetMatchedCSSRulesDisabled(); >- >- auto ruleList = StaticCSSRuleList::create(); >- for (auto& rule : matchedRules) { >- if (!allowCrossOrigin && !rule->hasDocumentSecurityOrigin()) >- continue; >- ruleList->rules().append(rule->createCSSOMWrapper()); >- } >- >- if (ruleList->rules().isEmpty()) >- return nullptr; >- >- return ruleList; >-} >- > RefPtr<WebKitPoint> DOMWindow::webkitConvertPointFromNodeToPage(Node* node, const WebKitPoint* p) const > { > if (!node || !p) >Index: Source/WebCore/page/DOMWindow.h >=================================================================== >--- Source/WebCore/page/DOMWindow.h (revision 273199) >+++ Source/WebCore/page/DOMWindow.h (working copy) >@@ -257,7 +257,6 @@ public: > > // WebKit extensions > >- WEBCORE_EXPORT RefPtr<CSSRuleList> getMatchedCSSRules(Element*, const String& pseudoElt, bool authorOnly = true) const; > double devicePixelRatio() const; > > RefPtr<WebKitPoint> webkitConvertPointFromPageToNode(Node*, const WebKitPoint*) const; >Index: Source/WebCore/page/DOMWindow.idl >=================================================================== >--- Source/WebCore/page/DOMWindow.idl (revision 273199) >+++ Source/WebCore/page/DOMWindow.idl (working copy) >@@ -121,10 +121,6 @@ > // Non-standard: This has been dropped from the HTML specification and by other browsers. > [Custom, ForwardDeclareInHeader] any showModalDialog(DOMString url, optional any dialogArgs, optional DOMString featureArgs); > >- // Non-standard: should probably deprecate this (https://bugs.webkit.org/show_bug.cgi?id=79653). >- // Blink already deprecated it (https://bugs.chromium.org/p/chromium/issues/detail?id=437569). >- CSSRuleList getMatchedCSSRules(optional Element? element = null, optional DOMString? pseudoElement = null); >- > // Non-standard: Blink has already dropped these (https://bugs.chromium.org/p/chromium/issues/detail?id=398352). > WebKitPoint webkitConvertPointFromPageToNode(optional Node? node = null, optional WebKitPoint? p = null); > WebKitPoint webkitConvertPointFromNodeToPage(optional Node? node = null, optional WebKitPoint? p = null); >Index: Source/WebCore/page/Settings.yaml >=================================================================== >--- Source/WebCore/page/Settings.yaml (revision 273199) >+++ Source/WebCore/page/Settings.yaml (working copy) >@@ -82,12 +82,6 @@ ClipboardAccessPolicy: > WebCore: > default: ClipboardAccessPolicy::RequiresUserGesture > >-CrossOriginCheckInGetMatchedCSSRulesDisabled: >- type: bool >- defaultValue: >- WebCore: >- default: false >- > DataDetectorTypes: > type: uint32_t > refinedType: DataDetectorType >Index: Source/WebKitLegacy/mac/ChangeLog >=================================================================== >--- Source/WebKitLegacy/mac/ChangeLog (revision 273199) >+++ Source/WebKitLegacy/mac/ChangeLog (working copy) >@@ -1,3 +1,19 @@ >+2021-02-20 Sam Weinig <weinig@apple.com> >+ >+ Remove getMatchedCSSRules >+ https://bugs.webkit.org/show_bug.cgi?id=79653 >+ <rdar://problem/16354443> >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ Null out implementations of long deprecated methods. >+ >+ * DOM/DOMDocument.mm: >+ (-[DOMDocument getMatchedCSSRules:pseudoElement:]): >+ (-[DOMDocument getMatchedCSSRules:pseudoElement:authorOnly:]): >+ * WebView/WebView.mm: >+ (-[WebView _setNeedsUnrestrictedGetMatchedCSSRules:]): >+ > 2021-02-19 Chris Dumez <cdumez@apple.com> > > Review remaining usage of autorelease to make sure it is necessary >Index: Source/WebKitLegacy/mac/DOM/DOMDocument.mm >=================================================================== >--- Source/WebKitLegacy/mac/DOM/DOMDocument.mm (revision 273199) >+++ Source/WebKitLegacy/mac/DOM/DOMDocument.mm (working copy) >@@ -693,16 +693,12 @@ - (DOMCSSStyleDeclaration *)getComputedS > > - (DOMCSSRuleList *)getMatchedCSSRules:(DOMElement *)element pseudoElement:(NSString *)pseudoElement > { >- return [self getMatchedCSSRules:element pseudoElement:pseudoElement authorOnly:YES]; >+ return nil; > } > > - (DOMCSSRuleList *)getMatchedCSSRules:(DOMElement *)element pseudoElement:(NSString *)pseudoElement authorOnly:(BOOL)authorOnly > { >- WebCore::JSMainThreadNullState state; >- WebCore::DOMWindow* dv = IMPL->domWindow(); >- if (!dv) >- return nil; >- return kit(WTF::getPtr(dv->getMatchedCSSRules(core(element), pseudoElement, authorOnly))); >+ return nil; > } > > - (DOMNodeList *)getElementsByClassName:(NSString *)classNames >Index: Source/WebKitLegacy/mac/WebView/WebView.mm >=================================================================== >--- Source/WebKitLegacy/mac/WebView/WebView.mm (revision 273199) >+++ Source/WebKitLegacy/mac/WebView/WebView.mm (working copy) >@@ -3816,8 +3816,6 @@ - (BOOL)_setMediaLayer:(CALayer*)layer f > > - (void)_setNeedsUnrestrictedGetMatchedCSSRules:(BOOL)flag > { >- if (_private->page) >- _private->page->settings().setCrossOriginCheckInGetMatchedCSSRulesDisabled(flag); > } > #endif // PLATFORM(IOS_FAMILY) >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Flags:
ews-feeder
:
commit-queue-
Actions:
View
|
Formatted Diff
|
Diff
Attachments on
bug 79653
:
326725
|
421100
| 421101