Changeset 153672 in webkit


Ignore:
Timestamp:
Aug 2, 2013 3:11:07 PM (11 years ago)
Author:
akling@apple.com
Message:

Removing a <link> element with an empty stylesheet shouldn't trigger style recalc.
<http://webkit.org/b/119442>
<rdar://problem/14631785>

Reviewed by Antti Koivisto.

Let Document decide whether or not to do a style recalc after a <link> element is removed.
This avoids unnecessary work when removing a <link> that refers to an empty style sheet.

Some Facebook pages have a <link rel="stylesheet" href="data:text/css;base64,"> that gets
removed during the initial page load, causing style recalc.

  • html/HTMLLinkElement.cpp:

(WebCore::HTMLLinkElement::removedFrom):

Use DeferRecalcStyleIfNeeded. Since the style sheet is being removed, it will either
cause a recalc (because it's no longer in the set of active sheets) or do nothing.

Location:
trunk/Source/WebCore
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r153668 r153672  
     12013-08-02  Andreas Kling  <akling@apple.com>
     2
     3        Removing a <link> element with an empty stylesheet shouldn't trigger style recalc.
     4        <http://webkit.org/b/119442>
     5        <rdar://problem/14631785>
     6
     7        Reviewed by Antti Koivisto.
     8
     9        Let Document decide whether or not to do a style recalc after a <link> element is removed.
     10        This avoids unnecessary work when removing a <link> that refers to an empty style sheet.
     11
     12        Some Facebook pages have a <link rel="stylesheet" href="data:text/css;base64,"> that gets
     13        removed during the initial page load, causing style recalc.
     14
     15        * html/HTMLLinkElement.cpp:
     16        (WebCore::HTMLLinkElement::removedFrom):
     17
     18            Use DeferRecalcStyleIfNeeded. Since the style sheet is being removed, it will either
     19            cause a recalc (because it's no longer in the set of active sheets) or do nothing.
     20
    1212013-08-02  Patrick Gansterer  <paroga@webkit.org>
    222
  • trunk/Source/WebCore/html/HTMLLinkElement.cpp

    r153494 r153672  
    281281
    282282    if (document()->renderer())
    283         document()->styleResolverChanged(DeferRecalcStyle);
     283        document()->styleResolverChanged(DeferRecalcStyleIfNeeded);
    284284}
    285285
Note: See TracChangeset for help on using the changeset viewer.