<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://bugs.webkit.org/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.4.1"
          urlbase="https://bugs.webkit.org/"
          
          maintainer="admin@webkit.org"
>

    <bug>
          <bug_id>89384</bug_id>
          
          <creation_ts>2012-06-18 14:34:52 -0700</creation_ts>
          <short_desc>Looks like wrong position of isSVGForeignObject checks in RenderObject::container</short_desc>
          <delta_ts>2012-06-19 10:55:49 -0700</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>WebKit</product>
          <component>Layout and Rendering</component>
          <version>528+ (Nightly build)</version>
          <rep_platform>Unspecified</rep_platform>
          <op_sys>Unspecified</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>FIXED</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>P2</priority>
          <bug_severity>Normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Abhishek Arya">inferno</reporter>
          <assigned_to name="Abhishek Arya">inferno</assigned_to>
          <cc>eric</cc>
    
    <cc>fmalita</cc>
    
    <cc>hyatt</cc>
    
    <cc>mitz</cc>
    
    <cc>pdr</cc>
    
    <cc>schenney</cc>
    
    <cc>simon.fraser</cc>
    
    <cc>webkit.review.bot</cc>
    
    <cc>zimmermann</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>651736</commentid>
    <comment_count>0</comment_count>
    <who name="Abhishek Arya">inferno</who>
    <bug_when>2012-06-18 14:34:52 -0700</bug_when>
    <thetext>RenderObject* RenderObject::container(const RenderBoxModelObject* repaintContainer, bool* repaintContainerSkipped) const
{
...................

    EPosition pos = m_style-&gt;position();
    if (pos == FixedPosition) {
        // container() can be called on an object that is not in the
        // tree yet.  We don&apos;t call view() since it will assert if it
        // can&apos;t get back to the canvas.  Instead we just walk as high up
        // as we can.  If we&apos;re in the tree, we&apos;ll get the root.  If we
        // aren&apos;t we&apos;ll get the root of our little subtree (most likely
        // we&apos;ll just return 0).
        // FIXME: The definition of view() has changed to not crawl up the render tree.  It might
        // be safe now to use it.
        while (o &amp;&amp; o-&gt;parent() &amp;&amp; !(o-&gt;hasTransform() &amp;&amp; o-&gt;isRenderBlock())) {
            if (repaintContainerSkipped &amp;&amp; o == repaintContainer)
                *repaintContainerSkipped = true;
#if ENABLE(SVG)
            // foreignObject is the containing block for its contents.
            if (o-&gt;isSVGForeignObject())
                break;
#endif
            o = o-&gt;parent();
        }
    } else if (pos == AbsolutePosition) {
        // Same goes here.  We technically just want our containing block, but
        // we may not have one if we&apos;re part of an uninstalled subtree.  We&apos;ll
        // climb as high as we can though.
        while (o &amp;&amp; o-&gt;style()-&gt;position() == StaticPosition &amp;&amp; !o-&gt;isRenderView() &amp;&amp; !(o-&gt;hasTransform() &amp;&amp; o-&gt;isRenderBlock())) {
            if (repaintContainerSkipped &amp;&amp; o == repaintContainer)
                *repaintContainerSkipped = true;
#if ENABLE(SVG)
            if (o-&gt;isSVGForeignObject()) // foreignObject is the containing block for contents inside it
                break;


---------------------------
Shouldn&apos;t &apos;if (o-&gt;isSVGForeignObject()&apos; be before the &apos;if (repaintContainerSkipped &amp;&amp; o == repaintContainer)&apos; check for both fixed positioned objects, absolute positioned objects. Can someone in the SVG team take a look and fix this.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>651827</commentid>
    <comment_count>1</comment_count>
    <who name="Stephen Chenney">schenney</who>
    <bug_when>2012-06-18 15:52:01 -0700</bug_when>
    <thetext>It definitely seems wrong. We are not skipping the object if it&apos;s SVG - we&apos;re breaking out. So we shouldn&apos;t be setting the flag as skipped.

Go ahead and fix, or ask pdr or fmalita. I&apos;m not bug fixing while traveling.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>651857</commentid>
    <comment_count>2</comment_count>
      <attachid>148200</attachid>
    <who name="Abhishek Arya">inferno</who>
    <bug_when>2012-06-18 16:19:35 -0700</bug_when>
    <thetext>Created attachment 148200
Patch</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>651880</commentid>
    <comment_count>3</comment_count>
      <attachid>148200</attachid>
    <who name="Dirk Schulze">krit</who>
    <bug_when>2012-06-18 16:56:11 -0700</bug_when>
    <thetext>Comment on attachment 148200
Patch

Is it possible to test it with a DRT test?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>651900</commentid>
    <comment_count>4</comment_count>
    <who name="Abhishek Arya">inferno</who>
    <bug_when>2012-06-18 17:20:02 -0700</bug_when>
    <thetext>(In reply to comment #3)
&gt; (From update of attachment 148200 [details])
&gt; Is it possible to test it with a DRT test?

I don&apos;t know the painting pipeline well enough to write a failing test.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>652498</commentid>
    <comment_count>5</comment_count>
    <who name="Simon Fraser (smfr)">simon.fraser</who>
    <bug_when>2012-06-19 08:50:52 -0700</bug_when>
    <thetext>Patch seems reasonable; we might never hit this on real content.

repaintContainerSkipped kicks in when something like opacity creates a compositing layer between an abspos div and its container ancestor:

&lt;div style=&quot;position: relative&quot;&gt;
  &lt;div style=&quot;opacity: 0.5&quot;&gt;
    &lt;div style=&quot;-webkit-transform: translateZ(0);&quot;&gt; &lt;!-- kick the next div into compositing --&gt;
    &lt;div style=&quot;position: absolute;&quot;&gt;

For isSVGForeignObject to kick in, you need to be inside an svg &lt;foreignObject&gt; and to have the repaintContainer in the SVG. Since svg doesn&apos;t do compositing, I&apos;m not sure this is possible.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>652534</commentid>
    <comment_count>6</comment_count>
    <who name="Abhishek Arya">inferno</who>
    <bug_when>2012-06-19 09:47:21 -0700</bug_when>
    <thetext>(In reply to comment #5)
&gt; Patch seems reasonable; we might never hit this on real content.
&gt; 
&gt; repaintContainerSkipped kicks in when something like opacity creates a compositing layer between an abspos div and its container ancestor:
&gt; 
&gt; &lt;div style=&quot;position: relative&quot;&gt;
&gt;   &lt;div style=&quot;opacity: 0.5&quot;&gt;
&gt;     &lt;div style=&quot;-webkit-transform: translateZ(0);&quot;&gt; &lt;!-- kick the next div into compositing --&gt;
&gt;     &lt;div style=&quot;position: absolute;&quot;&gt;
&gt; 
&gt; For isSVGForeignObject to kick in, you need to be inside an svg &lt;foreignObject&gt; and to have the repaintContainer in the SVG. Since svg doesn&apos;t do compositing, I&apos;m not sure this is possible.

Thanks Simon.  So, looks like there is not way to test this. Can you please review this so that atleast we don&apos;t regress in the future.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>652602</commentid>
    <comment_count>7</comment_count>
      <attachid>148200</attachid>
    <who name="WebKit Review Bot">webkit.review.bot</who>
    <bug_when>2012-06-19 10:55:41 -0700</bug_when>
    <thetext>Comment on attachment 148200
Patch

Clearing flags on attachment: 148200

Committed r120732: &lt;http://trac.webkit.org/changeset/120732&gt;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>652603</commentid>
    <comment_count>8</comment_count>
    <who name="WebKit Review Bot">webkit.review.bot</who>
    <bug_when>2012-06-19 10:55:49 -0700</bug_when>
    <thetext>All reviewed patches have been landed.  Closing bug.</thetext>
  </long_desc>
      
          <attachment
              isobsolete="0"
              ispatch="1"
              isprivate="0"
          >
            <attachid>148200</attachid>
            <date>2012-06-18 16:19:35 -0700</date>
            <delta_ts>2012-06-19 10:55:41 -0700</delta_ts>
            <desc>Patch</desc>
            <filename>bug-89384-20120618161934.patch</filename>
            <type>text/plain</type>
            <size>2694</size>
            <attacher name="Abhishek Arya">inferno</attacher>
            
              <data encoding="base64">U3VidmVyc2lvbiBSZXZpc2lvbjogMTIwNjI5CmRpZmYgLS1naXQgYS9Tb3VyY2UvV2ViQ29yZS9D
aGFuZ2VMb2cgYi9Tb3VyY2UvV2ViQ29yZS9DaGFuZ2VMb2cKaW5kZXggMjNlYTZlMz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NraXBwZWQgJiYgbyA9PSByZXBhaW50Q29udGFpbmVyKQorICAgICAgICAg
ICAgICAgICpyZXBhaW50Q29udGFpbmVyU2tpcHBlZCA9IHRydWU7CisKICAgICAgICAgICAgIG8g
PSBvLT5wYXJlbnQoKTsKICAgICAgICAgfQogICAgIH0gZWxzZSBpZiAocG9zID09IEFic29sdXRl
UG9zaXRpb24pIHsKQEAgLTIyMzAsMTIgKzIyMzEsMTMgQEAgUmVuZGVyT2JqZWN0KiBSZW5kZXJP
YmplY3Q6OmNvbnRhaW5lcihjb25zdCBSZW5kZXJCb3hNb2RlbE9iamVjdCogcmVwYWludENvbnRh
aW4KICAgICAgICAgLy8gd2UgbWF5IG5vdCBoYXZlIG9uZSBpZiB3ZSdyZSBwYXJ0IG9mIGFuIHVu
aW5zdGFsbGVkIHN1YnRyZWUuICBXZSdsbAogICAgICAgICAvLyBjbGltYiBhcyBoaWdoIGFzIHdl
IGNhbiB0aG91Z2guCiAgICAgICAgIHdoaWxlIChvICYmIG8tPnN0eWxlKCktPnBvc2l0aW9uKCkg
PT0gU3RhdGljUG9zaXRpb24gJiYgIW8tPmlzUmVuZGVyVmlldygpICYmICEoby0+aGFzVHJhbnNm
b3JtKCkgJiYgby0+aXNSZW5kZXJCbG9jaygpKSkgewotICAgICAgICAgICAgaWYgKHJlcGFpbnRD
b250YWluZXJTa2lwcGVkICYmIG8gPT0gcmVwYWludENvbnRhaW5lcikKLSAgICAgICAgICAgICAg
ICAqcmVwYWludENvbnRhaW5lclNraXBwZWQgPSB0cnVlOwogI2lmIEVOQUJMRShTVkcpCiAgICAg
ICAgICAgICBpZiAoby0+aXNTVkdGb3JlaWduT2JqZWN0KCkpIC8vIGZvcmVpZ25PYmplY3QgaXMg
dGhlIGNvbnRhaW5pbmcgYmxvY2sgZm9yIGNvbnRlbnRzIGluc2lkZSBpdAogICAgICAgICAgICAg
ICAgIGJyZWFrOwogI2VuZGlmCisgICAgICAgICAgICBpZiAocmVwYWludENvbnRhaW5lclNraXBw
ZWQgJiYgbyA9PSByZXBhaW50Q29udGFpbmVyKQorICAgICAgICAgICAgICAgICpyZXBhaW50Q29u
dGFpbmVyU2tpcHBlZCA9IHRydWU7CisKICAgICAgICAgICAgIG8gPSBvLT5wYXJlbnQoKTsKICAg
ICAgICAgfQogICAgIH0K
</data>

          </attachment>
      

    </bug>

</bugzilla>