Bug 78446

Summary: CSS3 calc: embed calc expressions in CSSPrimitiveValue
Product: WebKit Reporter: Mike Lawther <mikelawther>
Component: New BugsAssignee: Mike Lawther <mikelawther>
Status: RESOLVED FIXED    
Severity: Normal CC: macpherson, menard, webkit.review.bot
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: Unspecified   
OS: Unspecified   
Bug Depends on:    
Bug Blocks: 16662    
Attachments:
Description Flags
Patch
none
Patch none

Mike Lawther
Reported 2012-02-12 18:09:21 PST
CSS3 calc: embed calc expressions in CSSPrimitiveValue
Attachments
Patch (50.24 KB, patch)
2012-02-12 18:11 PST, Mike Lawther
no flags
Patch (51.00 KB, patch)
2012-02-13 16:56 PST, Mike Lawther
no flags
Mike Lawther
Comment 1 2012-02-12 18:11:35 PST
Ojan Vafai
Comment 2 2012-02-13 15:18:34 PST
Comment on attachment 126697 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=126697&action=review R- just for the multiplier issue. > Source/WebCore/css/CSSCalculationValue.cpp:85 > +double CSSCalcValue::computeLengthPx(RenderStyle* currStyle, RenderStyle* rootStyle, double multiplier, bool computingFontSize) const nit: s/currStyle/currentStyle. here and below > Source/WebCore/css/CSSPrimitiveValue.cpp:59 > + case CSSPrimitiveValue:: CSS_CALC_PERCENTAGE_NUMBER: > + case CSSPrimitiveValue:: CSS_CALC_PERCENTAGE_LENGTH: I find these names a little confusing. It's a bit verbose, but how about CSS_CALC_PERCENTAGE_WITH_NUMBER and CSS_CALC_PERCENTAGE_WITH_LENGTH? > Source/WebCore/css/CSSPrimitiveValue.cpp:485 > + double value; How about s/value/computedValue? > Source/WebCore/css/CSSPrimitiveValue.cpp:487 > + value = m_value.calc->computeLengthPx(style, rootStyle, 1.0, computingFontSize); Should you not be passing multiplier instead of 1.0? If 1.0 is correct, then this at least needs a comment explaining why. > Source/WebCore/css/CSSPrimitiveValue.h:141 > + const unsigned short type = primitiveType(); I don't think the const buys you anything here, does it?
Mike Lawther
Comment 3 2012-02-13 16:54:53 PST
Comment on attachment 126697 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=126697&action=review >> Source/WebCore/css/CSSPrimitiveValue.cpp:59 >> + case CSSPrimitiveValue:: CSS_CALC_PERCENTAGE_LENGTH: > > I find these names a little confusing. It's a bit verbose, but how about CSS_CALC_PERCENTAGE_WITH_NUMBER and CSS_CALC_PERCENTAGE_WITH_LENGTH? Done. >> Source/WebCore/css/CSSPrimitiveValue.cpp:485 >> + double value; > > How about s/value/computedValue? Done. >> Source/WebCore/css/CSSPrimitiveValue.cpp:487 >> + value = m_value.calc->computeLengthPx(style, rootStyle, 1.0, computingFontSize); > > Should you not be passing multiplier instead of 1.0? If 1.0 is correct, then this at least needs a comment explaining why. I only want to apply the multiplier once. I could pass it in here and add extra logic to ensure I don't re-apply it down below - but I figured this was simpler. I've added a comment. >> Source/WebCore/css/CSSPrimitiveValue.h:141 >> + const unsigned short type = primitiveType(); > > I don't think the const buys you anything here, does it? Not really. Force of habit trying to make everything const that is :) Removed.
Mike Lawther
Comment 4 2012-02-13 16:56:04 PST
Mike Lawther
Comment 5 2012-02-13 16:56:51 PST
Comment on attachment 126867 [details] Patch Hey Ojan - thanks for the review! I've addressed your comments in this new patch.
WebKit Review Bot
Comment 6 2012-02-14 01:47:06 PST
Comment on attachment 126867 [details] Patch Clearing flags on attachment: 126867 Committed r107688: <http://trac.webkit.org/changeset/107688>
WebKit Review Bot
Comment 7 2012-02-14 01:47:11 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.