Changeset 203326 in webkit


Ignore:
Timestamp:
Jul 16, 2016, 10:21:07 AM (9 years ago)
Author:
Chris Dumez
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):

Location:
trunk/Source/WebCore
Files:
7 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r203324 r203326  
     12016-07-16  Chris Dumez  <cdumez@apple.com>
     2
     3        Use fastHasAttribute() when possible
     4        https://bugs.webkit.org/show_bug.cgi?id=159838
     5
     6        Reviewed by Ryosuke Niwa.
     7
     8        Use fastHasAttribute() when possible, for performance.
     9
     10        * editing/DeleteSelectionCommand.cpp:
     11        (WebCore::DeleteSelectionCommand::makeStylingElementsDirectChildrenOfEditableRootToPreventStyleLoss):
     12        * editing/markup.cpp:
     13        (WebCore::createMarkupInternal):
     14        * html/HTMLAnchorElement.cpp:
     15        (WebCore::HTMLAnchorElement::draggable):
     16        * html/HTMLFrameElementBase.cpp:
     17        (WebCore::HTMLFrameElementBase::parseAttribute):
     18        * mathml/MathMLSelectElement.cpp:
     19        (WebCore::MathMLSelectElement::getSelectedSemanticsChild):
     20        * rendering/RenderThemeIOS.mm:
     21        (WebCore::RenderThemeIOS::adjustMenuListButtonStyle):
     22
    1232016-07-16  Ryosuke Niwa  <rniwa@webkit.org>
    224
  • trunk/Source/WebCore/editing/DeleteSelectionCommand.cpp

    r200931 r203326  
    435435    while (node && node != range->pastLastNode()) {
    436436        RefPtr<Node> nextNode = NodeTraversal::next(*node);
    437         if ((is<HTMLStyleElement>(*node) && !downcast<HTMLStyleElement>(*node).hasAttribute(scopedAttr)) || is<HTMLLinkElement>(*node)) {
     437        if ((is<HTMLStyleElement>(*node) && !downcast<HTMLStyleElement>(*node).fastHasAttribute(scopedAttr)) || is<HTMLLinkElement>(*node)) {
    438438            nextNode = NodeTraversal::nextSkippingChildren(*node);
    439439            RefPtr<ContainerNode> rootEditableElement = node->rootEditableElement();
  • trunk/Source/WebCore/editing/markup.cpp

    r203324 r203326  
    630630                // appears to have no effect.
    631631                if ((!fullySelectedRootStyle || !fullySelectedRootStyle->style() || !fullySelectedRootStyle->style()->getPropertyCSSValue(CSSPropertyBackgroundImage))
    632                     && fullySelectedRoot->hasAttribute(backgroundAttr))
     632                    && fullySelectedRoot->fastHasAttribute(backgroundAttr))
    633633                    fullySelectedRootStyle->style()->setProperty(CSSPropertyBackgroundImage, "url('" + fullySelectedRoot->getAttribute(backgroundAttr) + "')");
    634634
  • trunk/Source/WebCore/html/HTMLAnchorElement.cpp

    r203324 r203326  
    282282    if (equalLettersIgnoringASCIICase(value, "false"))
    283283        return false;
    284     return hasAttribute(hrefAttr);
     284    return fastHasAttribute(hrefAttr);
    285285}
    286286
  • trunk/Source/WebCore/html/HTMLFrameElementBase.cpp

    r203324 r203326  
    100100        HTMLFrameOwnerElement::parseAttribute(name, value);
    101101        // Falling back to using the 'id' attribute is not standard but some content relies on this behavior.
    102         if (!hasAttribute(nameAttr))
     102        if (!fastHasAttribute(nameAttr))
    103103            m_frameName = value;
    104104    } else if (name == nameAttr) {
  • trunk/Source/WebCore/mathml/MathMLSelectElement.cpp

    r203324 r203326  
    175175        if (child->hasTagName(MathMLNames::annotationTag)) {
    176176            // 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.
    177             if (child->hasAttribute(MathMLNames::srcAttr))
     177            if (child->fastHasAttribute(MathMLNames::srcAttr))
    178178                continue;
    179179            // Otherwise, we assume it is a text annotation that can always be displayed and we stop here.
     
    183183        if (child->hasTagName(MathMLNames::annotation_xmlTag)) {
    184184            // 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.
    185             if (child->hasAttribute(MathMLNames::srcAttr))
     185            if (child->fastHasAttribute(MathMLNames::srcAttr))
    186186                continue;
    187187            // 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.
  • trunk/Source/WebCore/rendering/RenderThemeIOS.mm

    r203324 r203326  
    626626    // or a date input. We don't force these if this is just an element with
    627627    // "-webkit-appearance: menulist-button".
    628     if (is<HTMLSelectElement>(*element) && !element->hasAttribute(HTMLNames::multipleAttr))
     628    if (is<HTMLSelectElement>(*element) && !element->fastHasAttribute(HTMLNames::multipleAttr))
    629629        adjustSelectListButtonStyle(style, *element);
    630630    else if (is<HTMLInputElement>(*element))
Note: See TracChangeset for help on using the changeset viewer.