Bug 88197 - ASSERTION FAILED: ASSERT(!isPercentageIntrinsicSize) in RenderReplaced::computeIntrinsicRatioInformationForRenderBox
Summary: ASSERTION FAILED: ASSERT(!isPercentageIntrinsicSize) in RenderReplaced::compu...
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Tools / Tests (show other bugs)
Version: 528+ (Nightly build)
Hardware: All All
: P2 Normal
Assignee: Nobody
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-06-03 13:21 PDT by Daniel Bates
Modified: 2012-06-05 23:53 PDT (History)
7 users (show)

See Also:


Attachments
Example (Will cause assertion failure) (49 bytes, text/html)
2012-06-03 13:23 PDT, Daniel Bates
no flags Details
patch (3.42 KB, patch)
2012-06-05 14:39 PDT, Joe Thomas
dbates: commit-queue-
Details | Formatted Diff | Diff
Patch-Updated (3.90 KB, patch)
2012-06-05 17:13 PDT, Joe Thomas
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Daniel Bates 2012-06-03 13:21:55 PDT
Consider a file with the following markup:
 
<style>svg { max-height:5%; }</style>
<svg></svg>

Opening this file will cause ASSERT(!isPercentageIntrinsicSize) to fail in RenderReplaced::computeIntrinsicRatioInformationForRenderBox(), <http://trac.webkit.org/browser/trunk/Source/WebCore/rendering/RenderReplaced.cpp?rev=117697#L293>.
Comment 1 Daniel Bates 2012-06-03 13:23:05 PDT
Created attachment 145493 [details]
Example (Will cause assertion failure)

For convenience, a file that contains the markup described in the bug description.
Comment 2 Joe Thomas 2012-06-05 08:59:30 PDT
Looks to me like the assertion ASSERT(!isPercentageIntrinsicSize) is not correct as RenderSVGRoot::computeIntrinsicRatioInformation sets isPercentageIntrinsicSize to true while it handles width/height of Percentage types. 
I will make a patch to remove this.
Comment 3 Joe Thomas 2012-06-05 14:39:59 PDT
Created attachment 145870 [details]
patch
Comment 4 Daniel Bates 2012-06-05 16:11:23 PDT
Comment on attachment 145870 [details]
patch

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

> Source/WebCore/ChangeLog:9
> +        ASSERT(!isPercentageIntrinsicSize) is not correct as RenderSVGRoot::computeIntrinsicRatioInformation sets isPercentageIntrinsicSize
> +        to true while it handles width/height of Percentage types.

It's an undocumented convention that we wrap long lines in change log entries. I suggest adding a new line character after "RenderSVGRoot::computeIntrinsicRatioInformation" in line 8 such that we move the phrase "sets isPercentageIntrinsicSize" onto line 9. You may also want to consider adding a remark that explains that RenderSVGRoot extends RenderReplaced so as to more explicitly imply that RenderSVGRoot overrides RenderReplaced::computeIntrinsicRatioInformation().

Nit: Percentage => percentage
(as it's not a proper noun)

> Source/WebCore/rendering/RenderReplaced.cpp:-293
> -    ASSERT(!isPercentageIntrinsicSize);

Would it make sense to assert !isPercentageIntrinsicSize when intrinsicRatio is non-zero?

> LayoutTests/ChangeLog:9
> +        ASSERT(!isPercentageIntrinsicSize) is not correct as RenderSVGRoot::computeIntrinsicRatioInformation sets isPercentageIntrinsicSize
> +        to true while it handles width/height of Percentage types.

Ditto.

> LayoutTests/svg/in-html/svg-assert-failure-percentage.html:7
> +<svg style= "max-height:5%"> </svg>

Nit: There's a space after the '=' in this line.  I suggest we remove this space so as to be consistent with the spacing (or lack of) on the left side of the equality sign.

> LayoutTests/svg/in-html/svg-assert-failure-percentage.html:8
> +NO Assert!

This output message isn't formatted well. On another note, maybe the following text would be more description:

This test PASSED if it doesn't cause an assertion failure.
Comment 5 Joe Thomas 2012-06-05 17:13:32 PDT
Created attachment 145899 [details]
Patch-Updated

Review comments incorporated
Comment 6 Joe Thomas 2012-06-05 17:16:04 PDT
(In reply to comment #4)
> (From update of attachment 145870 [details])
> View in context: https://bugs.webkit.org/attachment.cgi?id=145870&action=review
> 
Thanks for the review.

> > Source/WebCore/ChangeLog:9
> > +        ASSERT(!isPercentageIntrinsicSize) is not correct as RenderSVGRoot::computeIntrinsicRatioInformation sets isPercentageIntrinsicSize
> > +        to true while it handles width/height of Percentage types.
> 
> It's an undocumented convention that we wrap long lines in change log entries. I suggest adding a new line character after "RenderSVGRoot::computeIntrinsicRatioInformation" in line 8 such that we move the phrase "sets isPercentageIntrinsicSize" onto line 9. You may also want to consider adding a remark that explains that RenderSVGRoot extends RenderReplaced so as to more explicitly imply that RenderSVGRoot overrides RenderReplaced::computeIntrinsicRatioInformation().
> 
> Nit: Percentage => percentage
> (as it's not a proper noun)
> 
Done

> > Source/WebCore/rendering/RenderReplaced.cpp:-293
> > -    ASSERT(!isPercentageIntrinsicSize);
> 
> Would it make sense to assert !isPercentageIntrinsicSize when intrinsicRatio is non-zero?
> 
Yes, I think that is better. Changed.

> > LayoutTests/ChangeLog:9
> > +        ASSERT(!isPercentageIntrinsicSize) is not correct as RenderSVGRoot::computeIntrinsicRatioInformation sets isPercentageIntrinsicSize
> > +        to true while it handles width/height of Percentage types.
> 
> Ditto.
> 
> > LayoutTests/svg/in-html/svg-assert-failure-percentage.html:7
> > +<svg style= "max-height:5%"> </svg>
> 
> Nit: There's a space after the '=' in this line.  I suggest we remove this space so as to be consistent with the spacing (or lack of) on the left side of the equality sign.
> 
> > LayoutTests/svg/in-html/svg-assert-failure-percentage.html:8
> > +NO Assert!
> 
> This output message isn't formatted well. On another note, maybe the following text would be more description:
> 
> This test PASSED if it doesn't cause an assertion failure.

Done.
Comment 7 Daniel Bates 2012-06-05 17:24:17 PDT
Comment on attachment 145899 [details]
Patch-Updated

Thanks Joe for updating the patch. Looks reasonable to me.
Comment 8 WebKit Review Bot 2012-06-05 23:53:26 PDT
Comment on attachment 145899 [details]
Patch-Updated

Clearing flags on attachment: 145899

Committed r119565: <http://trac.webkit.org/changeset/119565>
Comment 9 WebKit Review Bot 2012-06-05 23:53:32 PDT
All reviewed patches have been landed.  Closing bug.