[MathML] Use more auto for local variables
authorcommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 2 Aug 2016 17:27:37 +0000 (17:27 +0000)
committercommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 2 Aug 2016 17:27:37 +0000 (17:27 +0000)
https://bugs.webkit.org/show_bug.cgi?id=160453

Patch by Frederic Wang <fwang@igalia.com> on 2016-08-02
Reviewed by Darin Adler.

No new tests, behavior is unchanged.

* mathml/MathMLElement.cpp:
(WebCore::MathMLElement::colSpan):
(WebCore::MathMLElement::rowSpan):
(WebCore::MathMLElement::childShouldCreateRenderer):
(WebCore::MathMLElement::defaultEventHandler):
* mathml/MathMLSelectElement.cpp:
(WebCore::MathMLSelectElement::getSelectedActionChild):
(WebCore::MathMLSelectElement::getSelectedSemanticsChild):
* rendering/mathml/RenderMathMLFenced.cpp:
(WebCore::RenderMathMLFenced::updateFromElement):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@204030 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Source/WebCore/ChangeLog
Source/WebCore/mathml/MathMLElement.cpp
Source/WebCore/mathml/MathMLSelectElement.cpp
Source/WebCore/rendering/mathml/RenderMathMLFenced.cpp

index 1d314b5..bf3d9a4 100644 (file)
@@ -1,3 +1,23 @@
+2016-08-02  Frederic Wang  <fwang@igalia.com>
+
+        [MathML] Use more auto for local variables
+        https://bugs.webkit.org/show_bug.cgi?id=160453
+
+        Reviewed by Darin Adler.
+
+        No new tests, behavior is unchanged.
+
+        * mathml/MathMLElement.cpp:
+        (WebCore::MathMLElement::colSpan):
+        (WebCore::MathMLElement::rowSpan):
+        (WebCore::MathMLElement::childShouldCreateRenderer):
+        (WebCore::MathMLElement::defaultEventHandler):
+        * mathml/MathMLSelectElement.cpp:
+        (WebCore::MathMLSelectElement::getSelectedActionChild):
+        (WebCore::MathMLSelectElement::getSelectedSemanticsChild):
+        * rendering/mathml/RenderMathMLFenced.cpp:
+        (WebCore::RenderMathMLFenced::updateFromElement):
+
 2016-08-02  Ryan Haddad  <ryanhaddad@apple.com>
 
         Attempt to fix build after r204014.
index 11f6e49..9e075ce 100644 (file)
@@ -207,7 +207,7 @@ unsigned MathMLElement::colSpan() const
 {
     if (!hasTagName(mtdTag))
         return 1u;
-    const AtomicString& colSpanValue = attributeWithoutSynchronization(columnspanAttr);
+    auto& colSpanValue = attributeWithoutSynchronization(columnspanAttr);
     return std::max(1u, limitToOnlyHTMLNonNegative(colSpanValue, 1u));
 }
 
@@ -215,7 +215,7 @@ unsigned MathMLElement::rowSpan() const
 {
     if (!hasTagName(mtdTag))
         return 1u;
-    const AtomicString& rowSpanValue = attributeWithoutSynchronization(rowspanAttr);
+    auto& rowSpanValue = attributeWithoutSynchronization(rowspanAttr);
     static const unsigned maxRowspan = 8190; // This constant comes from HTMLTableCellElement.
     return std::max(1u, std::min(limitToOnlyHTMLNonNegative(rowSpanValue, 1u), maxRowspan));
 }
@@ -280,7 +280,7 @@ void MathMLElement::collectStyleForPresentationAttribute(const QualifiedName& na
 bool MathMLElement::childShouldCreateRenderer(const Node& child) const
 {
     if (hasTagName(annotation_xmlTag)) {
-        const AtomicString& value = attributeWithoutSynchronization(MathMLNames::encodingAttr);
+        auto& value = attributeWithoutSynchronization(MathMLNames::encodingAttr);
 
         // See annotation-xml.model.mathml, annotation-xml.model.svg and annotation-xml.model.xhtml in the HTML5 RelaxNG schema.
 
@@ -330,10 +330,10 @@ void MathMLElement::defaultEventHandler(Event* event)
             return;
         }
         if (MouseEvent::canTriggerActivationBehavior(*event)) {
-            const AtomicString& href = attributeWithoutSynchronization(hrefAttr);
-            String url = stripLeadingAndTrailingHTMLSpaces(href);
+            auto& href = attributeWithoutSynchronization(hrefAttr);
+            const auto& url = stripLeadingAndTrailingHTMLSpaces(href);
             event->setDefaultHandled();
-            if (Frame* frame = document().frame())
+            if (auto* frame = document().frame())
                 frame->loader().urlSelected(document().completeURL(url), "_self", event, LockHistory::No, LockBackForwardList::No, MaybeSendReferrer, document().shouldOpenExternalURLsPolicyToPropagate());
             return;
         }
index c1414d4..71b832e 100644 (file)
@@ -136,7 +136,7 @@ Element* MathMLSelectElement::getSelectedActionChild()
         return child;
 
     // The value of the actiontype attribute is case-sensitive.
-    const AtomicString& actiontype = attributeWithoutSynchronization(MathMLNames::actiontypeAttr);
+    auto& actiontype = attributeWithoutSynchronization(MathMLNames::actiontypeAttr);
     if (actiontype == "statusline")
         // FIXME: implement user interaction for the "statusline" action type (http://wkbug/124922).
         { }
@@ -185,7 +185,7 @@ Element* MathMLSelectElement::getSelectedSemanticsChild()
             if (child->hasAttributeWithoutSynchronization(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);
+            auto& value = child->attributeWithoutSynchronization(MathMLNames::encodingAttr);
             if (isMathMLEncoding(value) || isSVGEncoding(value) || isHTMLEncoding(value))
                 return child;
         }
index b1845ca..3837219 100644 (file)
@@ -54,14 +54,14 @@ void RenderMathMLFenced::updateFromElement()
     const auto& fenced = element();
 
     // The open operator defaults to a left parenthesis.
-    AtomicString open = fenced.attributeWithoutSynchronization(MathMLNames::openAttr);
+    auto& open = fenced.attributeWithoutSynchronization(MathMLNames::openAttr);
     m_open = open.isNull() ? gOpeningBraceChar : open;
 
     // The close operator defaults to a right parenthesis.
-    AtomicString close = fenced.attributeWithoutSynchronization(MathMLNames::closeAttr);
+    auto& close = fenced.attributeWithoutSynchronization(MathMLNames::closeAttr);
     m_close = close.isNull() ? gClosingBraceChar : close;
 
-    AtomicString separators = fenced.attributeWithoutSynchronization(MathMLNames::separatorsAttr);
+    auto& separators = fenced.attributeWithoutSynchronization(MathMLNames::separatorsAttr);
     if (!separators.isNull()) {
         StringBuilder characters;
         for (unsigned int i = 0; i < separators.length(); i++) {