Bug 20086

Summary: Assertion about creating Length with percentage value when blending transforms
Product: WebKit Reporter: Simon Fraser (smfr) <simon.fraser>
Component: Layout and RenderingAssignee: Simon Fraser (smfr) <simon.fraser>
Status: RESOLVED FIXED    
Severity: Normal CC: dino
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: Mac   
OS: OS X 10.5   
Attachments:
Description Flags
Testcase; asserts in debug build on hover.
none
Patch, changelog hyatt: review+

Description Simon Fraser (smfr) 2008-07-17 14:31:16 PDT
In the attached testcase, hover over the blue box. It asserts here:

        Length(int v, LengthType t, bool q = false)
            : m_value((v * 16) | (q << 3) | t) // FIXME: Doesn't work if the passed-in value is very large!
        {
            ASSERT(t != Percent);
        }
Comment 1 Simon Fraser (smfr) 2008-07-17 14:33:26 PDT
Created attachment 22351 [details]
Testcase; asserts in debug build on hover.
Comment 2 Simon Fraser (smfr) 2008-07-17 14:37:03 PDT
The issue is that
  Length(0, m_x.type()).blend(m_x, progress)
creates a Length() using a value of 0 and the type from m_x, which can be percentage. This asserts in the Length ctor.

Instead, we use
  Length(m_x.type()).blend(m_x, progress)
which just constructs a Length with the right type, and blends that.
Comment 3 Simon Fraser (smfr) 2008-07-17 14:40:32 PDT
Created attachment 22352 [details]
Patch, changelog
Comment 4 Dave Hyatt 2008-07-18 12:17:50 PDT
Comment on attachment 22352 [details]
Patch, changelog

r=me
Comment 5 Simon Fraser (smfr) 2008-07-18 14:49:02 PDT
Fixed in r35238.