WebKit Bugzilla
New
Browse
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
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
Details
Test that writes to page
(471 bytes, text/html)
2014-10-09 15:58 PDT
,
Dean Jackson
no flags
Details
Patch
(5.18 KB, patch)
2014-10-09 16:30 PDT
,
Dean Jackson
no flags
Details
Formatted Diff
Diff
Patch
(5.93 KB, patch)
2014-10-09 16:49 PDT
,
Dean Jackson
no flags
Details
Formatted Diff
Diff
Patch
(5.89 KB, patch)
2014-10-09 17:12 PDT
,
Dean Jackson
simon.fraser
: review+
Details
Formatted Diff
Diff
Show Obsolete
(2)
View All
Add attachment
proposed patch, testcase, etc.
Radar WebKit Bug Importer
Comment 1
2014-10-09 13:28:14 PDT
<
rdar://problem/18601021
>
Ricky Mondello
Comment 2
2014-10-09 14:09:38 PDT
Created
attachment 239568
[details]
Test
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
Created
attachment 239578
[details]
Patch
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
Created
attachment 239579
[details]
Patch
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
Created
attachment 239583
[details]
Patch
Dean Jackson
Comment 10
2014-10-09 17:19:22 PDT
Committed
r174543
: <
http://trac.webkit.org/changeset/174543
>
Note
You need to
log in
before you can comment on or make changes to this bug.
Top of Page
Format For Printing
XML
Clone This Bug