Bug 129689 - Add a Document::updateStyleIfNeededForNode(Node&).
Summary: Add a Document::updateStyleIfNeededForNode(Node&).
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Layout and Rendering (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Andreas Kling
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-03-04 11:29 PST by Andreas Kling
Modified: 2014-03-04 14:17 PST (History)
1 user (show)

See Also:


Attachments
Patch (4.97 KB, patch)
2014-03-04 11:29 PST, Andreas Kling
koivisto: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Andreas Kling 2014-03-04 11:29:16 PST
Add a Document::updateStyleIfNeededForNode(Node&) so we can avoid doing full style updates when we're only interested in a single node (whose style isn't dirty.)
Comment 1 Andreas Kling 2014-03-04 11:29:55 PST
Created attachment 225795 [details]
Patch
Comment 2 Antti Koivisto 2014-03-04 11:35:55 PST
Comment on attachment 225795 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=225795&action=review

> Source/WebCore/dom/Document.cpp:6055
> +static inline bool nodeOrItsAncestorNeedsStyleRecalc(const Node& node)
> +{
> +    if (node.document().hasPendingForcedStyleRecalc())
> +        return true;

Please pass in the Document, the caller knows (is!) it.

> Source/WebCore/dom/Document.cpp:6063
> +bool Document::updateStyleIfNeededForNode(const Node& node)

It would be better if this took Element. Generic Nodes don't have style.

However since some of the client code is Node-based perhaps it is better to refactor this separately.
Comment 3 Andreas Kling 2014-03-04 14:17:31 PST
Committed r165076: <http://trac.webkit.org/changeset/165076>