Bug 120540 - Use Element& in StyleResolveTree
Summary: Use Element& in StyleResolveTree
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: DOM (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Nobody
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-08-30 10:59 PDT by Antti Koivisto
Modified: 2013-08-30 11:43 PDT (History)
0 users

See Also:


Attachments
patch (39.84 KB, patch)
2013-08-30 11:17 PDT, Antti Koivisto
kling: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Antti Koivisto 2013-08-30 10:59:03 PDT
*->&
Comment 1 Antti Koivisto 2013-08-30 11:17:10 PDT
Created attachment 210137 [details]
patch
Comment 2 Andreas Kling 2013-08-30 11:23:47 PDT
Comment on attachment 210137 [details]
patch

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

r=me.

Obligatory whining about places where reasons for dereference safety is not immediately clear:

> Source/WebCore/dom/ContainerNode.cpp:108
>  static inline void attachChild(Node* child)

This should take a Node&.

> Source/WebCore/dom/ContainerNode.cpp:116
>  static inline void detachChild(Node* child)

This should take a Node&.

> Source/WebCore/dom/Element.cpp:2303
> +    Style::resolveTree(*existingPseudoElement, needsStyleRecalc() ? Style::Force : change);

This function should take a PseudoElement& instead of a PseudoElement*.

> Source/WebCore/style/StyleResolveTree.cpp:472
> +    PostAttachCallbackDisabler callbackDisabler(&current);

We should make this RAII object take a ContainerNode& instead.
Comment 3 Antti Koivisto 2013-08-30 11:43:28 PDT
https://trac.webkit.org/r154903