RESOLVED FIXED Bug 167000
Support min() and max() in calc()
https://bugs.webkit.org/show_bug.cgi?id=167000
Summary Support min() and max() in calc()
Myles C. Maxfield
Reported 2017-01-12 16:47:57 PST
The CSSWG just resolved to add these.
Attachments
WIP (28.79 KB, patch)
2017-01-12 17:41 PST, Myles C. Maxfield
no flags
parsing half works now (30.84 KB, patch)
2017-08-15 13:05 PDT, Tim Horton
no flags
Archive of layout-test-results from ews112 for mac-elcapitan (647.25 KB, application/zip)
2017-08-15 15:03 PDT, Build Bot
no flags
fix tests; parse n>2 min()/max() items (31.77 KB, patch)
2017-08-15 16:42 PDT, Tim Horton
no flags
Patch (61.75 KB, patch)
2017-09-13 12:17 PDT, Tim Horton
no flags
Archive of layout-test-results from ews100 for mac-elcapitan (1.53 MB, application/zip)
2017-09-13 13:33 PDT, Build Bot
no flags
Archive of layout-test-results from ews105 for mac-elcapitan-wk2 (1.85 MB, application/zip)
2017-09-13 13:40 PDT, Build Bot
no flags
Archive of layout-test-results from ews116 for mac-elcapitan (2.21 MB, application/zip)
2017-09-13 13:46 PDT, Build Bot
no flags
Archive of layout-test-results from ews122 for ios-simulator-wk2 (1.41 MB, application/zip)
2017-09-13 14:02 PDT, Build Bot
no flags
Patch (64.92 KB, patch)
2017-09-15 00:48 PDT, Tim Horton
no flags
Myles C. Maxfield
Comment 1 2017-01-12 17:41:26 PST
Radar WebKit Bug Importer
Comment 2 2017-01-23 15:25:10 PST
Tim Horton
Comment 3 2017-08-15 13:05:45 PDT
Created attachment 318155 [details] parsing half works now
Build Bot
Comment 4 2017-08-15 13:07:28 PDT
Attachment 318155 [details] did not pass style-queue: ERROR: Source/WebCore/ChangeLog:9: You should remove the 'No new tests' and either add and list tests, or explain why no new tests were possible. [changelog/nonewtests] [5] Total errors found: 1 in 8 files If any of these errors are false positives, please file a bug against check-webkit-style.
Build Bot
Comment 5 2017-08-15 15:03:57 PDT
Comment on attachment 318155 [details] parsing half works now Attachment 318155 [details] did not pass mac-debug-ews (mac): Output: http://webkit-queues.webkit.org/results/4319705 Number of test failures exceeded the failure limit.
Build Bot
Comment 6 2017-08-15 15:03:58 PDT
Created attachment 318180 [details] Archive of layout-test-results from ews112 for mac-elcapitan The attached test failures were seen while running run-webkit-tests on the mac-debug-ews. Bot: ews112 Port: mac-elcapitan Platform: Mac OS X 10.11.6
Tim Horton
Comment 7 2017-08-15 16:42:24 PDT
Created attachment 318198 [details] fix tests; parse n>2 min()/max() items
Dean Jackson
Comment 8 2017-08-15 22:28:40 PDT
Is this for review? Or did it land?
Dean Jackson
Comment 9 2017-08-15 22:29:35 PDT
I don't see a commit, so I guess not.
Tim Horton
Comment 10 2017-08-15 22:40:07 PDT
Not yet. Needs tests! And probably some cleanup. It's more of a [WIP] than anything, I was just pushing it along.
Dean Jackson
Comment 11 2017-08-15 22:40:08 PDT
Comment on attachment 318198 [details] fix tests; parse n>2 min()/max() items View in context: https://bugs.webkit.org/attachment.cgi?id=318198&action=review > Source/WebCore/ChangeLog:9 > + No new tests... yet. I guess this is why there isn't a review :) > Source/WebCore/css/CSSCalculationValue.cpp:552 > + if (m_children.isEmpty()) > + return CSSPrimitiveValue::CSS_UNKNOWN; Can this ever happen? > Source/WebCore/platform/CalculationValue.cpp:102 > + if (m_children.isEmpty()) > + return std::numeric_limits<float>::quiet_NaN(); Can this happen? You have ASSERT(!childExpressions.isEmpty()); above, as well as this in the parser: if (!parseValueTerm(innerRange, depth, &value)) return false; Maybe we should fail elsewhere too?
Darin Adler
Comment 12 2017-08-28 17:27:23 PDT
Comment on attachment 318198 [details] fix tests; parse n>2 min()/max() items View in context: https://bugs.webkit.org/attachment.cgi?id=318198&action=review > Source/WebCore/platform/CalculationValue.h:228 > -inline bool operator==(const CalcExpressionBinaryOperation& a, const CalcExpressionBinaryOperation& b) > +inline bool operator==(const CalcExpressionOperation& a, const CalcExpressionOperation& b) > { > return a.getOperator() == b.getOperator() && a.leftSide() == b.leftSide() && a.rightSide() == b.rightSide(); > } The implementation of this function doesn’t seem right any more.
Tim Horton
Comment 13 2017-08-28 18:33:28 PDT
(In reply to Darin Adler from comment #12) > Comment on attachment 318198 [details] > fix tests; parse n>2 min()/max() items > > View in context: > https://bugs.webkit.org/attachment.cgi?id=318198&action=review > > > Source/WebCore/platform/CalculationValue.h:228 > > -inline bool operator==(const CalcExpressionBinaryOperation& a, const CalcExpressionBinaryOperation& b) > > +inline bool operator==(const CalcExpressionOperation& a, const CalcExpressionOperation& b) > > { > > return a.getOperator() == b.getOperator() && a.leftSide() == b.leftSide() && a.rightSide() == b.rightSide(); > > } > > The implementation of this function doesn’t seem right any more. Not even slightly.
Alan Stearns
Comment 14 2017-09-04 14:01:16 PDT
Please consider adding tests to WPT for this, (instead of|in addition to) WebKit-specific tests.
Tim Horton
Comment 15 2017-09-13 11:43:45 PDT
(In reply to Alan Stearns from comment #14) > Please consider adding tests to WPT for this, (instead of|in addition to) > WebKit-specific tests. I intend to, though the patch I'm about to upload just revives the existing-ish WebKit tests.
Tim Horton
Comment 16 2017-09-13 12:17:01 PDT
Build Bot
Comment 17 2017-09-13 13:33:17 PDT
Comment on attachment 320673 [details] Patch Attachment 320673 [details] did not pass mac-ews (mac): Output: http://webkit-queues.webkit.org/results/4537076 New failing tests: fast/block/positive-margin-block-child-align-center-calc.html css3/supports-dom-api.html css3/supports.html css3/calc/simple-calcs-prefixed.html
Build Bot
Comment 18 2017-09-13 13:33:20 PDT
Created attachment 320683 [details] Archive of layout-test-results from ews100 for mac-elcapitan The attached test failures were seen while running run-webkit-tests on the mac-ews. Bot: ews100 Port: mac-elcapitan Platform: Mac OS X 10.11.6
Build Bot
Comment 19 2017-09-13 13:40:27 PDT
Comment on attachment 320673 [details] Patch Attachment 320673 [details] did not pass mac-wk2-ews (mac-wk2): Output: http://webkit-queues.webkit.org/results/4537136 New failing tests: fast/block/positive-margin-block-child-align-center-calc.html css3/supports-dom-api.html css3/supports.html css3/calc/simple-calcs-prefixed.html
Build Bot
Comment 20 2017-09-13 13:40:29 PDT
Created attachment 320685 [details] Archive of layout-test-results from ews105 for mac-elcapitan-wk2 The attached test failures were seen while running run-webkit-tests on the mac-wk2-ews. Bot: ews105 Port: mac-elcapitan-wk2 Platform: Mac OS X 10.11.6
Build Bot
Comment 21 2017-09-13 13:46:49 PDT
Comment on attachment 320673 [details] Patch Attachment 320673 [details] did not pass mac-debug-ews (mac): Output: http://webkit-queues.webkit.org/results/4537134 New failing tests: fast/block/positive-margin-block-child-align-center-calc.html css3/supports-dom-api.html css3/supports.html css3/calc/simple-calcs-prefixed.html
Build Bot
Comment 22 2017-09-13 13:46:51 PDT
Created attachment 320687 [details] Archive of layout-test-results from ews116 for mac-elcapitan The attached test failures were seen while running run-webkit-tests on the mac-debug-ews. Bot: ews116 Port: mac-elcapitan Platform: Mac OS X 10.11.6
Build Bot
Comment 23 2017-09-13 14:02:53 PDT
Comment on attachment 320673 [details] Patch Attachment 320673 [details] did not pass ios-sim-ews (ios-simulator-wk2): Output: http://webkit-queues.webkit.org/results/4537195 New failing tests: fast/block/positive-margin-block-child-align-center-calc.html css3/supports-dom-api.html css3/supports.html css3/calc/simple-calcs-prefixed.html
Build Bot
Comment 24 2017-09-13 14:02:55 PDT
Created attachment 320690 [details] Archive of layout-test-results from ews122 for ios-simulator-wk2 The attached test failures were seen while running run-webkit-tests on the ios-sim-ews. Bot: ews122 Port: ios-simulator-wk2 Platform: Mac OS X 10.12.5
Tim Horton
Comment 25 2017-09-15 00:48:07 PDT
Dave Hyatt
Comment 26 2017-09-18 15:32:20 PDT
Comment on attachment 320877 [details] Patch r=me
WebKit Commit Bot
Comment 27 2017-09-18 16:36:25 PDT
Comment on attachment 320877 [details] Patch Clearing flags on attachment: 320877 Committed r222190: <http://trac.webkit.org/changeset/222190>
WebKit Commit Bot
Comment 28 2017-09-18 16:36:27 PDT
All reviewed patches have been landed. Closing bug.
Joonghun Park
Comment 29 2019-04-30 07:53:25 PDT
*** Bug 143515 has been marked as a duplicate of this bug. ***
Note You need to log in before you can comment on or make changes to this bug.