Bug 91488

Summary: AuthorShadowDOM for keygen element
Product: WebKit Reporter: Shinya Kawanaka <shinyak>
Component: DOMAssignee: Dominic Cooney <dominicc>
Status: RESOLVED INVALID    
Severity: Normal CC: dominicc
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: Unspecified   
OS: Unspecified   
Bug Depends on:    
Bug Blocks: 82313    

Description Shinya Kawanaka 2012-07-17 04:00:46 PDT
When we add an AuthorShadowDOM to keygen element, it should be rendered correctly.
Comment 1 Dominic Cooney 2012-08-02 19:14:58 PDT
I will take a look at this.
Comment 2 Dominic Cooney 2012-08-02 19:16:39 PDT
*** Bug 91491 has been marked as a duplicate of this bug. ***
Comment 3 Dominic Cooney 2012-08-05 07:03:07 PDT
I tried attaching an author ShadowRoot to a keygen element and the rendering looks fine to me. The shadow element produces the select element used in the UA ShadowRoot.
Comment 4 Shinya Kawanaka 2012-08-05 19:45:17 PDT
Actually it's not working
Comment 5 Shinya Kawanaka 2012-08-05 19:45:48 PDT
Repro:
http://jsfiddle.net/vctmc/

In this case, the keygen selector should disappear.
Comment 6 Shinya Kawanaka 2012-08-05 19:47:29 PDT
Repro:
http://jsfiddle.net/XNNZw/

In this case, the keygen selector should have 10px margins for each direction.
Comment 7 Shinya Kawanaka 2012-08-05 19:49:09 PDT
Attaching Shadow DOM to <keygen> works, but the problem is that rendering is not correctly.
The replaced element should behave like having its contents in UserAgentShadowRoot.

Please see my design doc...
Comment 8 Dominic Cooney 2012-08-05 20:03:35 PDT
(In reply to comment #5)
> Repro:
> http://jsfiddle.net/vctmc/
> 
> In this case, the keygen selector should disappear.

No it shouldn’t; the repro has this code;

var sr = new WebKitShadowDOM(host);
console.log(sr);
sr.innerHTML = "<div style='10px 10px 10px 10px'></div>"
​
but WebKitShadowDOM is not defined. Hence no ShadowRoot is created and the rendering shouldn’t change. Also the inline style is not valid – there is no property name, for example.

(In reply to comment #6)
> Repro:
> http://jsfiddle.net/XNNZw/
> 
> In this case, the keygen selector should have 10px margins for each direction.

This repro has the same problems: it writes WebKitShadowDOM which is undefined, and the inline style is invalid.

If I fix these problems:

var sr = new WebKitShadowRoot(host);
sr.innerHTML = "<div style='margin: 10px 10px 10px 10px'><shadow></shadow></div>"
​
then the div has 10px margins as expected.

I’m going to close this again, I think this is working fine, the repros are invalid.
Comment 9 Shinya Kawanaka 2012-08-05 20:15:39 PDT
It's my failure that I wrongly typed "new WebKitShadowDOM" instead of "new WebKitShadowRoot".
Sorry for that.
Comment 10 Shinya Kawanaka 2012-08-05 20:39:57 PDT
By the way, can you provide a layout test?
Comment 11 Shinya Kawanaka 2012-08-05 20:42:07 PDT
OK... <keygen> does not provide any host special renderer... Great. In that case it's very easy to AuthorShadowDOM-ready. Then there is basically nothing to work for it.