Bug 20172

Summary: [XBL] XBL elements should not be rendered
Product: WebKit Reporter: Julien Chaffraix <jchaffraix>
Component: WebCore Misc.Assignee: Nobody <webkit-unassigned>
Status: RESOLVED FIXED    
Severity: Normal    
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: All   
OS: All   
Attachments:
Description Flags
Proposed fix: create the render but remove the root from the hierarchy
hyatt: review-
Updated version: using html4.css hyatt: review+

Description Julien Chaffraix 2008-07-25 12:41:55 PDT
Currently XBL elements are shown on the screen and they should not.
Comment 1 Dave Hyatt 2008-07-25 12:50:24 PDT
You can just add style rules for xbl to html4.css.  Should only take two...

xbl|* { display: none }
xbl|div { display: block }

Comment 2 Julien Chaffraix 2008-07-25 12:51:54 PDT
Created attachment 22477 [details]
Proposed fix: create the render but remove the root from the hierarchy

This gist of this patch is to let attach() create the renderers for us so that we can use them to generate our shadow tree later. In order for them not to be displayed, we remove the renderer at the root of the hierarchy (which is the <xbl> element renderer).
Comment 3 Dave Hyatt 2008-07-25 12:57:46 PDT
Comment on attachment 22477 [details]
Proposed fix: create the render but remove the root from the hierarchy

Renderers for shadow content are going to be created when you clone the shadow content templates.  The original tree is not going to have any renderers for the shadow content template.  Only the clones will have renderers.

In order to just make sure the main XBL document tree has no renderers, you just need a couple of style rules added to html4.css.

These style rules are described in the spec:

http://www.w3.org/TR/xbl/#xbl-elements

@namespace xbl url(http://www.w3.org/ns/xbl);
xbl|* { display: none; }
xbl|div { display: block; }
Comment 4 Julien Chaffraix 2008-07-25 15:27:28 PDT
Created attachment 22483 [details]
Updated version: using html4.css
Comment 5 Dave Hyatt 2008-07-25 17:48:53 PDT
Comment on attachment 22483 [details]
Updated version: using html4.css

r=me
Comment 6 Julien Chaffraix 2008-07-26 13:07:17 PDT
Landed in r35372 on XBL2 branch.