WebKit Bugzilla
New
Browse
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
RESOLVED FIXED
74635
getComputedStyle for border-width is not implemented.
https://bugs.webkit.org/show_bug.cgi?id=74635
Summary
getComputedStyle for border-width is not implemented.
Alexis Menard (darktears)
Reported
2011-12-15 11:09:57 PST
getComputedStyle for border-width is not implemented.
Attachments
Patch
(8.04 KB, patch)
2011-12-15 11:12 PST
,
Alexis Menard (darktears)
no flags
Details
Formatted Diff
Diff
Patch
(11.03 KB, patch)
2011-12-15 13:34 PST
,
Alexis Menard (darktears)
no flags
Details
Formatted Diff
Diff
Patch
(12.65 KB, patch)
2011-12-16 09:39 PST
,
Alexis Menard (darktears)
no flags
Details
Formatted Diff
Diff
Show Obsolete
(2)
View All
Add attachment
proposed patch, testcase, etc.
Alexis Menard (darktears)
Comment 1
2011-12-15 11:12:05 PST
Created
attachment 119469
[details]
Patch
Early Warning System Bot
Comment 2
2011-12-15 11:29:58 PST
Comment on
attachment 119469
[details]
Patch
Attachment 119469
[details]
did not pass qt-ews (qt): Output:
http://queues.webkit.org/results/10903321
WebKit Review Bot
Comment 3
2011-12-15 11:43:54 PST
Comment on
attachment 119469
[details]
Patch
Attachment 119469
[details]
did not pass chromium-ews (chromium-xvfb): Output:
http://queues.webkit.org/results/10904348
Tony Chang
Comment 4
2011-12-15 11:47:36 PST
Comment on
attachment 119469
[details]
Patch View in context:
https://bugs.webkit.org/attachment.cgi?id=119469&action=review
> Source/WebCore/css/CSSComputedStyleDeclaration.cpp:2166 > + RefPtr<CSSValueList> list = CSSValueList::createSpaceSeparated(); > + list->append(zoomAdjustedPixelValue(style->borderTop().width(), style.get(), cssValuePool));
When I added this for flex-flow, I didn't realize that getComputedStyle wasn't implemented for other short hand properties. I think adding this is a good idea, but we should make some helper functions for this rather than duplicating code (e.g., the code for margin width would be almost identical).
> LayoutTests/ChangeLog:11 > + * fast/css/getComputedStyle/getComputedStyle-border-width-expected.txt: Added. > + * fast/css/getComputedStyle/getComputedStyle-border-width.html: Added.
Do you need to also fix up fast/css/getComputedStyle/computed-style* and svg/css/getComputedStyle-basic?
> LayoutTests/fast/css/getComputedStyle/getComputedStyle-border-width.html:16 > +testContainer.innerHTML = '<div id="test" style="border-width: 10px 5px 4px 3px; border-style: solid solid;">hello</div>';
Can we have some other units in the test case? It would also be interesting to see the setting of border-top and making sure the value makes it out when calling getComputedStyle on border-width.
Alexis Menard (darktears)
Comment 5
2011-12-15 13:07:50 PST
(In reply to
comment #4
)
> (From update of
attachment 119469
[details]
) > View in context:
https://bugs.webkit.org/attachment.cgi?id=119469&action=review
> > > Source/WebCore/css/CSSComputedStyleDeclaration.cpp:2166 > > + RefPtr<CSSValueList> list = CSSValueList::createSpaceSeparated(); > > + list->append(zoomAdjustedPixelValue(style->borderTop().width(), style.get(), cssValuePool)); > > When I added this for flex-flow, I didn't realize that getComputedStyle wasn't implemented for other short hand properties. I think adding this is a good idea, but we should make some helper functions for this rather than duplicating code (e.g., the code for margin width would be almost identical).
Yep, I was thinking of going step by step and implement each one after each one, group in helper function when the needs come.
> > > LayoutTests/ChangeLog:11 > > + * fast/css/getComputedStyle/getComputedStyle-border-width-expected.txt: Added. > > + * fast/css/getComputedStyle/getComputedStyle-border-width.html: Added. > > Do you need to also fix up fast/css/getComputedStyle/computed-style* and svg/css/getComputedStyle-basic?
Unless I'm mistaken it doesn't seem so.
> > > LayoutTests/fast/css/getComputedStyle/getComputedStyle-border-width.html:16 > > +testContainer.innerHTML = '<div id="test" style="border-width: 10px 5px 4px 3px; border-style: solid solid;">hello</div>'; > > Can we have some other units in the test case? It would also be interesting to see the setting of border-top and making sure the value makes it out when calling getComputedStyle on border-width.
Will fix.
Alexis Menard (darktears)
Comment 6
2011-12-15 13:34:42 PST
Created
attachment 119493
[details]
Patch
Tony Chang
Comment 7
2011-12-15 16:07:25 PST
Comment on
attachment 119493
[details]
Patch View in context:
https://bugs.webkit.org/attachment.cgi?id=119493&action=review
> Source/WebCore/css/CSSComputedStyleDeclaration.cpp:2163 > + if (style->borderTopStyle() == BNONE || style->borderTopStyle() == BHIDDEN) > + return cssValuePool->createValue(0, CSSPrimitiveValue::CSS_PX);
Why does this only check the top?
> Source/WebCore/css/CSSComputedStyleDeclaration.cpp:2169 > + list->append(zoomAdjustedPixelValue(style->borderTop().width(), style.get(), cssValuePool)); > + list->append(zoomAdjustedPixelValue(style->borderRight().width(), style.get(), cssValuePool)); > + list->append(zoomAdjustedPixelValue(style->borderBottom().width(), style.get(), cssValuePool)); > + list->append(zoomAdjustedPixelValue(style->borderLeft().width(), style.get(), cssValuePool));
Can you just use style->borderTopWidth() like the above code for CSSPropertyBorderTopWidth? I think that avoids the need to check border*Style() above?
> LayoutTests/fast/css/getComputedStyle/getComputedStyle-border-width.html:42 > +e.style.borderWidth="" > +e.style.borderTop = "10px solid" > +shouldBe("computedStyle.getPropertyValue('border-width')", "'10px 3px 3px 3px'");
Shouldn't right, bottom, left all be 0px here?
Alexis Menard (darktears)
Comment 8
2011-12-16 09:39:49 PST
Created
attachment 119624
[details]
Patch
WebKit Review Bot
Comment 9
2011-12-16 12:50:50 PST
Comment on
attachment 119624
[details]
Patch Clearing flags on attachment: 119624 Committed
r103096
: <
http://trac.webkit.org/changeset/103096
>
WebKit Review Bot
Comment 10
2011-12-16 12:50:56 PST
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.
Top of Page
Format For Printing
XML
Clone This Bug