Bug 50660

Summary: Convert <progress> shadow DOM to a DOM-based shadow.
Product: WebKit Reporter: Hajime Morrita <morrita>
Component: DOMAssignee: Nobody <webkit-unassigned>
Status: RESOLVED FIXED    
Severity: Normal CC: dglazkov, simon.fraser
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: PC   
OS: OS X 10.5   
Bug Depends on: 53412    
Bug Blocks: 48698, 53417    
Attachments:
Description Flags
Patch
none
Patch dglazkov: review+

Description Hajime Morrita 2010-12-07 18:21:11 PST
<progress> is holding its shadows as a member variables of  RenderProgress. 
We could move them to HTMLMeterElement.
Comment 1 Hajime Morrita 2010-12-07 18:22:53 PST
(In reply to comment #0)
> <progress> is holding its shadows as a member variables of  RenderProgress. 
> We could move them to HTMLMeterElement.
No, to HTMLProgressElement.
Comment 2 Hajime Morrita 2011-01-28 00:56:58 PST
Created attachment 80424 [details]
Patch
Comment 3 Hajime Morrita 2011-01-28 00:58:36 PST
Hi Dimitri, could you take a look?
I know this is just the first step of the shadow refresh and
I'll eliminate more renderer-to-dom dependency in following changes.
Comment 4 Dimitri Glazkov (Google) 2011-01-28 08:43:26 PST
Comment on attachment 80424 [details]
Patch

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

Ok. You probably should've put this patch into a separate bug, since it doesn't technically fix the bug yet -- and use this bug as a meta-bug :)

> Source/WebCore/html/HTMLProgressElement.cpp:40
> +class ProgressBarValueElement : public ShadowBlockElement {

Does it need to be ShadowBlockElement anymore? But I guess that's what the next patch is about.
Comment 5 Hajime Morrita 2011-01-30 20:39:39 PST
Committed r77107: <http://trac.webkit.org/changeset/77107>
Comment 6 Hajime Morrita 2011-01-30 20:46:37 PST
HI Dimitri, Thank you for reviewing!

(In reply to comment #4)
> (From update of attachment 80424 [details])
> View in context: https://bugs.webkit.org/attachment.cgi?id=80424&action=review
> 
> Ok. You probably should've put this patch into a separate bug, since it doesn't technically fix the bug yet -- and use this bug as a meta-bug :)
Sure. I'll do so ... or introduce another bug as a tracking bug.

> 
> > Source/WebCore/html/HTMLProgressElement.cpp:40
> > +class ProgressBarValueElement : public ShadowBlockElement {
> 
> Does it need to be ShadowBlockElement anymore? But I guess that's what the next patch is about.
I'll do this when attacking <meter>. But I have a few item on <progress> side yet.
Comment 7 Simon Fraser (smfr) 2011-01-30 22:11:06 PST
I see some new test crashes after this commit:
http://build.webkit.org/results/Leopard%20Intel%20Release%20(Tests)/r77108%20(27420)/results.html
Comment 8 Simon Fraser (smfr) 2011-01-30 22:18:53 PST
Patch was backed out via bug 53412.
Comment 9 Hajime Morrita 2011-01-31 03:26:50 PST
Created attachment 80629 [details]
Patch
Comment 10 Hajime Morrita 2011-01-31 03:29:44 PST
Simon, thank you for save the tree. I'm sorry for the breakage.
Dimitri, could you take a look again?

The difference from the last patch is ProgressBarValueElement::detach().
The last patch missed to unlink from host -> shadow reference, which caused the inconsistency.
(shadow -> host reference is unlinked by ShadowElement::detach()).

Thanks in advance.
Comment 11 Dimitri Glazkov (Google) 2011-01-31 08:50:01 PST
Comment on attachment 80629 [details]
Patch

Please make sure to run tests before landing.
Comment 12 Hajime Morrita 2011-01-31 17:12:36 PST
> Please make sure to run tests before landing.
Yes, I will. I'm really sorry for that.
The test was done only under dom/HTMLProgressElement/ at the last patch
and I was wrong.
Comment 13 Hajime Morrita 2011-01-31 20:06:10 PST
Committed r77211: <http://trac.webkit.org/changeset/77211>
Comment 14 Erik Arvidsson 2011-02-01 10:54:10 PST
Comment on attachment 80629 [details]
Patch

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

> Source/WebCore/rendering/RenderProgress.cpp:105
> +    if (!(valuePart()->renderer() && valuePart()->renderer()->style()->hasAppearance()))

Why does this need appearance? What happens if I do?

::-webkit-progress-bar-value {
  -webkit-appearance: none;
  background-color: red;
}
Comment 15 Hajime Morrita 2011-02-01 20:24:42 PST
(In reply to comment #14)
> (From update of attachment 80629 [details])
> View in context: https://bugs.webkit.org/attachment.cgi?id=80629&action=review
> 
> > Source/WebCore/rendering/RenderProgress.cpp:105
> > +    if (!(valuePart()->renderer() && valuePart()->renderer()->style()->hasAppearance()))
> 
> Why does this need appearance? What happens if I do?
> 
> ::-webkit-progress-bar-value {
>   -webkit-appearance: none;
>   background-color: red;
> }
Shadow rendered even if "none" is given if host's appearance is set to "none".
But yes, it's confusing.... I'll revise the logic in coming patch(es).