Title: [203326] trunk/Source/WebCore
Revision
203326
Author
[email protected]
Date
2016-07-16 10:21:07 -0700 (Sat, 16 Jul 2016)

Log Message

Use fastHasAttribute() when possible
https://bugs.webkit.org/show_bug.cgi?id=159838

Reviewed by Ryosuke Niwa.

Use fastHasAttribute() when possible, for performance.

* editing/DeleteSelectionCommand.cpp:
(WebCore::DeleteSelectionCommand::makeStylingElementsDirectChildrenOfEditableRootToPreventStyleLoss):
* editing/markup.cpp:
(WebCore::createMarkupInternal):
* html/HTMLAnchorElement.cpp:
(WebCore::HTMLAnchorElement::draggable):
* html/HTMLFrameElementBase.cpp:
(WebCore::HTMLFrameElementBase::parseAttribute):
* mathml/MathMLSelectElement.cpp:
(WebCore::MathMLSelectElement::getSelectedSemanticsChild):
* rendering/RenderThemeIOS.mm:
(WebCore::RenderThemeIOS::adjustMenuListButtonStyle):

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (203325 => 203326)


--- trunk/Source/WebCore/ChangeLog	2016-07-16 16:33:11 UTC (rev 203325)
+++ trunk/Source/WebCore/ChangeLog	2016-07-16 17:21:07 UTC (rev 203326)
@@ -1,3 +1,25 @@
+2016-07-16  Chris Dumez  <[email protected]>
+
+        Use fastHasAttribute() when possible
+        https://bugs.webkit.org/show_bug.cgi?id=159838
+
+        Reviewed by Ryosuke Niwa.
+
+        Use fastHasAttribute() when possible, for performance.
+
+        * editing/DeleteSelectionCommand.cpp:
+        (WebCore::DeleteSelectionCommand::makeStylingElementsDirectChildrenOfEditableRootToPreventStyleLoss):
+        * editing/markup.cpp:
+        (WebCore::createMarkupInternal):
+        * html/HTMLAnchorElement.cpp:
+        (WebCore::HTMLAnchorElement::draggable):
+        * html/HTMLFrameElementBase.cpp:
+        (WebCore::HTMLFrameElementBase::parseAttribute):
+        * mathml/MathMLSelectElement.cpp:
+        (WebCore::MathMLSelectElement::getSelectedSemanticsChild):
+        * rendering/RenderThemeIOS.mm:
+        (WebCore::RenderThemeIOS::adjustMenuListButtonStyle):
+
 2016-07-16  Ryosuke Niwa  <[email protected]>
 
         Rename fastGetAttribute to attributeWithoutSynchronization

Modified: trunk/Source/WebCore/editing/DeleteSelectionCommand.cpp (203325 => 203326)


--- trunk/Source/WebCore/editing/DeleteSelectionCommand.cpp	2016-07-16 16:33:11 UTC (rev 203325)
+++ trunk/Source/WebCore/editing/DeleteSelectionCommand.cpp	2016-07-16 17:21:07 UTC (rev 203326)
@@ -434,7 +434,7 @@
     RefPtr<Node> node = range->firstNode();
     while (node && node != range->pastLastNode()) {
         RefPtr<Node> nextNode = NodeTraversal::next(*node);
-        if ((is<HTMLStyleElement>(*node) && !downcast<HTMLStyleElement>(*node).hasAttribute(scopedAttr)) || is<HTMLLinkElement>(*node)) {
+        if ((is<HTMLStyleElement>(*node) && !downcast<HTMLStyleElement>(*node).fastHasAttribute(scopedAttr)) || is<HTMLLinkElement>(*node)) {
             nextNode = NodeTraversal::nextSkippingChildren(*node);
             RefPtr<ContainerNode> rootEditableElement = node->rootEditableElement();
             if (rootEditableElement) {

Modified: trunk/Source/WebCore/editing/markup.cpp (203325 => 203326)


--- trunk/Source/WebCore/editing/markup.cpp	2016-07-16 16:33:11 UTC (rev 203325)
+++ trunk/Source/WebCore/editing/markup.cpp	2016-07-16 17:21:07 UTC (rev 203326)
@@ -629,7 +629,7 @@
                 // Bring the background attribute over, but not as an attribute because a background attribute on a div
                 // appears to have no effect.
                 if ((!fullySelectedRootStyle || !fullySelectedRootStyle->style() || !fullySelectedRootStyle->style()->getPropertyCSSValue(CSSPropertyBackgroundImage))
-                    && fullySelectedRoot->hasAttribute(backgroundAttr))
+                    && fullySelectedRoot->fastHasAttribute(backgroundAttr))
                     fullySelectedRootStyle->style()->setProperty(CSSPropertyBackgroundImage, "url('" + fullySelectedRoot->getAttribute(backgroundAttr) + "')");
 
                 if (fullySelectedRootStyle->style()) {

Modified: trunk/Source/WebCore/html/HTMLAnchorElement.cpp (203325 => 203326)


--- trunk/Source/WebCore/html/HTMLAnchorElement.cpp	2016-07-16 16:33:11 UTC (rev 203325)
+++ trunk/Source/WebCore/html/HTMLAnchorElement.cpp	2016-07-16 17:21:07 UTC (rev 203326)
@@ -281,7 +281,7 @@
         return true;
     if (equalLettersIgnoringASCIICase(value, "false"))
         return false;
-    return hasAttribute(hrefAttr);
+    return fastHasAttribute(hrefAttr);
 }
 
 URL HTMLAnchorElement::href() const

Modified: trunk/Source/WebCore/html/HTMLFrameElementBase.cpp (203325 => 203326)


--- trunk/Source/WebCore/html/HTMLFrameElementBase.cpp	2016-07-16 16:33:11 UTC (rev 203325)
+++ trunk/Source/WebCore/html/HTMLFrameElementBase.cpp	2016-07-16 17:21:07 UTC (rev 203326)
@@ -99,7 +99,7 @@
     else if (name == idAttr) {
         HTMLFrameOwnerElement::parseAttribute(name, value);
         // Falling back to using the 'id' attribute is not standard but some content relies on this behavior.
-        if (!hasAttribute(nameAttr))
+        if (!fastHasAttribute(nameAttr))
             m_frameName = value;
     } else if (name == nameAttr) {
         m_frameName = value;

Modified: trunk/Source/WebCore/mathml/MathMLSelectElement.cpp (203325 => 203326)


--- trunk/Source/WebCore/mathml/MathMLSelectElement.cpp	2016-07-16 16:33:11 UTC (rev 203325)
+++ trunk/Source/WebCore/mathml/MathMLSelectElement.cpp	2016-07-16 17:21:07 UTC (rev 203326)
@@ -174,7 +174,7 @@
 
         if (child->hasTagName(MathMLNames::annotationTag)) {
             // If the <annotation> element has an src attribute then it is a reference to arbitrary binary data and it is not clear whether we can display it. Hence we just ignore the annotation.
-            if (child->hasAttribute(MathMLNames::srcAttr))
+            if (child->fastHasAttribute(MathMLNames::srcAttr))
                 continue;
             // Otherwise, we assume it is a text annotation that can always be displayed and we stop here.
             return child;
@@ -182,7 +182,7 @@
 
         if (child->hasTagName(MathMLNames::annotation_xmlTag)) {
             // If the <annotation-xml> element has an src attribute then it is a reference to arbitrary binary data and it is not clear whether we can display it. Hence we just ignore the annotation.
-            if (child->hasAttribute(MathMLNames::srcAttr))
+            if (child->fastHasAttribute(MathMLNames::srcAttr))
                 continue;
             // If the <annotation-xml> element has an encoding attribute describing presentation MathML, SVG or HTML we assume the content can be displayed and we stop here.
             const AtomicString& value = child->attributeWithoutSynchronization(MathMLNames::encodingAttr);

Modified: trunk/Source/WebCore/rendering/RenderThemeIOS.mm (203325 => 203326)


--- trunk/Source/WebCore/rendering/RenderThemeIOS.mm	2016-07-16 16:33:11 UTC (rev 203325)
+++ trunk/Source/WebCore/rendering/RenderThemeIOS.mm	2016-07-16 17:21:07 UTC (rev 203326)
@@ -625,7 +625,7 @@
     // Enforce some default styles in the case that this is a non-multiple <select> element,
     // or a date input. We don't force these if this is just an element with
     // "-webkit-appearance: menulist-button".
-    if (is<HTMLSelectElement>(*element) && !element->hasAttribute(HTMLNames::multipleAttr))
+    if (is<HTMLSelectElement>(*element) && !element->fastHasAttribute(HTMLNames::multipleAttr))
         adjustSelectListButtonStyle(style, *element);
     else if (is<HTMLInputElement>(*element))
         adjustInputElementButtonStyle(style, downcast<HTMLInputElement>(*element));
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to