Bug 120540

Summary: Use Element& in StyleResolveTree
Product: WebKit Reporter: Antti Koivisto <koivisto>
Component: DOMAssignee: Nobody <webkit-unassigned>
Status: RESOLVED FIXED    
Severity: Normal    
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
patch kling: review+

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