Summary: | Prepare functions in LengthFunctions.h for LayoutUnits | ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Product: | WebKit | Reporter: | Levi Weintraub <leviw> | ||||||||||
Component: | Layout and Rendering | Assignee: | Levi Weintraub <leviw> | ||||||||||
Status: | RESOLVED FIXED | ||||||||||||
Severity: | Normal | CC: | eae, eric, jchaffraix, macpherson, menard, webkit.review.bot | ||||||||||
Priority: | P2 | ||||||||||||
Version: | 528+ (Nightly build) | ||||||||||||
Hardware: | Unspecified | ||||||||||||
OS: | Unspecified | ||||||||||||
Bug Depends on: | |||||||||||||
Bug Blocks: | 60318 | ||||||||||||
Attachments: |
|
Description
Levi Weintraub
2012-04-11 16:00:41 PDT
Created attachment 136781 [details]
Patch
Comment on attachment 136781 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=136781&action=review > Source/WebCore/rendering/RenderFrameSet.cpp:280 > remainingLen -= gridLayout[i]; is this a length? Should this use .intValue() instead? Comment on attachment 136781 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=136781&action=review >> Source/WebCore/rendering/RenderFrameSet.cpp:280 >> remainingLen -= gridLayout[i]; > > is this a length? Should this use .intValue() instead? You are so right :) Created attachment 136793 [details]
Patch
Ping Comment on attachment 136793 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=136793&action=review The change is fine, one question. > Source/WebCore/css/LengthFunctions.h:36 > +LayoutUnit minimumValueForLength(const Length&, LayoutUnit maximumValue, RenderView* = 0, bool roundPercentages = false); > +LayoutUnit valueForLength(const Length&, LayoutUnit maximumValue, RenderView* = 0, bool roundPercentages = false); > +float floatValueForLength(const Length&, LayoutUnit maximumValue, RenderView* = 0); Why don't you also update the implementation of those functions as part of this change? Created attachment 136932 [details]
Patch
Comment on attachment 136932 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=136932&action=review > Source/WebCore/dom/Document.cpp:1855 > + marginTop = style->marginTop().isAuto() ? marginTop : static_cast<int>(valueForLength(style->marginTop(), width, view)); > + marginRight = style->marginRight().isAuto() ? marginRight : static_cast<int>(valueForLength(style->marginRight(), width, view)); > + marginBottom = style->marginBottom().isAuto() ? marginBottom : static_cast<int>(valueForLength(style->marginBottom(), width, view)); > + marginLeft = style->marginLeft().isAuto() ? marginLeft : static_cast<int>(valueForLength(style->marginLeft(), width, view)); Seems like you want intValidForLength now? Which at least does this wrapping/casting for you? Comment on attachment 136932 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=136932&action=review > Source/WebCore/css/LengthFunctions.cpp:47 > return 0; There should be no 0 but ZERO_LAYOUT_UNIT for all the functions touched and that now returns a LayoutUnit. (In reply to comment #8) > (From update of attachment 136932 [details]) > View in context: https://bugs.webkit.org/attachment.cgi?id=136932&action=review > > > Source/WebCore/dom/Document.cpp:1855 > > + marginTop = style->marginTop().isAuto() ? marginTop : static_cast<int>(valueForLength(style->marginTop(), width, view)); > > + marginRight = style->marginRight().isAuto() ? marginRight : static_cast<int>(valueForLength(style->marginRight(), width, view)); > > + marginBottom = style->marginBottom().isAuto() ? marginBottom : static_cast<int>(valueForLength(style->marginBottom(), width, view)); > > + marginLeft = style->marginLeft().isAuto() ? marginLeft : static_cast<int>(valueForLength(style->marginLeft(), width, view)); > > Seems like you want intValidForLength now? Which at least does this wrapping/casting for you? I like that suggestion. I'll get on that momentarily Created attachment 136944 [details]
Patch
(In reply to comment #11) > Created an attachment (id=136944) [details] > Patch I think I finally got this covered :) Comment on attachment 136944 [details]
Patch
LGTM.
Comment on attachment 136944 [details] Patch Clearing flags on attachment: 136944 Committed r114079: <http://trac.webkit.org/changeset/114079> All reviewed patches have been landed. Closing bug. |