RESOLVED FIXED 188697
[css-logical] Flow relative margin, padding and border shorthands
https://bugs.webkit.org/show_bug.cgi?id=188697
Summary [css-logical] Flow relative margin, padding and border shorthands
Oriol Brufau
Reported 2018-08-17 05:18:55 PDT
Spec: https://drafts.csswg.org/css-logical-1/#box Implement * margin-{block,inline} * padding-{block,inline} * border-{block,inline} * border-{block,inline}-{width,style,color} * inset-{block,inline}-{start,end} * inset-{block,inline} * inset They will be implemented behind a flag, like has happened in Blink. Firefox has shipped the inset longhands.
Attachments
Patch (201.06 KB, patch)
2018-08-22 10:17 PDT, Oriol Brufau
no flags
Archive of layout-test-results from ews126 for ios-simulator-wk2 (2.65 MB, application/zip)
2018-08-22 12:27 PDT, EWS Watchlist
no flags
Archive of layout-test-results from ews117 for mac-sierra (3.46 MB, application/zip)
2018-08-22 12:30 PDT, EWS Watchlist
no flags
Archive of layout-test-results from ews103 for mac-sierra (2.83 MB, application/zip)
2018-08-22 12:32 PDT, EWS Watchlist
no flags
Archive of layout-test-results from ews104 for mac-sierra-wk2 (3.52 MB, application/zip)
2018-08-22 12:34 PDT, EWS Watchlist
no flags
Archive of layout-test-results from ews123 for ios-simulator-wk2 (2.32 MB, application/zip)
2018-08-22 14:31 PDT, EWS Watchlist
no flags
Patch (200.98 KB, patch)
2018-08-22 15:40 PDT, Oriol Brufau
no flags
Archive of layout-test-results from ews101 for mac-sierra (2.36 MB, application/zip)
2018-08-22 17:06 PDT, EWS Watchlist
no flags
Archive of layout-test-results from ews106 for mac-sierra-wk2 (2.92 MB, application/zip)
2018-08-22 17:39 PDT, EWS Watchlist
no flags
Archive of layout-test-results from ews113 for mac-sierra (3.09 MB, application/zip)
2018-08-22 17:41 PDT, EWS Watchlist
no flags
Archive of layout-test-results from ews122 for ios-simulator-wk2 (2.32 MB, application/zip)
2018-08-22 17:52 PDT, EWS Watchlist
no flags
Archive of layout-test-results from ews121 for ios-simulator-wk2 (2.64 MB, application/zip)
2018-08-22 19:52 PDT, EWS Watchlist
no flags
Patch (201.09 KB, patch)
2018-08-23 16:25 PDT, Oriol Brufau
no flags
Patch (201.49 KB, patch)
2018-08-23 16:59 PDT, Oriol Brufau
no flags
Patch (203.40 KB, patch)
2018-08-24 06:07 PDT, Oriol Brufau
no flags
Patch (211.41 KB, patch)
2018-08-24 07:20 PDT, Oriol Brufau
no flags
Archive of layout-test-results from ews103 for mac-sierra (2.37 MB, application/zip)
2018-08-24 08:49 PDT, EWS Watchlist
no flags
Archive of layout-test-results from ews104 for mac-sierra-wk2 (2.90 MB, application/zip)
2018-08-24 08:51 PDT, EWS Watchlist
no flags
Archive of layout-test-results from ews116 for mac-sierra (3.13 MB, application/zip)
2018-08-24 09:22 PDT, EWS Watchlist
no flags
Archive of layout-test-results from ews125 for ios-simulator-wk2 (2.31 MB, application/zip)
2018-08-24 09:28 PDT, EWS Watchlist
no flags
Archive of layout-test-results from ews124 for ios-simulator-wk2 (2.42 MB, application/zip)
2018-08-24 11:27 PDT, EWS Watchlist
no flags
Archive of layout-test-results from ews112 for mac-sierra (3.10 MB, application/zip)
2018-08-24 11:34 PDT, EWS Watchlist
no flags
Patch (215.95 KB, patch)
2018-08-26 12:56 PDT, Oriol Brufau
no flags
Patch (215.90 KB, patch)
2018-08-28 14:15 PDT, Oriol Brufau
no flags
Patch (215.62 KB, patch)
2018-08-28 15:36 PDT, Oriol Brufau
no flags
Patch (215.54 KB, patch)
2018-09-10 15:16 PDT, Oriol Brufau
no flags
Archive of layout-test-results from ews104 for mac-sierra-wk2 (3.30 MB, application/zip)
2018-09-10 16:55 PDT, EWS Watchlist
no flags
Patch (216.79 KB, patch)
2018-09-12 17:21 PDT, Oriol Brufau
no flags
Patch (222.98 KB, patch)
2018-09-21 08:23 PDT, Oriol Brufau
no flags
Patch (223.01 KB, patch)
2018-09-21 08:45 PDT, Oriol Brufau
no flags
Patch (224.36 KB, patch)
2018-09-25 10:47 PDT, Oriol Brufau
no flags
Patch (215.11 KB, patch)
2018-10-17 12:19 PDT, Oriol Brufau
no flags
Patch (214.92 KB, patch)
2018-10-17 13:18 PDT, Oriol Brufau
no flags
Archive of layout-test-results from ews202 for win-future (12.76 MB, application/zip)
2018-10-17 16:02 PDT, EWS Watchlist
no flags
Patch (245.64 KB, patch)
2018-10-17 16:30 PDT, Oriol Brufau
no flags
Archive of layout-test-results from ews103 for mac-sierra (2.43 MB, application/zip)
2018-10-17 17:40 PDT, EWS Watchlist
no flags
Archive of layout-test-results from ews104 for mac-sierra-wk2 (4.50 MB, application/zip)
2018-10-17 18:12 PDT, EWS Watchlist
no flags
Archive of layout-test-results from ews113 for mac-sierra (3.65 MB, application/zip)
2018-10-17 18:50 PDT, EWS Watchlist
no flags
Archive of layout-test-results from ews204 for win-future (12.72 MB, application/zip)
2018-10-17 19:28 PDT, EWS Watchlist
no flags
Archive of layout-test-results from ews122 for ios-simulator-wk2 (2.35 MB, application/zip)
2018-10-17 19:42 PDT, EWS Watchlist
no flags
Archive of layout-test-results from ews121 for ios-simulator-wk2 (2.47 MB, application/zip)
2018-10-17 21:39 PDT, EWS Watchlist
no flags
Patch (310.67 KB, patch)
2018-10-18 12:27 PDT, Oriol Brufau
no flags
Patch (310.70 KB, patch)
2018-10-18 12:56 PDT, Oriol Brufau
no flags
Archive of layout-test-results from ews101 for mac-sierra (2.40 MB, application/zip)
2018-10-18 14:07 PDT, EWS Watchlist
no flags
Patch (313.48 KB, patch)
2018-10-18 17:00 PDT, Oriol Brufau
no flags
Patch (314.24 KB, patch)
2018-10-19 07:56 PDT, Oriol Brufau
no flags
Archive of layout-test-results from ews102 for mac-sierra (2.62 MB, application/zip)
2018-10-19 08:58 PDT, EWS Watchlist
no flags
Archive of layout-test-results from ews115 for mac-sierra (3.23 MB, application/zip)
2018-10-19 10:12 PDT, EWS Watchlist
no flags
Patch (317.58 KB, patch)
2018-10-31 14:19 PDT, Oriol Brufau
no flags
Archive of layout-test-results from ews100 for mac-sierra (2.62 MB, application/zip)
2018-10-31 15:23 PDT, EWS Watchlist
no flags
Patch (317.42 KB, patch)
2018-10-31 15:26 PDT, Oriol Brufau
no flags
Patch (317.46 KB, patch)
2018-11-15 07:58 PST, Oriol Brufau
no flags
Archive of layout-test-results from ews103 for mac-sierra (2.38 MB, application/zip)
2018-11-15 08:56 PST, EWS Watchlist
no flags
Archive of layout-test-results from ews107 for mac-sierra-wk2 (2.98 MB, application/zip)
2018-11-15 09:20 PST, EWS Watchlist
no flags
Archive of layout-test-results from ews204 for win-future (12.83 MB, application/zip)
2018-11-15 09:52 PST, EWS Watchlist
no flags
Archive of layout-test-results from ews117 for mac-sierra (3.45 MB, application/zip)
2018-11-15 09:52 PST, EWS Watchlist
no flags
Archive of layout-test-results from ews122 for ios-simulator-wk2 (3.04 MB, application/zip)
2018-11-15 10:41 PST, EWS Watchlist
no flags
Patch (317.21 KB, patch)
2018-11-15 11:40 PST, Oriol Brufau
no flags
Patch (188.28 KB, patch)
2019-01-21 10:34 PST, Oriol Brufau
no flags
Oriol Brufau
Comment 1 2018-08-20 05:36:44 PDT
Bug 188711 is causing problems for logical inset properties, so I will add them later in another bug. This one will add: * margin-{block,inline} * padding-{block,inline} * border-{block,inline} * border-{block,inline}-{width,style,color}
Oriol Brufau
Comment 2 2018-08-22 10:17:12 PDT Comment hidden (obsolete)
EWS Watchlist
Comment 3 2018-08-22 12:27:25 PDT Comment hidden (obsolete)
EWS Watchlist
Comment 4 2018-08-22 12:27:26 PDT Comment hidden (obsolete)
EWS Watchlist
Comment 5 2018-08-22 12:30:27 PDT Comment hidden (obsolete)
EWS Watchlist
Comment 6 2018-08-22 12:30:29 PDT Comment hidden (obsolete)
EWS Watchlist
Comment 7 2018-08-22 12:32:33 PDT Comment hidden (obsolete)
EWS Watchlist
Comment 8 2018-08-22 12:32:35 PDT Comment hidden (obsolete)
EWS Watchlist
Comment 9 2018-08-22 12:34:54 PDT Comment hidden (obsolete)
EWS Watchlist
Comment 10 2018-08-22 12:34:55 PDT Comment hidden (obsolete)
EWS Watchlist
Comment 11 2018-08-22 14:31:28 PDT Comment hidden (obsolete)
EWS Watchlist
Comment 12 2018-08-22 14:31:30 PDT Comment hidden (obsolete)
Oriol Brufau
Comment 13 2018-08-22 15:40:36 PDT Comment hidden (obsolete)
EWS Watchlist
Comment 14 2018-08-22 17:06:00 PDT Comment hidden (obsolete)
EWS Watchlist
Comment 15 2018-08-22 17:06:02 PDT Comment hidden (obsolete)
EWS Watchlist
Comment 16 2018-08-22 17:39:15 PDT Comment hidden (obsolete)
EWS Watchlist
Comment 17 2018-08-22 17:39:17 PDT Comment hidden (obsolete)
EWS Watchlist
Comment 18 2018-08-22 17:41:27 PDT Comment hidden (obsolete)
EWS Watchlist
Comment 19 2018-08-22 17:41:29 PDT Comment hidden (obsolete)
EWS Watchlist
Comment 20 2018-08-22 17:52:56 PDT Comment hidden (obsolete)
EWS Watchlist
Comment 21 2018-08-22 17:52:58 PDT Comment hidden (obsolete)
EWS Watchlist
Comment 22 2018-08-22 19:52:54 PDT Comment hidden (obsolete)
EWS Watchlist
Comment 23 2018-08-22 19:52:56 PDT Comment hidden (obsolete)
Oriol Brufau
Comment 24 2018-08-23 16:25:13 PDT Comment hidden (obsolete)
Oriol Brufau
Comment 25 2018-08-23 16:59:56 PDT Comment hidden (obsolete)
Michael Catanzaro
Comment 26 2018-08-24 05:43:06 PDT
Comment on attachment 347973 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=347973&action=review > Source/cmake/WebKitFeatures.cmake:103 > + WEBKIT_OPTION_DEFINE(ENABLE_CSS_LOGICAL "Toggle CSS Logical Properties and Values support" PRIVATE ${ENABLE_EXPERIMENTAL_FEATURES}) Problem is that ENABLE_EXPERIMENTAL_FEATURES isn't defined until the bottom of this file, so you can't use it here. I don't think there's any particular reason for that -- we *could* choose to change it -- but until now we have not enabled any experimental build flags across all ports, only for particular ports. E.g. if you want it enabled for GTK, you would do that in OptionsGTK.cmake. If you don't like this, you could try moving the definition of ENABLE_EXPERIMENTAL_FEATURES up to the top of this file and see if that works. Mostly we use runtime flags for experimental features, which is why this hasn't been an issue until now.
Oriol Brufau
Comment 27 2018-08-24 06:07:21 PDT Comment hidden (obsolete)
Oriol Brufau
Comment 28 2018-08-24 07:20:38 PDT Comment hidden (obsolete)
EWS Watchlist
Comment 29 2018-08-24 08:49:42 PDT Comment hidden (obsolete)
EWS Watchlist
Comment 30 2018-08-24 08:49:44 PDT Comment hidden (obsolete)
EWS Watchlist
Comment 31 2018-08-24 08:51:42 PDT Comment hidden (obsolete)
EWS Watchlist
Comment 32 2018-08-24 08:51:44 PDT Comment hidden (obsolete)
EWS Watchlist
Comment 33 2018-08-24 09:22:17 PDT Comment hidden (obsolete)
EWS Watchlist
Comment 34 2018-08-24 09:22:19 PDT Comment hidden (obsolete)
EWS Watchlist
Comment 35 2018-08-24 09:28:22 PDT Comment hidden (obsolete)
EWS Watchlist
Comment 36 2018-08-24 09:28:24 PDT Comment hidden (obsolete)
EWS Watchlist
Comment 37 2018-08-24 11:27:50 PDT Comment hidden (obsolete)
EWS Watchlist
Comment 38 2018-08-24 11:27:52 PDT Comment hidden (obsolete)
EWS Watchlist
Comment 39 2018-08-24 11:34:44 PDT Comment hidden (obsolete)
EWS Watchlist
Comment 40 2018-08-24 11:34:46 PDT Comment hidden (obsolete)
Oriol Brufau
Comment 41 2018-08-26 12:56:00 PDT Comment hidden (obsolete)
Javier Fernandez
Comment 42 2018-08-27 06:45:39 PDT
Comment on attachment 348100 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=348100&action=review > Source/WebCore/css/CSSComputedStyleDeclaration.cpp:4232 > + bool showEnd = !compareCSSValuePtr(startValue, endValue); Do we really need this variable ? > Source/WebCore/css/StyleProperties.cpp:423 > + if (start.isImportant() != end.isImportant()) Shouldn't we move this check before the one we do for 'initial' ? Isn't having the same value of 'importance' a requirement for a valid parsing ? > Source/WebCore/css/StyleProperties.cpp:700 > +String StyleProperties::borderPropertyValue( I think this function has an incorrect indentation; it should be declared in a single line. > Source/WebCore/css/StyleProperties.h:167 > + String borderPropertyValue( Please, declare this function in a single line. > Source/WebCore/css/parser/CSSPropertyParser.cpp:5685 > + return m_range.atEnd(); Shouldn't consumeBorder already do the check fr m_range.atEnd ? In any case, we could move it above, before adding the properties' value and just finishing the logic with return true. It may be a good idea to have ASSERTS here for ensuring we got non-null pointers from consumeBorder if such function returns true. Although not mandatory, since releaseNonNull should avoid referencing null pointers already, it'd would hep us to catch mistakes in the consumeBorder funcition's parsing logic. > Source/WebCore/css/parser/CSSPropertyParser.cpp:5710 > + return m_range.atEnd(); Ditto > Source/WebCore/css/parser/CSSPropertyParser.cpp:5781 > + return m_range.atEnd(); Ditto
Oriol Brufau
Comment 43 2018-08-27 09:02:27 PDT
Comment on attachment 348100 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=348100&action=review >> Source/WebCore/css/CSSComputedStyleDeclaration.cpp:4232 >> + bool showEnd = !compareCSSValuePtr(startValue, endValue); > > Do we really need this variable ? I can remove it, but this way is more consistent with getCSSPropertyValuesFor4SidesShorthand below and with Blink (https://cs.chromium.org/chromium/src/third_party/blink/renderer/core/css/style_property_serializer.cc?rcl=da886a9725b3b5f44903354f3cf01a1c7ccb1a0c&l=813) >> Source/WebCore/css/StyleProperties.cpp:423 >> + if (start.isImportant() != end.isImportant()) > > Shouldn't we move this check before the one we do for 'initial' ? Isn't having the same value of 'importance' a requirement for a valid parsing ? You are right, my code is based on get4Values which has this bug. >> Source/WebCore/css/parser/CSSPropertyParser.cpp:5685 >> + return m_range.atEnd(); > > Shouldn't consumeBorder already do the check fr m_range.atEnd ? In any case, we could move it above, before adding the properties' value and just finishing the logic with return true. > > It may be a good idea to have ASSERTS here for ensuring we got non-null pointers from consumeBorder if such function returns true. Although not mandatory, since releaseNonNull should avoid referencing null pointers already, it'd would hep us to catch mistakes in the consumeBorder funcition's parsing logic. Not sure. It seems that currently WebKit doesn't check m_range.atEnd() in consumeBorder. Blink checks it after AddExpandedPropertyForValue. If I understand correctly, this would mean that border longhands are set before checking that there is no extra value at the end, but I can't reproduce this. WebKit also checks m_range.atEnd() after addProperty in consume4Values. So not sure if I'm misunderstanding something or if there is no difference in behavior.
Oriol Brufau
Comment 44 2018-08-28 13:55:01 PDT
Comment on attachment 348100 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=348100&action=review >> Source/WebCore/css/parser/CSSPropertyParser.cpp:5685 >> + return m_range.atEnd(); > > It may be a good idea to have ASSERTS here for ensuring we got non-null pointers from consumeBorder if such function returns true. Although not mandatory, since releaseNonNull should avoid referencing null pointers already, it'd would hep us to catch mistakes in the consumeBorder funcition's parsing logic. consumeBorder already returns false if some pointer is null, so adding ASSERTS after every call doesn't seem useful to me.
Oriol Brufau
Comment 45 2018-08-28 14:15:35 PDT Comment hidden (obsolete)
Javier Fernandez
Comment 46 2018-08-28 14:35:57 PDT
Comment on attachment 348100 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=348100&action=review >>> Source/WebCore/css/CSSComputedStyleDeclaration.cpp:4232 >>> + bool showEnd = !compareCSSValuePtr(startValue, endValue); >> >> Do we really need this variable ? > > I can remove it, but this way is more consistent with getCSSPropertyValuesFor4SidesShorthand below and with Blink > (https://cs.chromium.org/chromium/src/third_party/blink/renderer/core/css/style_property_serializer.cc?rcl=da886a9725b3b5f44903354f3cf01a1c7ccb1a0c&l=813) Ok, it's not a big deal, so lets keep it. >>>> Source/WebCore/css/parser/CSSPropertyParser.cpp:5685 >>>> + return m_range.atEnd(); >>> >>> Shouldn't consumeBorder already do the check fr m_range.atEnd ? In any case, we could move it above, before adding the properties' value and just finishing the logic with return true. >>> >>> It may be a good idea to have ASSERTS here for ensuring we got non-null pointers from consumeBorder if such function returns true. Although not mandatory, since releaseNonNull should avoid referencing null pointers already, it'd would hep us to catch mistakes in the consumeBorder funcition's parsing logic. >> >> Not sure. It seems that currently WebKit doesn't check m_range.atEnd() in consumeBorder. Blink checks it after AddExpandedPropertyForValue. >> If I understand correctly, this would mean that border longhands are set before checking that there is no extra value at the end, but I can't reproduce this. >> WebKit also checks m_range.atEnd() after addProperty in consume4Values. >> So not sure if I'm misunderstanding something or if there is no difference in behavior. > > consumeBorder already returns false if some pointer is null, so adding ASSERTS after every call doesn't seem useful to me. Yes, I agree the asserts are not necessary. Additionally, since the parseShorthand will return false in case of !m_range.AtEnd(), the added values will be discarded, so doing the check before doesn't change the behavior. It seems there is not much consistent on this kind of logic; CSSProperyOverflow, CSSPropertyMarker or CSSPropertyBackgroundPosition are some examples of shorthand doing the check before adding the parsed values. Anyway, since there is no behavior change I think it's not a problem to keep the patch as it is. My comment was just a suggestion, looking at what other shorthand do. However, keeping consistence with the Blink implementation may be a good idea as well.
Oriol Brufau
Comment 47 2018-08-28 15:36:15 PDT Comment hidden (obsolete)
Oriol Brufau
Comment 48 2018-09-10 15:16:46 PDT Comment hidden (obsolete)
EWS Watchlist
Comment 49 2018-09-10 16:55:03 PDT Comment hidden (obsolete)
EWS Watchlist
Comment 50 2018-09-10 16:55:06 PDT Comment hidden (obsolete)
Manuel Rego Casasnovas
Comment 51 2018-09-11 03:02:04 PDT
Comment on attachment 349335 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=349335&action=review It'd be nice to be more verbose on the ChangeLog files documenting the changes on the different files to ease the review process. I don't have knowledge to review the changes related to the compilation flag, specially on the Mac side, I hope someone else can take a look to that. > Source/WebCore/css/CSSComputedStyleDeclaration.cpp:3884 > + if (!compareCSSValuePtr<CSSValue>(value, propertyValue(CSSPropertyBorderBlockEnd, DoNotUpdateLayout))) > + return nullptr; Does this ever happens? Wouldn't be enough with an ASSERT() here? > Source/WebCore/css/parser/CSSPropertyParser.cpp:-4936 > - addExpandedPropertyForValue(CSSPropertyBorderImage, CSSValuePool::singleton().createImplicitInitialValue(), important); Why are you removing this line? Is it right? > Source/WebCore/css/parser/CSSPropertyParser.cpp:4942 > + if (!end) Nit: I'd use "if (endImplicit)" here. > Source/WebCore/css/parser/CSSPropertyParser.cpp:5683 > + addExpandedPropertyForValue(CSSPropertyBorderInlineColor, color.releaseNonNull(), important); What happens wiht CSSPropertyBorderImage? > Source/WebCore/css/parser/CSSPropertyParser.h:65 > + bool consumeBorder(RefPtr<CSSValue>&, RefPtr<CSSValue>&, RefPtr<CSSValue>&); Here the names of the arguments are important. > Source/cmake/WebKitFeatures.cmake:178 > +macro(_WEBKIT_OPTION_ENFORCE_DEPENDS _name) > + foreach (_dependency ${_WEBKIT_AVAILABLE_OPTIONS_${_name}_DEPENDENCIES}) > + if (NOT ${_dependency}) > + message(STATUS "Disabling ${_name} since ${_dependency} is disabled.") > + set(${_name} OFF) > + set(_OPTION_CHANGED TRUE) > + break () > + endif () > + endforeach () > +endmacro() > + > +macro(_WEBKIT_OPTION_ENFORCE_ALL_DEPENDS) > + set(_OPTION_CHANGED TRUE) > + while (${_OPTION_CHANGED}) > + set(_OPTION_CHANGED FALSE) > + foreach (_name ${_WEBKIT_AVAILABLE_OPTIONS}) > + if (${_name}) > + _WEBKIT_OPTION_ENFORCE_DEPENDS(${_name}) > + endif () > + endforeach () > + endwhile () > +endmacro() > + > +macro(_WEBKIT_OPTION_ENFORCE_CONFLICTS _name) > + foreach (_conflict ${_WEBKIT_AVAILABLE_OPTIONS_${_name}_CONFLICTS}) > + if (${_conflict}) > + message(FATAL_ERROR "${_name} conflicts with ${_conflict}. You must disable one or the other.") > + endif () > + endforeach () > +endmacro() > + > +macro(_WEBKIT_OPTION_ENFORCE_ALL_CONFLICTS) > + foreach (_name ${_WEBKIT_AVAILABLE_OPTIONS}) > + if (${_name}) > + _WEBKIT_OPTION_ENFORCE_CONFLICTS(${_name}) > + endif () > + endforeach () > +endmacro() > + > +macro(WEBKIT_OPTION_END) > + set(_SETTING_WEBKIT_OPTIONS FALSE) > + > + list(SORT _WEBKIT_AVAILABLE_OPTIONS) > + set(_MAX_FEATURE_LENGTH 0) > + foreach (_name ${_WEBKIT_AVAILABLE_OPTIONS}) > + string(LENGTH ${_name} _name_length) > + if (_name_length GREATER _MAX_FEATURE_LENGTH) > + set(_MAX_FEATURE_LENGTH ${_name_length}) > + endif () > + > + option(${_name} "${_WEBKIT_AVAILABLE_OPTIONS_DESCRIPTION_${_name}}" ${_WEBKIT_AVAILABLE_OPTIONS_INITIAL_VALUE_${_name}}) > + if (NOT ${_WEBKIT_AVAILABLE_OPTIONS_IS_PUBLIC_${_name}}) > + mark_as_advanced(FORCE ${_name}) > + endif () > + endforeach () > + > + # Run through every possible depends to make sure we have disabled anything > + # that could cause an unnecessary conflict before processing conflicts. > + _WEBKIT_OPTION_ENFORCE_ALL_DEPENDS() > + _WEBKIT_OPTION_ENFORCE_ALL_CONFLICTS() > + > + foreach (_name ${_WEBKIT_AVAILABLE_OPTIONS}) > + if (${_name}) > + list(APPEND FEATURE_DEFINES ${_name}) > + set(FEATURE_DEFINES_WITH_SPACE_SEPARATOR "${FEATURE_DEFINES_WITH_SPACE_SEPARATOR} ${_name}") > + endif () > + endforeach () > +endmacro() > + > +macro(PRINT_WEBKIT_OPTIONS) > + message(STATUS "Enabled features:") > + > + set(_should_print_dots ON) > + foreach (_name ${_WEBKIT_AVAILABLE_OPTIONS}) > + if (${_WEBKIT_AVAILABLE_OPTIONS_IS_PUBLIC_${_name}}) > + string(LENGTH ${_name} _name_length) > + set(_message " ${_name} ") > + > + # Print dots on every other row, for readability. > + foreach (IGNORE RANGE ${_name_length} ${_MAX_FEATURE_LENGTH}) > + if (${_should_print_dots}) > + set(_message "${_message}.") > + else () > + set(_message "${_message} ") > + endif () > + endforeach () > + > + set(_should_print_dots (NOT ${_should_print_dots})) > + > + set(_message "${_message} ${${_name}}") > + message(STATUS "${_message}") > + endif () > + endforeach () > +endmacro() > + > +set(_WEBKIT_CONFIG_FILE_VARIABLES "") > + > +macro(EXPOSE_VARIABLE_TO_BUILD _variable_name) > + list(APPEND _WEBKIT_CONFIG_FILE_VARIABLES ${_variable_name}) > +endmacro() > + > +macro(SET_AND_EXPOSE_TO_BUILD _variable_name) > + # It's important to handle the case where the value isn't passed, because often > + # during configuration an empty variable is the result of a failed package search. > + if (${ARGC} GREATER 1) > + set(_variable_value ${ARGV1}) > + else () > + set(_variable_value OFF) > + endif () > + > + set(${_variable_name} ${_variable_value}) > + EXPOSE_VARIABLE_TO_BUILD(${_variable_name}) > +endmacro() > + > +option(ENABLE_EXPERIMENTAL_FEATURES "Enable experimental features" OFF) > +SET_AND_EXPOSE_TO_BUILD(ENABLE_EXPERIMENTAL_FEATURES ${ENABLE_EXPERIMENTAL_FEATURES}) > + Why are you moving all these lines, is this needed for this change? > LayoutTests/imported/w3c/ChangeLog:14 > + The tests still have some failures because sideways writing modes have > + not been implemented yet. Is there any bug about this? Otherwise it'd be nice to report it and link it from here for future reference. > LayoutTests/platform/mac/TestExpectations:1773 > +# These tests need the ENABLE_CSS_LOGICAL compile flag. > +imported/w3c/web-platform-tests/css/css-logical/logical-box-border-style.html [ Skip ] > +imported/w3c/web-platform-tests/css/css-logical/logical-box-margin.html [ Skip ] > +imported/w3c/web-platform-tests/css/css-logical/logical-box-border-color.html [ Skip ] > +imported/w3c/web-platform-tests/css/css-logical/logical-box-border-shorthands.html [ Skip ] > +imported/w3c/web-platform-tests/css/css-logical/logical-box-padding.html [ Skip ] > +imported/w3c/web-platform-tests/css/css-logical/logical-box-border-width.html [ Skip ] So the tests are skip in Mac? Why? What happens in other platforms?
Oriol Brufau
Comment 52 2018-09-11 11:44:43 PDT
Comment on attachment 349335 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=349335&action=review >> Source/WebCore/css/CSSComputedStyleDeclaration.cpp:3884 >> + return nullptr; > > Does this ever happens? Wouldn't be enough with an ASSERT() here? Yes, it happens e.g. if you have `style.cssText = "border-block-start: 1px solid blue; border-block-end: 2px dotted green"`. Then `style.borderBlock` can't be serialized. >> Source/WebCore/css/parser/CSSPropertyParser.cpp:-4936 >> - addExpandedPropertyForValue(CSSPropertyBorderImage, CSSValuePool::singleton().createImplicitInitialValue(), important); > > Why are you removing this line? Is it right? I'm moving it into the `case CSSPropertyBorder`. Yes, it's right because border-image should not be reset by border-block nor border-inline. See https://github.com/w3c/csswg-drafts/issues/2874 I did the same for Blink. >> Source/WebCore/css/parser/CSSPropertyParser.cpp:4942 >> + if (!end) > > Nit: I'd use "if (endImplicit)" here. OK >> Source/WebCore/css/parser/CSSPropertyParser.cpp:5683 >> + addExpandedPropertyForValue(CSSPropertyBorderInlineColor, color.releaseNonNull(), important); > > What happens wiht CSSPropertyBorderImage? Shouldn't be reset by border-inline, https://github.com/w3c/csswg-drafts/issues/2874 >> Source/cmake/WebKitFeatures.cmake:178 >> + > > Why are you moving all these lines, is this needed for this change? Because ENABLE_EXPERIMENTAL_FEATURES was set at the bottom. In order to set ENABLE_CSS_LOGICAL to ENABLE_EXPERIMENTAL_FEATURES, ENABLE_EXPERIMENTAL_FEATURES needs to appear earlier. But ENABLE_EXPERIMENTAL_FEATURES depends on various things, which also need to be moved. >> LayoutTests/imported/w3c/ChangeLog:14 >> + not been implemented yet. > > Is there any bug about this? Otherwise it'd be nice to report it and link it from here for future reference. https://bugs.webkit.org/show_bug.cgi?id=166941 >> LayoutTests/platform/mac/TestExpectations:1773 >> +imported/w3c/web-platform-tests/css/css-logical/logical-box-border-width.html [ Skip ] > > So the tests are skip in Mac? Why? What happens in other platforms? Otherwise EWS for Mac fail, probably because ENABLE_EXPERIMENTAL_FEATURES is false. In other platforms EWS seem OK.
Oriol Brufau
Comment 53 2018-09-12 17:21:03 PDT Comment hidden (obsolete)
Oriol Brufau
Comment 54 2018-09-13 11:49:55 PDT Comment hidden (obsolete)
Oriol Brufau
Comment 55 2018-09-21 08:23:58 PDT Comment hidden (obsolete)
Oriol Brufau
Comment 56 2018-09-21 08:45:27 PDT Comment hidden (obsolete)
Simon Fraser (smfr)
Comment 57 2018-09-24 16:05:44 PDT
Comment on attachment 350367 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=350367&action=review > Source/JavaScriptCore/Configurations/FeatureDefines.xcconfig:91 > +ENABLE_CSS_LOGICAL = ENABLE_EXPERIMENTAL_FEATURES; I would prefer this be called ENABLE_CSS_LOGICAL_PROPERTIES. Otherwise, the reader asks "enable CSS logical what?". > Source/WebCore/css/CSSComputedStyleDeclaration.cpp:4235 > + if (showEnd) You could just do if (!compareCSSValuePtr(startValue, endValue)) here. > Source/WebCore/css/StyleProperties.cpp:414 > + // All components are "initial" and start is not implicit. This comment duplicates the previous line of code. > Source/WebCore/css/StyleProperties.cpp:424 > + if (showEnd) { if (!start.value()->equals(*end.value())) > Source/WebCore/css/StyleProperties.cpp:1067 > + if (!borderBlockFallbackShorthandProperty) > + borderBlockFallbackShorthandProperty = CSSPropertyBorderBlockColor; > + // FIXME: Deal with cases where only some of border-block-(start|end) are specified. > + ASSERT(CSSPropertyBorderBlock - firstCSSProperty < shorthandPropertyAppeared.size()); > + if (!shorthandPropertyAppeared[CSSPropertyBorderBlock - firstCSSProperty]) { > + value = borderPropertyValue(borderBlockWidthShorthand(), borderBlockStyleShorthand(), borderBlockColorShorthand()); > + if (value.isNull()) > + shorthandPropertyAppeared.set(CSSPropertyBorderBlock - firstCSSProperty); > + else > + shorthandPropertyID = CSSPropertyBorderBlock; > + } else if (shorthandPropertyUsed[CSSPropertyBorderBlock - firstCSSProperty]) > + shorthandPropertyID = CSSPropertyBorderBlock; > + if (!shorthandPropertyID) > + shorthandPropertyID = borderBlockFallbackShorthandProperty; This is complicated enough that maybe it can move into a separate function. > Source/WebCore/css/StyleProperties.cpp:1094 > + if (!borderInlineFallbackShorthandProperty) > + borderInlineFallbackShorthandProperty = CSSPropertyBorderInlineColor; > + // FIXME: Deal with cases where only some of border-inline-(start|end) are specified. > + ASSERT(CSSPropertyBorderInline - firstCSSProperty < shorthandPropertyAppeared.size()); > + if (!shorthandPropertyAppeared[CSSPropertyBorderInline - firstCSSProperty]) { > + value = borderPropertyValue(borderInlineWidthShorthand(), borderInlineStyleShorthand(), borderInlineColorShorthand()); > + if (value.isNull()) > + shorthandPropertyAppeared.set(CSSPropertyBorderInline - firstCSSProperty); > + else > + shorthandPropertyID = CSSPropertyBorderInline; > + } else if (shorthandPropertyUsed[CSSPropertyBorderInline - firstCSSProperty]) > + shorthandPropertyID = CSSPropertyBorderInline; > + if (!shorthandPropertyID) > + shorthandPropertyID = borderInlineFallbackShorthandProperty; Ditto. > Source/WebCore/css/parser/CSSPropertyParser.h:69 > + bool consume2Values(const StylePropertyShorthand&, bool important); I would call this consume2ValueShorthand() > Source/WebCore/css/parser/CSSPropertyParser.h:70 > bool consume4Values(const StylePropertyShorthand&, bool important); And rename this accordingly.
Oriol Brufau
Comment 58 2018-09-24 16:19:55 PDT
Comment on attachment 350367 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=350367&action=review >> Source/JavaScriptCore/Configurations/FeatureDefines.xcconfig:91 >> +ENABLE_CSS_LOGICAL = ENABLE_EXPERIMENTAL_FEATURES; > > I would prefer this be called ENABLE_CSS_LOGICAL_PROPERTIES. Otherwise, the reader asks "enable CSS logical what?". My idea was that this flag could be reused for CSS logical values. Do you prefer a separate flag for that?
Simon Fraser (smfr)
Comment 59 2018-09-24 16:26:22 PDT
(In reply to Oriol Brufau from comment #58) > Comment on attachment 350367 [details] > Patch > > View in context: > https://bugs.webkit.org/attachment.cgi?id=350367&action=review > > >> Source/JavaScriptCore/Configurations/FeatureDefines.xcconfig:91 > >> +ENABLE_CSS_LOGICAL = ENABLE_EXPERIMENTAL_FEATURES; > > > > I would prefer this be called ENABLE_CSS_LOGICAL_PROPERTIES. Otherwise, the reader asks "enable CSS logical what?". > > My idea was that this flag could be reused for CSS logical values. Do you > prefer a separate flag for that? I see. I guess it does match the spec short name so maybe it's OK.
Simon Fraser (smfr)
Comment 60 2018-09-24 16:27:35 PDT
(In reply to Oriol Brufau from comment #52) > Otherwise EWS for Mac fail, probably because ENABLE_EXPERIMENTAL_FEATURES is > false. > In other platforms EWS seem OK. macOS is our primary testing platform, so it's bad to disable the tests there. You probably need to have the tests enable the experimental feature explicitly (see webkit-dev discussion)
Oriol Brufau
Comment 61 2018-09-25 10:47:46 PDT Comment hidden (obsolete)
Oriol Brufau
Comment 62 2018-09-25 11:12:49 PDT
(In reply to Simon Fraser (smfr) from comment #57) > This is complicated enough that maybe it can move into a separate function. It needs to access various local variables, so instead of creating a separate function with lots of parameters I created a lambda function. (In reply to Simon Fraser (smfr) from comment #59) > I see. I guess it does match the spec short name so maybe it's OK. OK, I have left this as-is and addressed your other suggestions from comment #57. (In reply to Simon Fraser (smfr) from comment #60) > macOS is our primary testing platform, so it's bad to disable the tests > there. You probably need to have the tests enable the experimental feature > explicitly (see webkit-dev discussion) Can you link that discussion? In https://lists.webkit.org/pipermail/webkit-dev/2018-August/030094.html you said "Right, sorry. I don't think we have a way to do that." Then Michael Catanzaro said I could try setting the flags to ENABLE_EXPERIMENTAL_FEATURES which is what I did, but it seems that's false for Mac EWS. More recently there has been this thread about Internal feature flags: https://lists.webkit.org/pipermail/webkit-dev/2018-September/030123.html But as far as I understand these are runtime flags.
Oriol Brufau
Comment 63 2018-10-17 12:19:06 PDT Comment hidden (obsolete)
Oriol Brufau
Comment 64 2018-10-17 12:25:19 PDT
(In reply to Simon Fraser (smfr) from comment #60) > macOS is our primary testing platform, so it's bad to disable the tests > there. Instead of a compile flag, I have switched to a runtime flag so that the tests don't need to be skipped. I have added code to properly hide CSS properties behind runtime flags (except in cssText, which will need bug 190496), and I have added tests about this. Do the changes look good?
Oriol Brufau
Comment 65 2018-10-17 13:18:20 PDT Comment hidden (obsolete)
EWS Watchlist
Comment 66 2018-10-17 16:02:02 PDT Comment hidden (obsolete)
EWS Watchlist
Comment 67 2018-10-17 16:02:14 PDT Comment hidden (obsolete)
Oriol Brufau
Comment 68 2018-10-17 16:30:33 PDT Comment hidden (obsolete)
Oriol Brufau
Comment 69 2018-10-17 16:37:23 PDT
Comment on attachment 352658 [details] Archive of layout-test-results from ews202 for win-future I added a test with lists all exposed CSS properties in order to check that disabled ones don't appear there. But it seems different platforms can have different properties so I may need to rethink this. The clang compile error should be fixed now, let's see what EWS say about other platforms.
EWS Watchlist
Comment 70 2018-10-17 17:40:54 PDT Comment hidden (obsolete)
EWS Watchlist
Comment 71 2018-10-17 17:40:57 PDT Comment hidden (obsolete)
EWS Watchlist
Comment 72 2018-10-17 18:12:00 PDT Comment hidden (obsolete)
EWS Watchlist
Comment 73 2018-10-17 18:12:02 PDT Comment hidden (obsolete)
EWS Watchlist
Comment 74 2018-10-17 18:50:30 PDT Comment hidden (obsolete)
EWS Watchlist
Comment 75 2018-10-17 18:50:32 PDT Comment hidden (obsolete)
EWS Watchlist
Comment 76 2018-10-17 19:27:50 PDT Comment hidden (obsolete)
EWS Watchlist
Comment 77 2018-10-17 19:28:02 PDT Comment hidden (obsolete)
EWS Watchlist
Comment 78 2018-10-17 19:42:10 PDT Comment hidden (obsolete)
EWS Watchlist
Comment 79 2018-10-17 19:42:13 PDT Comment hidden (obsolete)
EWS Watchlist
Comment 80 2018-10-17 21:39:28 PDT Comment hidden (obsolete)
EWS Watchlist
Comment 81 2018-10-17 21:39:30 PDT Comment hidden (obsolete)
Oriol Brufau
Comment 82 2018-10-18 12:27:52 PDT Comment hidden (obsolete)
Oriol Brufau
Comment 83 2018-10-18 12:56:41 PDT Comment hidden (obsolete)
EWS Watchlist
Comment 84 2018-10-18 14:07:04 PDT Comment hidden (obsolete)
EWS Watchlist
Comment 85 2018-10-18 14:07:06 PDT Comment hidden (obsolete)
Oriol Brufau
Comment 86 2018-10-18 17:00:50 PDT Comment hidden (obsolete)
Oriol Brufau
Comment 87 2018-10-19 07:56:35 PDT Comment hidden (obsolete)
EWS Watchlist
Comment 88 2018-10-19 08:58:06 PDT Comment hidden (obsolete)
EWS Watchlist
Comment 89 2018-10-19 08:58:09 PDT Comment hidden (obsolete)
EWS Watchlist
Comment 90 2018-10-19 10:12:22 PDT Comment hidden (obsolete)
EWS Watchlist
Comment 91 2018-10-19 10:12:25 PDT Comment hidden (obsolete)
Oriol Brufau
Comment 92 2018-10-31 14:19:42 PDT Comment hidden (obsolete)
EWS Watchlist
Comment 93 2018-10-31 15:23:17 PDT Comment hidden (obsolete)
EWS Watchlist
Comment 94 2018-10-31 15:23:20 PDT Comment hidden (obsolete)
Oriol Brufau
Comment 95 2018-10-31 15:26:06 PDT Comment hidden (obsolete)
Oriol Brufau
Comment 96 2018-11-02 09:43:59 PDT
Comment on attachment 353540 [details] Patch Finally EWS is green. Requesting review. Simon Fraser already approved the code for the logical shorthands, so only the code related with runtime flags needs to be reviewed.
Manuel Rego Casasnovas
Comment 97 2018-11-09 01:24:48 PST
r=me This is really nice, we never had support to disable CSS properties from runtime flags so this is great. Simon already approved the CSS changes in the previous version using compile flags, so that part should be fine already. The rest of the patch LGTM but mabye someone wants to review the changes in CSSProperties.json and makepprop.pl, as I'm not an expert on those. Adding some people on CC just in case they want to take a look. Thanks!
Antti Koivisto
Comment 98 2018-11-14 22:47:44 PST
Comment on attachment 353540 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=353540&action=review r=me, looks good > Source/WebCore/css/CSSStyleDeclaration.cpp:244 > + CSSPropertyID id = static_cast<CSSPropertyID>(propertyID); Could be auto > Source/WebCore/css/StyleProperties.cpp:390 > + return String(); return { }; (some other places too) > Source/WebCore/css/StyleProperties.cpp:393 > + PropertyReference start = propertyAt(startValueIndex); > + PropertyReference end = propertyAt(endValueIndex); auto > Source/WebCore/css/parser/CSSPropertyParser.cpp:150 > + CSSPropertyID propertyID = static_cast<CSSPropertyID>(hashTableEntry->id); auto
Oriol Brufau
Comment 99 2018-11-15 07:58:18 PST Comment hidden (obsolete)
EWS Watchlist
Comment 100 2018-11-15 08:56:41 PST Comment hidden (obsolete)
EWS Watchlist
Comment 101 2018-11-15 08:56:44 PST Comment hidden (obsolete)
EWS Watchlist
Comment 102 2018-11-15 09:20:00 PST Comment hidden (obsolete)
EWS Watchlist
Comment 103 2018-11-15 09:20:03 PST Comment hidden (obsolete)
EWS Watchlist
Comment 104 2018-11-15 09:52:28 PST Comment hidden (obsolete)
EWS Watchlist
Comment 105 2018-11-15 09:52:41 PST Comment hidden (obsolete)
EWS Watchlist
Comment 106 2018-11-15 09:52:45 PST Comment hidden (obsolete)
EWS Watchlist
Comment 107 2018-11-15 09:52:47 PST Comment hidden (obsolete)
EWS Watchlist
Comment 108 2018-11-15 10:41:49 PST Comment hidden (obsolete)
EWS Watchlist
Comment 109 2018-11-15 10:41:52 PST Comment hidden (obsolete)
Oriol Brufau
Comment 110 2018-11-15 11:40:08 PST
Oriol Brufau
Comment 111 2018-11-15 11:43:31 PST
I have updated the expectations for the list of enabled CSS properties, now EWS should be green.
WebKit Commit Bot
Comment 112 2018-11-15 13:15:36 PST
Comment on attachment 354961 [details] Patch Clearing flags on attachment: 354961 Committed r238244: <https://trac.webkit.org/changeset/238244>
WebKit Commit Bot
Comment 113 2018-11-15 13:15:40 PST
All reviewed patches have been landed. Closing bug.
Radar WebKit Bug Importer
Comment 114 2018-11-15 13:17:08 PST
Truitt Savell
Comment 115 2018-11-15 17:02:08 PST
Looks like the changes in https://trac.webkit.org/changeset/238244/webkit has caused all high Sierra test runs to fail early with 50 crashes and caused 25 api failures. This is isolated to only High Sierra which is why EWS did not catch it. Build: https://build.webkit.org/builders/Apple%20High%20Sierra%20Release%20WK1%20(Tests)/builds/9301 log from a Crash: https://build.webkit.org/results/Apple%20High%20Sierra%20Release%20WK1%20(Tests)/r238245%20(9301)/accessibility/aria-hidden-hides-all-elements-crash-log.txt The traceback contains CSS related files which point towards this revisions changes.
Truitt Savell
Comment 116 2018-11-15 17:07:47 PST
Reverted r238244 for reason: Caused High Sierra test runs to fail early with 50 crashes and casued 25 API failures. Committed r238262: <https://trac.webkit.org/changeset/238262>
Oriol Brufau
Comment 117 2019-01-21 10:34:59 PST
Oriol Brufau
Comment 118 2019-01-21 10:38:50 PST
I have removed the webexposed tests that listed all CSS properties since each platform has different expectations and it's a mess. The crash seemed unrelated, let's try to land again.
Manuel Rego Casasnovas
Comment 119 2019-01-22 01:26:24 PST
Comment on attachment 359698 [details] Patch Ok, let's see re-land this and watch to bots to see if the crash appears again.
WebKit Commit Bot
Comment 120 2019-01-22 01:52:54 PST
Comment on attachment 359698 [details] Patch Clearing flags on attachment: 359698 Committed r240251: <https://trac.webkit.org/changeset/240251>
WebKit Commit Bot
Comment 121 2019-01-22 01:52:58 PST
All reviewed patches have been landed. Closing bug.
Michael Catanzaro
Comment 122 2019-01-22 16:37:35 PST
Note You need to log in before you can comment on or make changes to this bug.