RESOLVED FIXED 137567
Computed style for clip is wrong with respect to auto
https://bugs.webkit.org/show_bug.cgi?id=137567
Summary Computed style for clip is wrong with respect to auto
Ricky Mondello
Reported 2014-10-09 13:26:50 PDT
For the following markup: <div id="test" style="width: 300px; height: 300px; background-color: green; clip: rect(auto, auto, auto, auto);"> The following script: var testRect = document.getElementById("test"); var clipStyle = getComputedStyle(testRect).clip; console.log(clipStyle); Logs: rect(0px, 0px, 0px, 0px) It should log: rect(auto, auto, auto, auto) I've attached a test page.
Attachments
Test (395 bytes, text/html)
2014-10-09 14:09 PDT, Ricky Mondello
no flags
Test that writes to page (471 bytes, text/html)
2014-10-09 15:58 PDT, Dean Jackson
no flags
Patch (5.18 KB, patch)
2014-10-09 16:30 PDT, Dean Jackson
no flags
Patch (5.93 KB, patch)
2014-10-09 16:49 PDT, Dean Jackson
no flags
Patch (5.89 KB, patch)
2014-10-09 17:12 PDT, Dean Jackson
simon.fraser: review+
Radar WebKit Bug Importer
Comment 1 2014-10-09 13:28:14 PDT
Ricky Mondello
Comment 2 2014-10-09 14:09:38 PDT
Dean Jackson
Comment 3 2014-10-09 15:58:42 PDT
Created attachment 239577 [details] Test that writes to page
Dean Jackson
Comment 4 2014-10-09 16:30:19 PDT
Brent Fulgham
Comment 5 2014-10-09 16:34:03 PDT
Comment on attachment 239578 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=239578&action=review I think we have some copy/paste errors here. > Source/WebCore/css/CSSComputedStyleDeclaration.cpp:2760 > + const Length& bottom = style->clip().right(); Is right == bottom here? :-\ > Source/WebCore/css/CSSComputedStyleDeclaration.cpp:2766 > + const Length& left = style->clip().right(); Er. left == right? Copy/paste error?
Dean Jackson
Comment 6 2014-10-09 16:35:20 PDT
SO EMBARRASS.
Dean Jackson
Comment 7 2014-10-09 16:49:52 PDT
Simon Fraser (smfr)
Comment 8 2014-10-09 16:54:10 PDT
Comment on attachment 239579 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=239579&action=review > Source/WebCore/css/CSSComputedStyleDeclaration.cpp:2752 > + const Length& top = style->clip().top(); > + if (top.isAuto()) > + rect->setTop(cssValuePool().createIdentifierValue(CSSValueAuto)); > + else > + rect->setTop(zoomAdjustedPixelValue(top.value(), style.get())); Would prefer a little inline function which checks for auto.
Dean Jackson
Comment 9 2014-10-09 17:12:00 PDT
Dean Jackson
Comment 10 2014-10-09 17:19:22 PDT
Note You need to log in before you can comment on or make changes to this bug.