RESOLVED FIXED 98027
computedstyle perspective-origin is based on the wrong boundingbox
https://bugs.webkit.org/show_bug.cgi?id=98027
Summary computedstyle perspective-origin is based on the wrong boundingbox
Jussi Kukkonen (jku)
Reported 2012-10-01 06:42:49 PDT
CSS Transforms perspective-origin percentage values are currently translated to pixel values using the wrong bounding box (currently sizingBox() which ends up as the contentbox). Spec says "Percentages: refer to the size of the element's bounding box" and bounding box is defined as "bounding box for all SVG elements without an associated CSS layout box and the border box for all other elements". So we should be using border box for normal html elements. This is what transform-origin already does. I'll provide a patch and a test case.
Attachments
Patch (6.41 KB, patch)
2012-10-02 02:21 PDT, Jussi Kukkonen (jku)
no flags
Patch (6.40 KB, patch)
2012-10-02 13:35 PDT, Jussi Kukkonen (jku)
no flags
Patch (6.39 KB, patch)
2012-10-03 01:34 PDT, Jussi Kukkonen (jku)
no flags
Simon Fraser (smfr)
Comment 1 2012-10-01 13:05:18 PDT
Similar to bug 94211.
Jussi Kukkonen (jku)
Comment 2 2012-10-02 02:21:56 PDT
Created attachment 166647 [details] Patch Thanks Simon, that test actually looks like a better place to test this as well
Jussi Kukkonen (jku)
Comment 3 2012-10-02 04:26:34 PDT
Hm, looks like I've missed transforms/3d/point-mapping/ tests at least. Will check and update those
Jussi Kukkonen (jku)
Comment 4 2012-10-02 06:20:01 PDT
(In reply to comment #3) > Hm, looks like I've missed transforms/3d/point-mapping/ tests at least. So chromium-ews was flaky for a cycle in transforms/3d/point-mapping/. Actually those tests don't really seem to check the computedStyle (and this bug only covers that). As far as I can see all the existing tests that test perspective-origin via computedStyle happen to not use borders or pass in px values so don't hit the bug. Just to be double sure I checked the transforms/3d/point-mapping/ results on GTK -- they are identical to results before patch. I think this is good to go.
Simon Fraser (smfr)
Comment 5 2012-10-02 11:02:08 PDT
Was it only wrong for computed style, but correct for rendering? If so, the title of this bug, and the Changelog need to make this clearer.
Jussi Kukkonen (jku)
Comment 6 2012-10-02 13:09:39 PDT
Yes, that is correct: rendering is unchanged (and correct as far as I can tell), but computedstyle is wrong. I'll update the changelog.
Jussi Kukkonen (jku)
Comment 7 2012-10-02 13:35:23 PDT
Simon Fraser (smfr)
Comment 8 2012-10-02 13:42:11 PDT
Comment on attachment 166741 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=166741&action=review > Source/WebCore/ChangeLog:3 > + getComputedStyle perspective-origin is based on the wrong boundingbox "bounding box"
Jussi Kukkonen (jku)
Comment 9 2012-10-03 01:34:07 PDT
WebKit Review Bot
Comment 10 2012-10-03 05:16:38 PDT
Comment on attachment 166826 [details] Patch Clearing flags on attachment: 166826 Committed r130277: <http://trac.webkit.org/changeset/130277>
WebKit Review Bot
Comment 11 2012-10-03 05:16:42 PDT
All reviewed patches have been landed. Closing bug.
Note You need to log in before you can comment on or make changes to this bug.