<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>[195311] trunk/Source/WebCore</title>
</head>
<body>
<style type="text/css"><!--
#msg dl.meta { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dl.meta dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer, #logmsg { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; }
#msg dl a { font-weight: bold}
#msg dl a:link { color:#fc3; }
#msg dl a:active { color:#ff0; }
#msg dl a:visited { color:#cc6; }
h3 { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; font-weight: bold; }
#msg pre { overflow: auto; background: #ffc; border: 1px #fa0 solid; padding: 6px; }
#logmsg { background: #ffc; border: 1px #fa0 solid; padding: 1em 1em 0 1em; }
#logmsg p, #logmsg pre, #logmsg blockquote { margin: 0 0 1em 0; }
#logmsg p, #logmsg li, #logmsg dt, #logmsg dd { line-height: 14pt; }
#logmsg h1, #logmsg h2, #logmsg h3, #logmsg h4, #logmsg h5, #logmsg h6 { margin: .5em 0; }
#logmsg h1:first-child, #logmsg h2:first-child, #logmsg h3:first-child, #logmsg h4:first-child, #logmsg h5:first-child, #logmsg h6:first-child { margin-top: 0; }
#logmsg ul, #logmsg ol { padding: 0; list-style-position: inside; margin: 0 0 0 1em; }
#logmsg ul { text-indent: -1em; padding-left: 1em; }#logmsg ol { text-indent: -1.5em; padding-left: 1.5em; }
#logmsg > ul, #logmsg > ol { margin: 0 0 1em 0; }
#logmsg pre { background: #eee; padding: 1em; }
#logmsg blockquote { border: 1px solid #fa0; border-left-width: 10px; padding: 1em 1em 0 1em; background: white;}
#logmsg dl { margin: 0; }
#logmsg dt { font-weight: bold; }
#logmsg dd { margin: 0; padding: 0 0 0.5em 0; }
#logmsg dd:before { content:'\00bb';}
#logmsg table { border-spacing: 0px; border-collapse: collapse; border-top: 4px solid #fa0; border-bottom: 1px solid #fa0; background: #fff; }
#logmsg table th { text-align: left; font-weight: normal; padding: 0.2em 0.5em; border-top: 1px dotted #fa0; }
#logmsg table td { text-align: right; border-top: 1px dotted #fa0; padding: 0.2em 0.5em; }
#logmsg table thead th { text-align: center; border-bottom: 1px solid #fa0; }
#logmsg table th.Corner { text-align: left; }
#logmsg hr { border: none 0; border-top: 2px dashed #fa0; height: 1px; }
#header, #footer { color: #fff; background: #636; border: 1px #300 solid; padding: 6px; }
#patch { width: 100%; }
#patch h4 {font-family: verdana,arial,helvetica,sans-serif;font-size:10pt;padding:8px;background:#369;color:#fff;margin:0;}
#patch .propset h4, #patch .binary h4 {margin:0;}
#patch pre {padding:0;line-height:1.2em;margin:0;}
#patch .diff {width:100%;background:#eee;padding: 0 0 10px 0;overflow:auto;}
#patch .propset .diff, #patch .binary .diff {padding:10px 0;}
#patch span {display:block;padding:0 10px;}
#patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, #patch .copfile {border:1px solid #ccc;margin:10px 0;}
#patch ins {background:#dfd;text-decoration:none;display:block;padding:0 10px;}
#patch del {background:#fdd;text-decoration:none;display:block;padding:0 10px;}
#patch .lines, .info {color:#888;background:#fff;}
--></style>
<div id="msg">
<dl class="meta">
<dt>Revision</dt> <dd><a href="http://trac.webkit.org/projects/webkit/changeset/195311">195311</a></dd>
<dt>Author</dt> <dd>antti@apple.com</dd>
<dt>Date</dt> <dd>2016-01-19 13:26:35 -0800 (Tue, 19 Jan 2016)</dd>
</dl>
<h3>Log Message</h3>
<pre>Use references in SelectorChecker
https://bugs.webkit.org/show_bug.cgi?id=153240
Reviewed by Andreas Kling.
Element and selector can't be null in most places.
* css/ElementRuleCollector.cpp:
(WebCore::ElementRuleCollector::collectMatchingRules):
* css/SelectorChecker.cpp:
(WebCore::attributeValueMatches):
(WebCore::anyAttributeMatches):
(WebCore::SelectorChecker::checkOne):
(WebCore::SelectorChecker::matchSelectorList):
(WebCore::SelectorChecker::checkScrollbarPseudoClass):
(WebCore::SelectorChecker::determineLinkMatchType):
(WebCore::isFrameFocused):
(WebCore::SelectorChecker::matchesFocusPseudoClass):
* css/SelectorChecker.h:
(WebCore::SelectorChecker::isCommonPseudoClassSelector):
(WebCore::SelectorChecker::checkExactAttribute): Deleted.
* css/SelectorCheckerTestFunctions.h:
(WebCore::isAutofilled):
(WebCore::isDefaultButtonForForm):
(WebCore::isDisabled):
(WebCore::isEnabled):
(WebCore::isMediaDocument):
(WebCore::isChecked):
(WebCore::isInRange):
(WebCore::isOutOfRange):
(WebCore::isInvalid):
(WebCore::isOptionalFormControl):
(WebCore::isRequiredFormControl):
(WebCore::isValid):
(WebCore::isWindowInactive):
(WebCore::containslanguageSubtagMatchingRange):
(WebCore::matchesLangPseudoClass):
(WebCore::matchesReadOnlyPseudoClass):
(WebCore::matchesReadWritePseudoClass):
(WebCore::shouldAppearIndeterminate):
(WebCore::scrollbarMatchesEnabledPseudoClass):
(WebCore::scrollbarMatchesCornerPresentPseudoClass):
(WebCore::matchesFullScreenPseudoClass):
(WebCore::matchesFullScreenAnimatingFullScreenTransitionPseudoClass):
(WebCore::matchesFullScreenAncestorPseudoClass):
(WebCore::matchesFullScreenDocumentPseudoClass):
(WebCore::matchesFutureCuePseudoClass):
(WebCore::matchesPastCuePseudoClass):</pre>
<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkSourceWebCoreChangeLog">trunk/Source/WebCore/ChangeLog</a></li>
<li><a href="#trunkSourceWebCorecssElementRuleCollectorcpp">trunk/Source/WebCore/css/ElementRuleCollector.cpp</a></li>
<li><a href="#trunkSourceWebCorecssSelectorCheckercpp">trunk/Source/WebCore/css/SelectorChecker.cpp</a></li>
<li><a href="#trunkSourceWebCorecssSelectorCheckerh">trunk/Source/WebCore/css/SelectorChecker.h</a></li>
<li><a href="#trunkSourceWebCorecssSelectorCheckerTestFunctionsh">trunk/Source/WebCore/css/SelectorCheckerTestFunctions.h</a></li>
</ul>
</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/ChangeLog (195310 => 195311)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/ChangeLog        2016-01-19 21:00:35 UTC (rev 195310)
+++ trunk/Source/WebCore/ChangeLog        2016-01-19 21:26:35 UTC (rev 195311)
</span><span class="lines">@@ -1,3 +1,54 @@
</span><ins>+2016-01-19 Antti Koivisto <antti@apple.com>
+
+ Use references in SelectorChecker
+ https://bugs.webkit.org/show_bug.cgi?id=153240
+
+ Reviewed by Andreas Kling.
+
+ Element and selector can't be null in most places.
+
+ * css/ElementRuleCollector.cpp:
+ (WebCore::ElementRuleCollector::collectMatchingRules):
+ * css/SelectorChecker.cpp:
+ (WebCore::attributeValueMatches):
+ (WebCore::anyAttributeMatches):
+ (WebCore::SelectorChecker::checkOne):
+ (WebCore::SelectorChecker::matchSelectorList):
+ (WebCore::SelectorChecker::checkScrollbarPseudoClass):
+ (WebCore::SelectorChecker::determineLinkMatchType):
+ (WebCore::isFrameFocused):
+ (WebCore::SelectorChecker::matchesFocusPseudoClass):
+ * css/SelectorChecker.h:
+ (WebCore::SelectorChecker::isCommonPseudoClassSelector):
+ (WebCore::SelectorChecker::checkExactAttribute): Deleted.
+ * css/SelectorCheckerTestFunctions.h:
+ (WebCore::isAutofilled):
+ (WebCore::isDefaultButtonForForm):
+ (WebCore::isDisabled):
+ (WebCore::isEnabled):
+ (WebCore::isMediaDocument):
+ (WebCore::isChecked):
+ (WebCore::isInRange):
+ (WebCore::isOutOfRange):
+ (WebCore::isInvalid):
+ (WebCore::isOptionalFormControl):
+ (WebCore::isRequiredFormControl):
+ (WebCore::isValid):
+ (WebCore::isWindowInactive):
+ (WebCore::containslanguageSubtagMatchingRange):
+ (WebCore::matchesLangPseudoClass):
+ (WebCore::matchesReadOnlyPseudoClass):
+ (WebCore::matchesReadWritePseudoClass):
+ (WebCore::shouldAppearIndeterminate):
+ (WebCore::scrollbarMatchesEnabledPseudoClass):
+ (WebCore::scrollbarMatchesCornerPresentPseudoClass):
+ (WebCore::matchesFullScreenPseudoClass):
+ (WebCore::matchesFullScreenAnimatingFullScreenTransitionPseudoClass):
+ (WebCore::matchesFullScreenAncestorPseudoClass):
+ (WebCore::matchesFullScreenDocumentPseudoClass):
+ (WebCore::matchesFutureCuePseudoClass):
+ (WebCore::matchesPastCuePseudoClass):
+
</ins><span class="cx"> 2016-01-19 Chris Dumez <cdumez@apple.com>
</span><span class="cx">
</span><span class="cx"> Unreviewed, rolling out r195179.
</span></span></pre></div>
<a id="trunkSourceWebCorecssElementRuleCollectorcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/css/ElementRuleCollector.cpp (195310 => 195311)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/css/ElementRuleCollector.cpp        2016-01-19 21:00:35 UTC (rev 195310)
+++ trunk/Source/WebCore/css/ElementRuleCollector.cpp        2016-01-19 21:26:35 UTC (rev 195311)
</span><span class="lines">@@ -149,7 +149,7 @@
</span><span class="cx">
</span><span class="cx"> if (m_element.isLink())
</span><span class="cx"> collectMatchingRulesForList(matchRequest.ruleSet->linkPseudoClassRules(), matchRequest, ruleRange);
</span><del>- if (SelectorChecker::matchesFocusPseudoClass(&m_element))
</del><ins>+ if (SelectorChecker::matchesFocusPseudoClass(m_element))
</ins><span class="cx"> collectMatchingRulesForList(matchRequest.ruleSet->focusPseudoClassRules(), matchRequest, ruleRange);
</span><span class="cx"> collectMatchingRulesForList(matchRequest.ruleSet->tagRules(m_element.localName().impl(), m_element.isHTMLElement() && m_element.document().isHTMLDocument()), matchRequest, ruleRange);
</span><span class="cx"> collectMatchingRulesForList(matchRequest.ruleSet->universalRules(), matchRequest, ruleRange);
</span></span></pre></div>
<a id="trunkSourceWebCorecssSelectorCheckercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/css/SelectorChecker.cpp (195310 => 195311)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/css/SelectorChecker.cpp        2016-01-19 21:00:35 UTC (rev 195310)
+++ trunk/Source/WebCore/css/SelectorChecker.cpp        2016-01-19 21:26:35 UTC (rev 195311)
</span><span class="lines">@@ -504,14 +504,14 @@
</span><span class="cx"> return true;
</span><span class="cx"> }
</span><span class="cx">
</span><del>-static bool anyAttributeMatches(const Element* element, const CSSSelector* selector, const QualifiedName& selectorAttr, bool caseSensitive)
</del><ins>+static bool anyAttributeMatches(const Element& element, const CSSSelector& selector, const QualifiedName& selectorAttr, bool caseSensitive)
</ins><span class="cx"> {
</span><del>- ASSERT(element->hasAttributesWithoutUpdate());
- for (const Attribute& attribute : element->attributesIterator()) {
- if (!attribute.matches(selectorAttr.prefix(), element->isHTMLElement() ? selector->attributeCanonicalLocalName() : selectorAttr.localName(), selectorAttr.namespaceURI()))
</del><ins>+ ASSERT(element.hasAttributesWithoutUpdate());
+ for (const Attribute& attribute : element.attributesIterator()) {
+ if (!attribute.matches(selectorAttr.prefix(), element.isHTMLElement() ? selector.attributeCanonicalLocalName() : selectorAttr.localName(), selectorAttr.namespaceURI()))
</ins><span class="cx"> continue;
</span><span class="cx">
</span><del>- if (attributeValueMatches(attribute, selector->match(), selector->value(), caseSensitive))
</del><ins>+ if (attributeValueMatches(attribute, selector.match(), selector.value(), caseSensitive))
</ins><span class="cx"> return true;
</span><span class="cx"> }
</span><span class="cx">
</span><span class="lines">@@ -590,40 +590,38 @@
</span><span class="cx">
</span><span class="cx"> bool SelectorChecker::checkOne(CheckingContext& checkingContext, const LocalContext& context, PseudoIdSet& dynamicPseudoIdSet, MatchType& matchType, unsigned& specificity) const
</span><span class="cx"> {
</span><del>- const Element* element = context.element;
- const CSSSelector* const & selector = context.selector;
- ASSERT(element);
- ASSERT(selector);
</del><ins>+ const Element& element = *context.element;
+ const CSSSelector& selector = *context.selector;
</ins><span class="cx">
</span><del>- specificity = CSSSelector::addSpecificities(specificity, selector->simpleSelectorSpecificity());
</del><ins>+ specificity = CSSSelector::addSpecificities(specificity, selector.simpleSelectorSpecificity());
</ins><span class="cx">
</span><del>- if (selector->match() == CSSSelector::Tag)
- return tagMatches(*element, *selector);
</del><ins>+ if (selector.match() == CSSSelector::Tag)
+ return tagMatches(element, selector);
</ins><span class="cx">
</span><del>- if (selector->match() == CSSSelector::Class)
- return element->hasClass() && element->classNames().contains(selector->value());
</del><ins>+ if (selector.match() == CSSSelector::Class)
+ return element.hasClass() && element.classNames().contains(selector.value());
</ins><span class="cx">
</span><del>- if (selector->match() == CSSSelector::Id)
- return element->hasID() && element->idForStyleResolution() == selector->value();
</del><ins>+ if (selector.match() == CSSSelector::Id)
+ return element.hasID() && element.idForStyleResolution() == selector.value();
</ins><span class="cx">
</span><del>- if (selector->isAttributeSelector()) {
- if (!element->hasAttributes())
</del><ins>+ if (selector.isAttributeSelector()) {
+ if (!element.hasAttributes())
</ins><span class="cx"> return false;
</span><span class="cx">
</span><del>- const QualifiedName& attr = selector->attribute();
</del><ins>+ const QualifiedName& attr = selector.attribute();
</ins><span class="cx"> bool caseSensitive = true;
</span><del>- if (selector->attributeValueMatchingIsCaseInsensitive())
</del><ins>+ if (selector.attributeValueMatchingIsCaseInsensitive())
</ins><span class="cx"> caseSensitive = false;
</span><del>- else if (m_documentIsHTML && element->isHTMLElement() && !HTMLDocument::isCaseSensitiveAttribute(attr))
</del><ins>+ else if (m_documentIsHTML && element.isHTMLElement() && !HTMLDocument::isCaseSensitiveAttribute(attr))
</ins><span class="cx"> caseSensitive = false;
</span><span class="cx">
</span><span class="cx"> return anyAttributeMatches(element, selector, attr, caseSensitive);
</span><span class="cx"> }
</span><span class="cx">
</span><del>- if (selector->match() == CSSSelector::PseudoClass) {
</del><ins>+ if (selector.match() == CSSSelector::PseudoClass) {
</ins><span class="cx"> // Handle :not up front.
</span><del>- if (selector->pseudoClassType() == CSSSelector::PseudoClassNot) {
- const CSSSelectorList* selectorList = selector->selectorList();
</del><ins>+ if (selector.pseudoClassType() == CSSSelector::PseudoClassNot) {
+ const CSSSelectorList* selectorList = selector.selectorList();
</ins><span class="cx">
</span><span class="cx"> for (const CSSSelector* subselector = selectorList->first(); subselector; subselector = CSSSelectorList::next(subselector)) {
</span><span class="cx"> LocalContext subcontext(context);
</span><span class="lines">@@ -640,21 +638,22 @@
</span><span class="cx"> }
</span><span class="cx"> }
</span><span class="cx"> return true;
</span><del>- } else if (context.hasScrollbarPseudo) {
</del><ins>+ }
+ if (context.hasScrollbarPseudo) {
</ins><span class="cx"> // CSS scrollbars match a specific subset of pseudo classes, and they have specialized rules for each
</span><span class="cx"> // (since there are no elements involved except with window-inactive).
</span><del>- return checkScrollbarPseudoClass(checkingContext, *context.element, selector);
</del><ins>+ return checkScrollbarPseudoClass(checkingContext, element, selector);
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> // Normal element pseudo class checking.
</span><del>- switch (selector->pseudoClassType()) {
</del><ins>+ switch (selector.pseudoClassType()) {
</ins><span class="cx"> // Pseudo classes:
</span><span class="cx"> case CSSSelector::PseudoClassNot:
</span><span class="cx"> break; // Already handled up above.
</span><span class="cx"> case CSSSelector::PseudoClassEmpty:
</span><span class="cx"> {
</span><span class="cx"> bool result = true;
</span><del>- for (Node* node = element->firstChild(); node; node = node->nextSibling()) {
</del><ins>+ for (Node* node = element.firstChild(); node; node = node->nextSibling()) {
</ins><span class="cx"> if (is<Element>(*node)) {
</span><span class="cx"> result = false;
</span><span class="cx"> break;
</span><span class="lines">@@ -673,61 +672,61 @@
</span><span class="cx"> }
</span><span class="cx"> case CSSSelector::PseudoClassFirstChild:
</span><span class="cx"> // first-child matches the first child that is an element
</span><del>- if (const Element* parentElement = element->parentElement()) {
- bool isFirstChild = isFirstChildElement(*element);
</del><ins>+ if (const Element* parentElement = element.parentElement()) {
+ bool isFirstChild = isFirstChildElement(element);
</ins><span class="cx"> if (isFirstChild)
</span><del>- addStyleRelation(checkingContext, *element, StyleRelation::FirstChild);
</del><ins>+ addStyleRelation(checkingContext, element, StyleRelation::FirstChild);
</ins><span class="cx"> addStyleRelation(checkingContext, *parentElement, StyleRelation::ChildrenAffectedByFirstChildRules);
</span><span class="cx"> return isFirstChild;
</span><span class="cx"> }
</span><span class="cx"> break;
</span><span class="cx"> case CSSSelector::PseudoClassFirstOfType:
</span><span class="cx"> // first-of-type matches the first element of its type
</span><del>- if (element->parentElement()) {
- addStyleRelation(checkingContext, *element, StyleRelation::AffectedByPreviousSibling);
- return isFirstOfType(checkingContext, *element, element->tagQName());
</del><ins>+ if (element.parentElement()) {
+ addStyleRelation(checkingContext, element, StyleRelation::AffectedByPreviousSibling);
+ return isFirstOfType(checkingContext, element, element.tagQName());
</ins><span class="cx"> }
</span><span class="cx"> break;
</span><span class="cx"> case CSSSelector::PseudoClassLastChild:
</span><span class="cx"> // last-child matches the last child that is an element
</span><del>- if (const Element* parentElement = element->parentElement()) {
- bool isLastChild = parentElement->isFinishedParsingChildren() && isLastChildElement(*element);
</del><ins>+ if (const Element* parentElement = element.parentElement()) {
+ bool isLastChild = parentElement->isFinishedParsingChildren() && isLastChildElement(element);
</ins><span class="cx"> if (isLastChild)
</span><del>- addStyleRelation(checkingContext, *element, StyleRelation::LastChild);
</del><ins>+ addStyleRelation(checkingContext, element, StyleRelation::LastChild);
</ins><span class="cx"> addStyleRelation(checkingContext, *parentElement, StyleRelation::ChildrenAffectedByLastChildRules);
</span><span class="cx"> return isLastChild;
</span><span class="cx"> }
</span><span class="cx"> break;
</span><span class="cx"> case CSSSelector::PseudoClassLastOfType:
</span><span class="cx"> // last-of-type matches the last element of its type
</span><del>- if (Element* parentElement = element->parentElement()) {
</del><ins>+ if (Element* parentElement = element.parentElement()) {
</ins><span class="cx"> addStyleRelation(checkingContext, *parentElement, StyleRelation::ChildrenAffectedByBackwardPositionalRules);
</span><span class="cx"> if (!parentElement->isFinishedParsingChildren())
</span><span class="cx"> return false;
</span><del>- return isLastOfType(*element, element->tagQName());
</del><ins>+ return isLastOfType(element, element.tagQName());
</ins><span class="cx"> }
</span><span class="cx"> break;
</span><span class="cx"> case CSSSelector::PseudoClassOnlyChild:
</span><del>- if (Element* parentElement = element->parentElement()) {
- bool firstChild = isFirstChildElement(*element);
- bool onlyChild = firstChild && parentElement->isFinishedParsingChildren() && isLastChildElement(*element);
</del><ins>+ if (Element* parentElement = element.parentElement()) {
+ bool firstChild = isFirstChildElement(element);
+ bool onlyChild = firstChild && parentElement->isFinishedParsingChildren() && isLastChildElement(element);
</ins><span class="cx"> addStyleRelation(checkingContext, *parentElement, StyleRelation::ChildrenAffectedByFirstChildRules);
</span><span class="cx"> addStyleRelation(checkingContext, *parentElement, StyleRelation::ChildrenAffectedByLastChildRules);
</span><span class="cx"> if (firstChild)
</span><del>- addStyleRelation(checkingContext, *element, StyleRelation::FirstChild);
</del><ins>+ addStyleRelation(checkingContext, element, StyleRelation::FirstChild);
</ins><span class="cx"> if (onlyChild)
</span><del>- addStyleRelation(checkingContext, *element, StyleRelation::LastChild);
</del><ins>+ addStyleRelation(checkingContext, element, StyleRelation::LastChild);
</ins><span class="cx"> return onlyChild;
</span><span class="cx"> }
</span><span class="cx"> break;
</span><span class="cx"> case CSSSelector::PseudoClassOnlyOfType:
</span><span class="cx"> // FIXME: This selector is very slow.
</span><del>- if (Element* parentElement = element->parentElement()) {
- addStyleRelation(checkingContext, *element, StyleRelation::AffectedByPreviousSibling);
</del><ins>+ if (Element* parentElement = element.parentElement()) {
+ addStyleRelation(checkingContext, element, StyleRelation::AffectedByPreviousSibling);
</ins><span class="cx"> addStyleRelation(checkingContext, *parentElement, StyleRelation::ChildrenAffectedByBackwardPositionalRules);
</span><span class="cx"> if (!parentElement->isFinishedParsingChildren())
</span><span class="cx"> return false;
</span><del>- return isFirstOfType(checkingContext, *element, element->tagQName()) && isLastOfType(*element, element->tagQName());
</del><ins>+ return isFirstOfType(checkingContext, element, element.tagQName()) && isLastOfType(element, element.tagQName());
</ins><span class="cx"> }
</span><span class="cx"> break;
</span><span class="cx"> case CSSSelector::PseudoClassMatches:
</span><span class="lines">@@ -736,7 +735,7 @@
</span><span class="cx"> unsigned maxSpecificity = 0;
</span><span class="cx">
</span><span class="cx"> MatchType localMatchType = MatchType::VirtualPseudoElementOnly;
</span><del>- for (const CSSSelector* subselector = selector->selectorList()->first(); subselector; subselector = CSSSelectorList::next(subselector)) {
</del><ins>+ for (const CSSSelector* subselector = selector.selectorList()->first(); subselector; subselector = CSSSelectorList::next(subselector)) {
</ins><span class="cx"> LocalContext subcontext(context);
</span><span class="cx"> subcontext.inFunctionalPseudoClass = true;
</span><span class="cx"> subcontext.pseudoElementEffective = context.pseudoElementEffective;
</span><span class="lines">@@ -762,28 +761,27 @@
</span><span class="cx"> return hasMatchedAnything;
</span><span class="cx"> }
</span><span class="cx"> case CSSSelector::PseudoClassPlaceholderShown:
</span><del>- if (is<HTMLTextFormControlElement>(*element)) {
- addStyleRelation(checkingContext, *element, StyleRelation::Unique);
- return downcast<HTMLTextFormControlElement>(*element).isPlaceholderVisible();
</del><ins>+ if (is<HTMLTextFormControlElement>(element)) {
+ addStyleRelation(checkingContext, element, StyleRelation::Unique);
+ return downcast<HTMLTextFormControlElement>(element).isPlaceholderVisible();
</ins><span class="cx"> }
</span><span class="cx"> return false;
</span><span class="cx"> case CSSSelector::PseudoClassNthChild:
</span><del>- if (!selector->parseNth())
</del><ins>+ if (!selector.parseNth())
</ins><span class="cx"> break;
</span><del>- if (element->parentElement()) {
- if (const CSSSelectorList* selectorList = selector->selectorList()) {
</del><ins>+ if (element.parentElement()) {
+ if (const CSSSelectorList* selectorList = selector.selectorList()) {
</ins><span class="cx"> unsigned selectorListSpecificity;
</span><del>- if (matchSelectorList(checkingContext, context, *element, *selectorList, selectorListSpecificity))
- specificity = CSSSelector::addSpecificities(specificity, selectorListSpecificity);
- else
</del><ins>+ if (!matchSelectorList(checkingContext, context, element, *selectorList, selectorListSpecificity))
</ins><span class="cx"> return false;
</span><ins>+ specificity = CSSSelector::addSpecificities(specificity, selectorListSpecificity);
</ins><span class="cx"> }
</span><span class="cx">
</span><del>- addStyleRelation(checkingContext, *element, StyleRelation::AffectedByPreviousSibling);
</del><ins>+ addStyleRelation(checkingContext, element, StyleRelation::AffectedByPreviousSibling);
</ins><span class="cx">
</span><span class="cx"> int count = 1;
</span><del>- if (const CSSSelectorList* selectorList = selector->selectorList()) {
- for (Element* sibling = ElementTraversal::previousSibling(*element); sibling; sibling = ElementTraversal::previousSibling(*sibling)) {
</del><ins>+ if (const CSSSelectorList* selectorList = selector.selectorList()) {
+ for (Element* sibling = ElementTraversal::previousSibling(element); sibling; sibling = ElementTraversal::previousSibling(*sibling)) {
</ins><span class="cx"> addStyleRelation(checkingContext, *sibling, StyleRelation::AffectsNextSibling);
</span><span class="cx">
</span><span class="cx"> unsigned ignoredSpecificity;
</span><span class="lines">@@ -791,36 +789,35 @@
</span><span class="cx"> ++count;
</span><span class="cx"> }
</span><span class="cx"> } else {
</span><del>- count += countElementsBefore(checkingContext, *element);
- addStyleRelation(checkingContext, *element, StyleRelation::NthChildIndex, count);
</del><ins>+ count += countElementsBefore(checkingContext, element);
+ addStyleRelation(checkingContext, element, StyleRelation::NthChildIndex, count);
</ins><span class="cx"> }
</span><span class="cx">
</span><del>- if (selector->matchNth(count))
</del><ins>+ if (selector.matchNth(count))
</ins><span class="cx"> return true;
</span><span class="cx"> }
</span><span class="cx"> break;
</span><span class="cx"> case CSSSelector::PseudoClassNthOfType:
</span><del>- if (!selector->parseNth())
</del><ins>+ if (!selector.parseNth())
</ins><span class="cx"> break;
</span><span class="cx">
</span><del>- if (element->parentElement()) {
- addStyleRelation(checkingContext, *element, StyleRelation::AffectedByPreviousSibling);
</del><ins>+ if (element.parentElement()) {
+ addStyleRelation(checkingContext, element, StyleRelation::AffectedByPreviousSibling);
</ins><span class="cx">
</span><del>- int count = 1 + countElementsOfTypeBefore(checkingContext, *element, element->tagQName());
- if (selector->matchNth(count))
</del><ins>+ int count = 1 + countElementsOfTypeBefore(checkingContext, element, element.tagQName());
+ if (selector.matchNth(count))
</ins><span class="cx"> return true;
</span><span class="cx"> }
</span><span class="cx"> break;
</span><span class="cx"> case CSSSelector::PseudoClassNthLastChild:
</span><del>- if (!selector->parseNth())
</del><ins>+ if (!selector.parseNth())
</ins><span class="cx"> break;
</span><del>- if (Element* parentElement = element->parentElement()) {
- if (const CSSSelectorList* selectorList = selector->selectorList()) {
</del><ins>+ if (Element* parentElement = element.parentElement()) {
+ if (const CSSSelectorList* selectorList = selector.selectorList()) {
</ins><span class="cx"> unsigned selectorListSpecificity;
</span><del>- if (matchSelectorList(checkingContext, context, *element, *selectorList, selectorListSpecificity))
- specificity = CSSSelector::addSpecificities(specificity, selectorListSpecificity);
- else
</del><ins>+ if (!matchSelectorList(checkingContext, context, element, *selectorList, selectorListSpecificity))
</ins><span class="cx"> return false;
</span><ins>+ specificity = CSSSelector::addSpecificities(specificity, selectorListSpecificity);
</ins><span class="cx">
</span><span class="cx"> addStyleRelation(checkingContext, *parentElement, StyleRelation::ChildrenAffectedByPropertyBasedBackwardPositionalRules);
</span><span class="cx"> } else
</span><span class="lines">@@ -830,35 +827,35 @@
</span><span class="cx"> return false;
</span><span class="cx">
</span><span class="cx"> int count = 1;
</span><del>- if (const CSSSelectorList* selectorList = selector->selectorList()) {
- for (Element* sibling = ElementTraversal::nextSibling(*element); sibling; sibling = ElementTraversal::nextSibling(*sibling)) {
</del><ins>+ if (const CSSSelectorList* selectorList = selector.selectorList()) {
+ for (Element* sibling = ElementTraversal::nextSibling(element); sibling; sibling = ElementTraversal::nextSibling(*sibling)) {
</ins><span class="cx"> unsigned ignoredSpecificity;
</span><span class="cx"> if (matchSelectorList(checkingContext, context, *sibling, *selectorList, ignoredSpecificity))
</span><span class="cx"> ++count;
</span><span class="cx"> }
</span><span class="cx"> } else
</span><del>- count += countElementsAfter(*element);
</del><ins>+ count += countElementsAfter(element);
</ins><span class="cx">
</span><del>- if (selector->matchNth(count))
</del><ins>+ if (selector.matchNth(count))
</ins><span class="cx"> return true;
</span><span class="cx"> }
</span><span class="cx"> break;
</span><span class="cx"> case CSSSelector::PseudoClassNthLastOfType:
</span><del>- if (!selector->parseNth())
</del><ins>+ if (!selector.parseNth())
</ins><span class="cx"> break;
</span><del>- if (Element* parentElement = element->parentElement()) {
</del><ins>+ if (Element* parentElement = element.parentElement()) {
</ins><span class="cx"> addStyleRelation(checkingContext, *parentElement, StyleRelation::ChildrenAffectedByBackwardPositionalRules);
</span><span class="cx">
</span><span class="cx"> if (!parentElement->isFinishedParsingChildren())
</span><span class="cx"> return false;
</span><span class="cx">
</span><del>- int count = 1 + countElementsOfTypeAfter(*element, element->tagQName());
- if (selector->matchNth(count))
</del><ins>+ int count = 1 + countElementsOfTypeAfter(element, element.tagQName());
+ if (selector.matchNth(count))
</ins><span class="cx"> return true;
</span><span class="cx"> }
</span><span class="cx"> break;
</span><span class="cx"> case CSSSelector::PseudoClassTarget:
</span><del>- if (element == element->document().cssTarget())
</del><ins>+ if (&element == element.document().cssTarget())
</ins><span class="cx"> return true;
</span><span class="cx"> break;
</span><span class="cx"> case CSSSelector::PseudoClassAny:
</span><span class="lines">@@ -866,7 +863,7 @@
</span><span class="cx"> LocalContext subcontext(context);
</span><span class="cx"> subcontext.inFunctionalPseudoClass = true;
</span><span class="cx"> subcontext.pseudoElementEffective = false;
</span><del>- for (subcontext.selector = selector->selectorList()->first(); subcontext.selector; subcontext.selector = CSSSelectorList::next(subcontext.selector)) {
</del><ins>+ for (subcontext.selector = selector.selectorList()->first(); subcontext.selector; subcontext.selector = CSSSelectorList::next(subcontext.selector)) {
</ins><span class="cx"> subcontext.firstSelectorOfTheFragment = subcontext.selector;
</span><span class="cx"> PseudoIdSet ignoreDynamicPseudo;
</span><span class="cx"> unsigned ingoredSpecificity = 0;
</span><span class="lines">@@ -876,39 +873,39 @@
</span><span class="cx"> }
</span><span class="cx"> break;
</span><span class="cx"> case CSSSelector::PseudoClassAutofill:
</span><del>- return isAutofilled(*element);
</del><ins>+ return isAutofilled(element);
</ins><span class="cx"> case CSSSelector::PseudoClassAnyLink:
</span><span class="cx"> case CSSSelector::PseudoClassAnyLinkDeprecated:
</span><span class="cx"> case CSSSelector::PseudoClassLink:
</span><span class="cx"> // :visited and :link matches are separated later when applying the style. Here both classes match all links...
</span><del>- return element->isLink();
</del><ins>+ return element.isLink();
</ins><span class="cx"> case CSSSelector::PseudoClassVisited:
</span><span class="cx"> // ...except if :visited matching is disabled for ancestor/sibling matching.
</span><span class="cx"> // Inside functional pseudo class except for :not, :visited never matches.
</span><span class="cx"> if (context.inFunctionalPseudoClass)
</span><span class="cx"> return false;
</span><del>- return element->isLink() && context.visitedMatchType == VisitedMatchType::Enabled;
</del><ins>+ return element.isLink() && context.visitedMatchType == VisitedMatchType::Enabled;
</ins><span class="cx"> case CSSSelector::PseudoClassDrag:
</span><del>- addStyleRelation(checkingContext, *element, StyleRelation::AffectedByDrag);
</del><ins>+ addStyleRelation(checkingContext, element, StyleRelation::AffectedByDrag);
</ins><span class="cx">
</span><del>- if (element->renderer() && element->renderer()->isDragging())
</del><ins>+ if (element.renderer() && element.renderer()->isDragging())
</ins><span class="cx"> return true;
</span><span class="cx"> break;
</span><span class="cx"> case CSSSelector::PseudoClassFocus:
</span><span class="cx"> return matchesFocusPseudoClass(element);
</span><span class="cx"> case CSSSelector::PseudoClassHover:
</span><del>- if (m_strictParsing || element->isLink() || canMatchHoverOrActiveInQuirksMode(context)) {
- addStyleRelation(checkingContext, *element, StyleRelation::AffectedByHover);
</del><ins>+ if (m_strictParsing || element.isLink() || canMatchHoverOrActiveInQuirksMode(context)) {
+ addStyleRelation(checkingContext, element, StyleRelation::AffectedByHover);
</ins><span class="cx">
</span><del>- if (element->hovered() || InspectorInstrumentation::forcePseudoState(const_cast<Element&>(*element), CSSSelector::PseudoClassHover))
</del><ins>+ if (element.hovered() || InspectorInstrumentation::forcePseudoState(const_cast<Element&>(element), CSSSelector::PseudoClassHover))
</ins><span class="cx"> return true;
</span><span class="cx"> }
</span><span class="cx"> break;
</span><span class="cx"> case CSSSelector::PseudoClassActive:
</span><del>- if (m_strictParsing || element->isLink() || canMatchHoverOrActiveInQuirksMode(context)) {
- addStyleRelation(checkingContext, *element, StyleRelation::AffectedByActive);
</del><ins>+ if (m_strictParsing || element.isLink() || canMatchHoverOrActiveInQuirksMode(context)) {
+ addStyleRelation(checkingContext, element, StyleRelation::AffectedByActive);
</ins><span class="cx">
</span><del>- if (element->active() || InspectorInstrumentation::forcePseudoState(const_cast<Element&>(*element), CSSSelector::PseudoClassActive))
</del><ins>+ if (element.active() || InspectorInstrumentation::forcePseudoState(const_cast<Element&>(element), CSSSelector::PseudoClassActive))
</ins><span class="cx"> return true;
</span><span class="cx"> }
</span><span class="cx"> break;
</span><span class="lines">@@ -933,17 +930,17 @@
</span><span class="cx"> case CSSSelector::PseudoClassInvalid:
</span><span class="cx"> return isInvalid(element);
</span><span class="cx"> case CSSSelector::PseudoClassChecked:
</span><del>- return isChecked(*element);
</del><ins>+ return isChecked(element);
</ins><span class="cx"> case CSSSelector::PseudoClassIndeterminate:
</span><span class="cx"> return shouldAppearIndeterminate(element);
</span><span class="cx"> case CSSSelector::PseudoClassRoot:
</span><del>- if (element == element->document().documentElement())
</del><ins>+ if (&element == element.document().documentElement())
</ins><span class="cx"> return true;
</span><span class="cx"> break;
</span><span class="cx"> case CSSSelector::PseudoClassLang:
</span><span class="cx"> {
</span><del>- ASSERT(selector->langArgumentList() && !selector->langArgumentList()->isEmpty());
- return matchesLangPseudoClass(element, *selector->langArgumentList());
</del><ins>+ ASSERT(selector.langArgumentList() && !selector.langArgumentList()->isEmpty());
+ return matchesLangPseudoClass(element, *selector.langArgumentList());
</ins><span class="cx"> }
</span><span class="cx"> #if ENABLE(FULLSCREEN_API)
</span><span class="cx"> case CSSSelector::PseudoClassFullScreen:
</span><span class="lines">@@ -968,8 +965,8 @@
</span><span class="cx">
</span><span class="cx"> case CSSSelector::PseudoClassScope:
</span><span class="cx"> {
</span><del>- const Node* contextualReferenceNode = !checkingContext.scope ? element->document().documentElement() : checkingContext.scope;
- if (element == contextualReferenceNode)
</del><ins>+ const Node* contextualReferenceNode = !checkingContext.scope ? element.document().documentElement() : checkingContext.scope;
+ if (&element == contextualReferenceNode)
</ins><span class="cx"> return true;
</span><span class="cx"> break;
</span><span class="cx"> }
</span><span class="lines">@@ -1010,7 +1007,7 @@
</span><span class="cx"> return false;
</span><span class="cx"> }
</span><span class="cx"> #if ENABLE(VIDEO_TRACK)
</span><del>- if (selector->match() == CSSSelector::PseudoElement && selector->pseudoElementType() == CSSSelector::PseudoElementCue) {
</del><ins>+ if (selector.match() == CSSSelector::PseudoElement && selector.pseudoElementType() == CSSSelector::PseudoElementCue) {
</ins><span class="cx"> LocalContext subcontext(context);
</span><span class="cx">
</span><span class="cx"> const CSSSelector* const & selector = context.selector;
</span><span class="lines">@@ -1054,13 +1051,13 @@
</span><span class="cx"> return hasMatchedAnything;
</span><span class="cx"> }
</span><span class="cx">
</span><del>-bool SelectorChecker::checkScrollbarPseudoClass(const CheckingContext& checkingContext, const Element& element, const CSSSelector* selector) const
</del><ins>+bool SelectorChecker::checkScrollbarPseudoClass(const CheckingContext& checkingContext, const Element& element, const CSSSelector& selector) const
</ins><span class="cx"> {
</span><del>- ASSERT(selector->match() == CSSSelector::PseudoClass);
</del><ins>+ ASSERT(selector.match() == CSSSelector::PseudoClass);
</ins><span class="cx">
</span><del>- switch (selector->pseudoClassType()) {
</del><ins>+ switch (selector.pseudoClassType()) {
</ins><span class="cx"> case CSSSelector::PseudoClassWindowInactive:
</span><del>- return isWindowInactive(&element);
</del><ins>+ return isWindowInactive(element);
</ins><span class="cx"> case CSSSelector::PseudoClassEnabled:
</span><span class="cx"> return scrollbarMatchesEnabledPseudoClass(checkingContext);
</span><span class="cx"> case CSSSelector::PseudoClassDisabled:
</span><span class="lines">@@ -1124,16 +1121,16 @@
</span><span class="cx"> return linkMatchType;
</span><span class="cx"> }
</span><span class="cx">
</span><del>-static bool isFrameFocused(const Element* element)
</del><ins>+static bool isFrameFocused(const Element& element)
</ins><span class="cx"> {
</span><del>- return element->document().frame() && element->document().frame()->selection().isFocusedAndActive();
</del><ins>+ return element.document().frame() && element.document().frame()->selection().isFocusedAndActive();
</ins><span class="cx"> }
</span><span class="cx">
</span><del>-bool SelectorChecker::matchesFocusPseudoClass(const Element* element)
</del><ins>+bool SelectorChecker::matchesFocusPseudoClass(const Element& element)
</ins><span class="cx"> {
</span><del>- if (InspectorInstrumentation::forcePseudoState(const_cast<Element&>(*element), CSSSelector::PseudoClassFocus))
</del><ins>+ if (InspectorInstrumentation::forcePseudoState(const_cast<Element&>(element), CSSSelector::PseudoClassFocus))
</ins><span class="cx"> return true;
</span><del>- return element->focused() && isFrameFocused(element);
</del><ins>+ return element.focused() && isFrameFocused(element);
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> }
</span></span></pre></div>
<a id="trunkSourceWebCorecssSelectorCheckerh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/css/SelectorChecker.h (195310 => 195311)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/css/SelectorChecker.h        2016-01-19 21:00:35 UTC (rev 195310)
+++ trunk/Source/WebCore/css/SelectorChecker.h        2016-01-19 21:26:35 UTC (rev 195311)
</span><span class="lines">@@ -118,8 +118,7 @@
</span><span class="cx"> bool match(const CSSSelector&, const Element&, CheckingContext&, unsigned& specificity) const;
</span><span class="cx">
</span><span class="cx"> static bool isCommonPseudoClassSelector(const CSSSelector*);
</span><del>- static bool matchesFocusPseudoClass(const Element*);
- static bool checkExactAttribute(const Element*, const CSSSelector*, const QualifiedName& selectorAttributeName, const AtomicStringImpl* value);
</del><ins>+ static bool matchesFocusPseudoClass(const Element&);
</ins><span class="cx">
</span><span class="cx"> enum LinkMatchMask { MatchDefault = 0, MatchLink = 1, MatchVisited = 2, MatchAll = MatchLink | MatchVisited };
</span><span class="cx"> static unsigned determineLinkMatchType(const CSSSelector*);
</span><span class="lines">@@ -131,7 +130,7 @@
</span><span class="cx"> bool checkOne(CheckingContext&, const LocalContext&, PseudoIdSet&, MatchType&, unsigned& specificity) const;
</span><span class="cx"> bool matchSelectorList(CheckingContext&, const LocalContext&, const Element&, const CSSSelectorList&, unsigned& specificity) const;
</span><span class="cx">
</span><del>- bool checkScrollbarPseudoClass(const CheckingContext&, const Element&, const CSSSelector*) const;
</del><ins>+ bool checkScrollbarPseudoClass(const CheckingContext&, const Element&, const CSSSelector&) const;
</ins><span class="cx">
</span><span class="cx"> bool m_strictParsing;
</span><span class="cx"> bool m_documentIsHTML;
</span><span class="lines">@@ -149,18 +148,6 @@
</span><span class="cx"> || pseudoType == CSSSelector::PseudoClassFocus;
</span><span class="cx"> }
</span><span class="cx">
</span><del>-inline bool SelectorChecker::checkExactAttribute(const Element* element, const CSSSelector* selector, const QualifiedName& selectorAttributeName, const AtomicStringImpl* value)
-{
- if (!element->hasAttributesWithoutUpdate())
- return false;
- const AtomicString& localName = element->isHTMLElement() ? selector->attributeCanonicalLocalName() : selectorAttributeName.localName();
- for (const Attribute& attribute : element->attributesIterator()) {
- if (attribute.matches(selectorAttributeName.prefix(), localName, selectorAttributeName.namespaceURI()) && (!value || attribute.value().impl() == value))
- return true;
- }
- return false;
</del><span class="cx"> }
</span><span class="cx">
</span><del>-}
-
</del><span class="cx"> #endif
</span></span></pre></div>
<a id="trunkSourceWebCorecssSelectorCheckerTestFunctionsh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/css/SelectorCheckerTestFunctions.h (195310 => 195311)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/css/SelectorCheckerTestFunctions.h        2016-01-19 21:00:35 UTC (rev 195310)
+++ trunk/Source/WebCore/css/SelectorCheckerTestFunctions.h        2016-01-19 21:26:35 UTC (rev 195311)
</span><span class="lines">@@ -46,26 +46,26 @@
</span><span class="cx"> return is<HTMLInputElement>(element) && downcast<HTMLInputElement>(element).isAutoFilled();
</span><span class="cx"> }
</span><span class="cx">
</span><del>-ALWAYS_INLINE bool isDefaultButtonForForm(const Element* element)
</del><ins>+ALWAYS_INLINE bool isDefaultButtonForForm(const Element& element)
</ins><span class="cx"> {
</span><del>- return element->isDefaultButtonForForm();
</del><ins>+ return element.isDefaultButtonForForm();
</ins><span class="cx"> }
</span><span class="cx">
</span><del>-ALWAYS_INLINE bool isDisabled(const Element* element)
</del><ins>+ALWAYS_INLINE bool isDisabled(const Element& element)
</ins><span class="cx"> {
</span><del>- return (is<HTMLFormControlElement>(*element) || is<HTMLOptionElement>(*element) || is<HTMLOptGroupElement>(*element))
- && element->isDisabledFormControl();
</del><ins>+ return (is<HTMLFormControlElement>(element) || is<HTMLOptionElement>(element) || is<HTMLOptGroupElement>(element))
+ && element.isDisabledFormControl();
</ins><span class="cx"> }
</span><span class="cx">
</span><del>-ALWAYS_INLINE bool isEnabled(const Element* element)
</del><ins>+ALWAYS_INLINE bool isEnabled(const Element& element)
</ins><span class="cx"> {
</span><del>- return (is<HTMLFormControlElement>(*element) || is<HTMLOptionElement>(*element) || is<HTMLOptGroupElement>(*element))
- && !element->isDisabledFormControl();
</del><ins>+ return (is<HTMLFormControlElement>(element) || is<HTMLOptionElement>(element) || is<HTMLOptGroupElement>(element))
+ && !element.isDisabledFormControl();
</ins><span class="cx"> }
</span><span class="cx">
</span><del>-ALWAYS_INLINE bool isMediaDocument(const Element* element)
</del><ins>+ALWAYS_INLINE bool isMediaDocument(const Element& element)
</ins><span class="cx"> {
</span><del>- return element->document().isMediaDocument();
</del><ins>+ return element.document().isMediaDocument();
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> ALWAYS_INLINE bool isChecked(const Element& element)
</span><span class="lines">@@ -83,39 +83,39 @@
</span><span class="cx"> return false;
</span><span class="cx"> }
</span><span class="cx">
</span><del>-ALWAYS_INLINE bool isInRange(const Element* element)
</del><ins>+ALWAYS_INLINE bool isInRange(const Element& element)
</ins><span class="cx"> {
</span><del>- return element->isInRange();
</del><ins>+ return element.isInRange();
</ins><span class="cx"> }
</span><span class="cx">
</span><del>-ALWAYS_INLINE bool isOutOfRange(const Element* element)
</del><ins>+ALWAYS_INLINE bool isOutOfRange(const Element& element)
</ins><span class="cx"> {
</span><del>- return element->isOutOfRange();
</del><ins>+ return element.isOutOfRange();
</ins><span class="cx"> }
</span><span class="cx">
</span><del>-ALWAYS_INLINE bool isInvalid(const Element* element)
</del><ins>+ALWAYS_INLINE bool isInvalid(const Element& element)
</ins><span class="cx"> {
</span><del>- return element->matchesInvalidPseudoClass();
</del><ins>+ return element.matchesInvalidPseudoClass();
</ins><span class="cx"> }
</span><span class="cx">
</span><del>-ALWAYS_INLINE bool isOptionalFormControl(const Element* element)
</del><ins>+ALWAYS_INLINE bool isOptionalFormControl(const Element& element)
</ins><span class="cx"> {
</span><del>- return element->isOptionalFormControl();
</del><ins>+ return element.isOptionalFormControl();
</ins><span class="cx"> }
</span><span class="cx">
</span><del>-ALWAYS_INLINE bool isRequiredFormControl(const Element* element)
</del><ins>+ALWAYS_INLINE bool isRequiredFormControl(const Element& element)
</ins><span class="cx"> {
</span><del>- return element->isRequiredFormControl();
</del><ins>+ return element.isRequiredFormControl();
</ins><span class="cx"> }
</span><span class="cx">
</span><del>-ALWAYS_INLINE bool isValid(const Element* element)
</del><ins>+ALWAYS_INLINE bool isValid(const Element& element)
</ins><span class="cx"> {
</span><del>- return element->matchesValidPseudoClass();
</del><ins>+ return element.matchesValidPseudoClass();
</ins><span class="cx"> }
</span><span class="cx">
</span><del>-ALWAYS_INLINE bool isWindowInactive(const Element* element)
</del><ins>+ALWAYS_INLINE bool isWindowInactive(const Element& element)
</ins><span class="cx"> {
</span><del>- auto* page = element->document().page();
</del><ins>+ auto* page = element.document().page();
</ins><span class="cx"> if (!page)
</span><span class="cx"> return false;
</span><span class="cx"> return !page->focusController().isActive();
</span><span class="lines">@@ -151,17 +151,15 @@
</span><span class="cx"> return false;
</span><span class="cx"> }
</span><span class="cx">
</span><del>-ALWAYS_INLINE bool matchesLangPseudoClass(const Element* element, const Vector<AtomicString>& argumentList)
</del><ins>+ALWAYS_INLINE bool matchesLangPseudoClass(const Element& element, const Vector<AtomicString>& argumentList)
</ins><span class="cx"> {
</span><del>- ASSERT(element);
-
</del><span class="cx"> AtomicString language;
</span><span class="cx"> #if ENABLE(VIDEO_TRACK)
</span><del>- if (is<WebVTTElement>(*element))
- language = downcast<WebVTTElement>(*element).language();
</del><ins>+ if (is<WebVTTElement>(element))
+ language = downcast<WebVTTElement>(element).language();
</ins><span class="cx"> else
</span><span class="cx"> #endif
</span><del>- language = element->computeInheritedLanguage();
</del><ins>+ language = element.computeInheritedLanguage();
</ins><span class="cx">
</span><span class="cx"> if (language.isEmpty())
</span><span class="cx"> return false;
</span><span class="lines">@@ -206,19 +204,19 @@
</span><span class="cx"> return false;
</span><span class="cx"> }
</span><span class="cx">
</span><del>-ALWAYS_INLINE bool matchesReadOnlyPseudoClass(const Element* element)
</del><ins>+ALWAYS_INLINE bool matchesReadOnlyPseudoClass(const Element& element)
</ins><span class="cx"> {
</span><del>- return !element->matchesReadWritePseudoClass();
</del><ins>+ return !element.matchesReadWritePseudoClass();
</ins><span class="cx"> }
</span><span class="cx">
</span><del>-ALWAYS_INLINE bool matchesReadWritePseudoClass(const Element* element)
</del><ins>+ALWAYS_INLINE bool matchesReadWritePseudoClass(const Element& element)
</ins><span class="cx"> {
</span><del>- return element->matchesReadWritePseudoClass();
</del><ins>+ return element.matchesReadWritePseudoClass();
</ins><span class="cx"> }
</span><span class="cx">
</span><del>-ALWAYS_INLINE bool shouldAppearIndeterminate(const Element* element)
</del><ins>+ALWAYS_INLINE bool shouldAppearIndeterminate(const Element& element)
</ins><span class="cx"> {
</span><del>- return element->shouldAppearIndeterminate();
</del><ins>+ return element.shouldAppearIndeterminate();
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> ALWAYS_INLINE bool scrollbarMatchesEnabledPseudoClass(const SelectorChecker::CheckingContext& context)
</span><span class="lines">@@ -325,50 +323,50 @@
</span><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> #if ENABLE(FULLSCREEN_API)
</span><del>-ALWAYS_INLINE bool matchesFullScreenPseudoClass(const Element* element)
</del><ins>+ALWAYS_INLINE bool matchesFullScreenPseudoClass(const Element& element)
</ins><span class="cx"> {
</span><span class="cx"> // While a Document is in the fullscreen state, and the document's current fullscreen
</span><span class="cx"> // element is an element in the document, the 'full-screen' pseudoclass applies to
</span><span class="cx"> // that element. Also, an <iframe>, <object> or <embed> element whose child browsing
</span><span class="cx"> // context's Document is in the fullscreen state has the 'full-screen' pseudoclass applied.
</span><del>- if (element->isFrameElementBase() && element->containsFullScreenElement())
</del><ins>+ if (element.isFrameElementBase() && element.containsFullScreenElement())
</ins><span class="cx"> return true;
</span><del>- if (!element->document().webkitIsFullScreen())
</del><ins>+ if (!element.document().webkitIsFullScreen())
</ins><span class="cx"> return false;
</span><del>- return element == element->document().webkitCurrentFullScreenElement();
</del><ins>+ return &element == element.document().webkitCurrentFullScreenElement();
</ins><span class="cx"> }
</span><span class="cx">
</span><del>-ALWAYS_INLINE bool matchesFullScreenAnimatingFullScreenTransitionPseudoClass(const Element* element)
</del><ins>+ALWAYS_INLINE bool matchesFullScreenAnimatingFullScreenTransitionPseudoClass(const Element& element)
</ins><span class="cx"> {
</span><del>- if (element != element->document().webkitCurrentFullScreenElement())
</del><ins>+ if (&element != element.document().webkitCurrentFullScreenElement())
</ins><span class="cx"> return false;
</span><del>- return element->document().isAnimatingFullScreen();
</del><ins>+ return element.document().isAnimatingFullScreen();
</ins><span class="cx"> }
</span><span class="cx">
</span><del>-ALWAYS_INLINE bool matchesFullScreenAncestorPseudoClass(const Element* element)
</del><ins>+ALWAYS_INLINE bool matchesFullScreenAncestorPseudoClass(const Element& element)
</ins><span class="cx"> {
</span><del>- return element->containsFullScreenElement();
</del><ins>+ return element.containsFullScreenElement();
</ins><span class="cx"> }
</span><span class="cx">
</span><del>-ALWAYS_INLINE bool matchesFullScreenDocumentPseudoClass(const Element* element)
</del><ins>+ALWAYS_INLINE bool matchesFullScreenDocumentPseudoClass(const Element& element)
</ins><span class="cx"> {
</span><span class="cx"> // While a Document is in the fullscreen state, the 'full-screen-document' pseudoclass applies
</span><span class="cx"> // to all elements of that Document.
</span><del>- if (!element->document().webkitIsFullScreen())
</del><ins>+ if (!element.document().webkitIsFullScreen())
</ins><span class="cx"> return false;
</span><span class="cx"> return true;
</span><span class="cx"> }
</span><span class="cx"> #endif
</span><span class="cx">
</span><span class="cx"> #if ENABLE(VIDEO_TRACK)
</span><del>-ALWAYS_INLINE bool matchesFutureCuePseudoClass(const Element* element)
</del><ins>+ALWAYS_INLINE bool matchesFutureCuePseudoClass(const Element& element)
</ins><span class="cx"> {
</span><del>- return is<WebVTTElement>(*element) && !downcast<WebVTTElement>(*element).isPastNode();
</del><ins>+ return is<WebVTTElement>(element) && !downcast<WebVTTElement>(element).isPastNode();
</ins><span class="cx"> }
</span><span class="cx">
</span><del>-ALWAYS_INLINE bool matchesPastCuePseudoClass(const Element* element)
</del><ins>+ALWAYS_INLINE bool matchesPastCuePseudoClass(const Element& element)
</ins><span class="cx"> {
</span><del>- return is<WebVTTElement>(*element) && downcast<WebVTTElement>(*element).isPastNode();
</del><ins>+ return is<WebVTTElement>(element) && downcast<WebVTTElement>(element).isPastNode();
</ins><span class="cx"> }
</span><span class="cx"> #endif
</span><span class="cx">
</span></span></pre>
</div>
</div>
</body>
</html>