Removing a <link> element with an empty stylesheet shouldn't trigger style recalc.
authorakling@apple.com <akling@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 2 Aug 2013 22:11:07 +0000 (22:11 +0000)
committerakling@apple.com <akling@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 2 Aug 2013 22:11:07 +0000 (22:11 +0000)
commita267ccecfa464971bfbf5f69d6d63d4d02104cbf
tree4346b47b51fa1c3d42a5e33f3286b0ec48db1974
parenteb00844c08336c0d65a79d0c871e9deb927ff000
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.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@153672 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Source/WebCore/ChangeLog
Source/WebCore/html/HTMLLinkElement.cpp