Bug 52423 - RenderObject::canHaveChildren()==false prevents shadow renderer creation
Summary: RenderObject::canHaveChildren()==false prevents shadow renderer creation
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: DOM (show other bugs)
Version: 528+ (Nightly build)
Hardware: All All
: P2 Normal
Assignee: Nobody
URL:
Keywords:
Depends on:
Blocks: 72352
  Show dependency treegraph
 
Reported: 2011-01-13 22:00 PST by Kent Tamura
Modified: 2012-02-26 21:59 PST (History)
5 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Kent Tamura 2011-01-13 22:00:16 PST
Some renderers return false for canHaveChildren().  So if we try to convert the legacy shadow DOM code to the new API, the shadow nodes won't have their renderers.  See Node::createRendererIfNeeded().

dglazkov said:
> I think it should be a function on an Element which indicates whether its children should be rendered

Source/WebCore/rendering/RenderButton.h:    virtual bool canHaveChildren() const;
Source/WebCore/rendering/RenderDataGrid.h:    virtual bool canHaveChildren() const { return false; }
Source/WebCore/rendering/RenderIndicator.h:    virtual bool canHaveChildren() const { return false; }
Source/WebCore/rendering/RenderListBox.h:    virtual bool canHaveChildren() const { return false; }
Source/WebCore/rendering/RenderMenuList.h:    virtual bool canHaveChildren() const { return false; }
Source/WebCore/rendering/RenderReplaced.h:    virtual bool canHaveChildren() const { return false; }
Source/WebCore/rendering/RenderTableCol.h:    virtual bool canHaveChildren() const;
Source/WebCore/rendering/RenderTextControl.h:    virtual bool canHaveChildren() const { return false; }
Comment 1 Dimitri Glazkov (Google) 2011-04-11 09:00:41 PDT
This is going to be part of <content> element machinery. By default, if the element has shadow DOM subtree, the children aren't rendered, so this decision becomes runtime, not compile-time.
Comment 2 Dimitri Glazkov (Google) 2011-04-13 10:45:15 PDT
(In reply to comment #1)
> This is going to be part of <content> element machinery. By default, if the element has shadow DOM subtree, the children aren't rendered, so this decision becomes runtime, not compile-time.

Turns out that the best solution is just to never render children for Elements that have shadow DOM.
Comment 3 Hajime Morrita 2012-02-26 21:59:04 PST
Fixed by http://trac.webkit.org/changeset/108758.