[Webkit-unassigned] [Bug 93170] Inline continuations create :after generated content on style recalcs

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Mon Oct 1 04:15:47 PDT 2012


https://bugs.webkit.org/show_bug.cgi?id=93170





--- Comment #7 from Takashi Sakamoto <tasak at google.com>  2012-10-01 04:16:10 PST ---
(In reply to comment #4)
> (In reply to comment #0)
> > Created an attachment (id=156496)
 --> (https://bugs.webkit.org/attachment.cgi?id=156496&action=review) [details] [details]
> > Reduction
> > 
> > Given <span><div></div></span> with :after content  on span a style recalc will cause the insertion of the content into the continuations in the div.
> 
> the initial rendertree should be like
> 
> RenderBlock(anonymous)
>    RenderInline (span)
> RenderBlock(anonymous)
>    RenderBlock (div)
> RenderBlock(anonymous)
>   RenderInline(span)
>      RenderWhatever (for :after content)
> 
> After the style recalc where does the badness happen ?

I ran DumpRenderTree for the following html :
<style>
    span {
        display: inline;
    }
    span:before {
        content: "A";
    }
    span:after {
        content: "B";
    }
</style>
<span>
  <div></div>
  <div></div>
</span>

Since ":before" and ":after" exist, the result looks like:

  RenderBlock {HTML} at (0,0) size 800x600
    RenderBody {BODY} at (8,8) size 784x584
      RenderBlock (anonymous) at (0,0) size 784x20
        RenderInline {SPAN} at (0,0) size 11x19
          RenderInline (generated) at (0,0) size 11x19
            RenderText at (0,0) size 11x19
              text run at (0,0) width 11: "A"
          RenderText {#text} at (0,0) size 0x0
      RenderBlock (anonymous) at (0,20) size 784x0
        RenderBlock {DIV} at (0,0) size 784x0
      RenderBlock (anonymous) at (0,20) size 784x0
        RenderInline {SPAN} at (0,0) size 0x0
      RenderBlock (anonymous) at (0,20) size 784x0
        RenderBlock {DIV} at (0,0) size 784x0
      RenderBlock (anonymous) at (0,20) size 784x20
        RenderInline {SPAN} at (0,0) size 11x19
          RenderInline (generated) at (0,0) size 11x19
            RenderText at (0,0) size 11x19
              text run at (0,0) width 11: "B"

So there are 3 RenderInline{SPAN}, because two DIVs were inserted into inline {SPAN}. 
(Each DIV splits the last RenderInline{SPAN} into two RenderInline{SPAN}s by using RenderBlock (anonymous). If <style> has neither :BEFORE nor :AFTER, the "split" doesn't occur.)

When RenderInline::styleDidChange is invoked, because of setContinuation(0), there is no way to know whether the given continuation is last one or not. So...

 RenderBlock {HTML} at (0,0) size 800x600
    RenderBody {BODY} at (8,8) size 784x584
      RenderBlock (anonymous) at (0,0) size 784x20
        RenderInline {SPAN} at (0,0) size 11x19
          RenderInline (generated) at (0,0) size 11x19
            RenderText at (0,0) size 11x19
              text run at (0,0) width 11: "A"
          RenderText {#text} at (0,0) size 0x0
      RenderBlock (anonymous) at (0,20) size 784x0
        RenderBlock {DIV} at (0,0) size 784x0
      RenderBlock (anonymous) at (0,20) size 784x0
        RenderInline {SPAN} at (0,0) size 0x0
+          RenderInline (generated) at (0,0) size 11x19
+            RenderText at (0,0) size 11x19
+              text run at (0,0) width 11: "B"
      RenderBlock (anonymous) at (0,20) size 784x0
        RenderBlock {DIV} at (0,0) size 784x0
      RenderBlock (anonymous) at (0,20) size 784x20
        RenderInline {SPAN} at (0,0) size 11x19
          RenderInline (generated) at (0,0) size 11x19
            RenderText at (0,0) size 11x19
              text run at (0,0) width 11: "B"

Best regards,
Takashi Sakamoto

-- 
Configure bugmail: https://bugs.webkit.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.


More information about the webkit-unassigned mailing list