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.
<rdar://problem/18601021>
Created attachment 239568 [details] Test
Created attachment 239577 [details] Test that writes to page
Created attachment 239578 [details] Patch
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?
SO EMBARRASS.
Created attachment 239579 [details] Patch
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.
Created attachment 239583 [details] Patch
Committed r174543: <http://trac.webkit.org/changeset/174543>