Changeset 130311 in webkit


Ignore:
Timestamp:
Oct 3, 2012, 12:17:18 PM (13 years ago)
Author:
benjamin@webkit.org
Message:

Element::computeInheritedLanguage: evaluate the while() condition after fetching the string
https://bugs.webkit.org/show_bug.cgi?id=98220

Patch by Benjamin Poulain <bpoulain@apple.com> on 2012-10-03
Reviewed by Andreas Kling.

  • dom/Element.cpp:

(WebCore::Element::computeInheritedLanguage):
The condition is never false on the first execution. Move the condition to the
end of the loop for fun and profit.

Location:
trunk/Source/WebCore
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r130308 r130311  
     12012-10-03  Benjamin Poulain  <bpoulain@apple.com>
     2
     3        Element::computeInheritedLanguage: evaluate the while() condition after fetching the string
     4        https://bugs.webkit.org/show_bug.cgi?id=98220
     5
     6        Reviewed by Andreas Kling.
     7
     8        * dom/Element.cpp:
     9        (WebCore::Element::computeInheritedLanguage):
     10        The condition is never false on the first execution. Move the condition to the
     11        end of the loop for fun and profit.
     12
    1132012-10-03  Hans Wennborg  <hans@chromium.org>
    214
  • trunk/Source/WebCore/dom/Element.cpp

    r130278 r130311  
    17571757    AtomicString value;
    17581758    // The language property is inherited, so we iterate over the parents to find the first language.
    1759     while (n && value.isNull()) {
     1759    do {
    17601760        if (n->isElementNode()) {
    17611761            // Spec: xml:lang takes precedence -- http://www.w3.org/TR/xhtml1/#C_7
     
    17691769
    17701770        n = n->parentNode();
    1771     }
     1771    } while (n && value.isNull());
    17721772
    17731773    return value;
Note: See TracChangeset for help on using the changeset viewer.