|
|
Created:
6 years, 10 months ago by eseidel Modified:
6 years, 9 months ago Reviewers:
abarth-chromium CC:
blink-reviews, dglazkov, rune+blink, apavlov+blink_chromium.org, ed+blinkwatch_opera.com, darktears, alancutter (OOO until 2018) Base URL:
svn://svn.chromium.org/blink/trunk Visibility:
Public. |
DescriptionMove almost all of CSSPropertyParser into CSSPropertyParser.cpp
This moves 8200 lines out of BisonCSSParser leaving only 1700 lines left. :)
When I split CSSPropertyParser from BisonCSSParser I left
all the code in BisonCSSParser-in.cpp to make the diff
small and to avoid conflicting with others changes.
Now I'm moving (almost) all of CSSPropertyParser into the
correct .cpp file.
The only bit left is some transform parsing code which uses
the -in.cpp preprocessor bits of BisonCSSParser. Its
the only code which uses this fancy SWITCH/CASE preprocessor
and should just be moved out into its own file.
BUG=330389
R=abarth@chromium.org
TBR=abarth
Committed: https://src.chromium.org/viewvc/blink?view=rev&revision=167440
Patch Set 1 #Patch Set 2 : Adds comment #Patch Set 3 : Update to ignore oilpan conflict #Patch Set 4 : try again #
Messages
Total messages: 23 (0 generated)
I'm going to TBR this as it will go stale extremely quickly.
The CQ bit was checked by eseidel@chromium.org
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/eseidel@chromium.org/171233004/50001
The CQ bit was unchecked by commit-bot@chromium.org
Retried try job too often on mac_blink_rel for step(s) blink_heap_unittests, blink_platform_unittests, webkit_lint, webkit_python_tests, webkit_tests, webkit_unit_tests, wtf_unittests http://build.chromium.org/p/tryserver.chromium/buildstatus?builder=mac_blink_...
LGTM assuming this is just moving code. I didn't validate that. :)
The CQ bit was checked by abarth@chromium.org
The CQ bit was unchecked by eseidel@chromium.org
The CQ bit was checked by eseidel@chromium.org
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/eseidel@chromium.org/171233004/50001
The CQ bit was unchecked by commit-bot@chromium.org
Failed to apply patch for Source/core/css/parser/BisonCSSParser-in.cpp: While running patch -p1 --forward --force --no-backup-if-mismatch; patching file Source/core/css/parser/BisonCSSParser-in.cpp Hunk #7 FAILED at 765. 1 out of 8 hunks FAILED -- saving rejects to file Source/core/css/parser/BisonCSSParser-in.cpp.rej Patch: Source/core/css/parser/BisonCSSParser-in.cpp Index: Source/core/css/parser/BisonCSSParser-in.cpp diff --git a/Source/core/css/parser/BisonCSSParser-in.cpp b/Source/core/css/parser/BisonCSSParser-in.cpp index e68cd2dacb87083f3ecc39ef7cf3a20181223157..e57ceac5e0c0f75db22a6e8651d5d41b8ce4364b 100644 --- a/Source/core/css/parser/BisonCSSParser-in.cpp +++ b/Source/core/css/parser/BisonCSSParser-in.cpp @@ -28,52 +28,20 @@ #include "core/css/parser/BisonCSSParser.h" #include "CSSValueKeywords.h" -#include "RuntimeEnabledFeatures.h" #include "StylePropertyShorthand.h" -#include "core/css/CSSArrayFunctionValue.h" -#include "core/css/CSSAspectRatioValue.h" -#include "core/css/CSSBasicShapes.h" -#include "core/css/CSSBorderImage.h" -#include "core/css/CSSCanvasValue.h" -#include "core/css/CSSCrossfadeValue.h" -#include "core/css/CSSCursorImageValue.h" -#include "core/css/CSSFontFaceSrcValue.h" -#include "core/css/CSSFontFeatureValue.h" -#include "core/css/CSSFunctionValue.h" -#include "core/css/CSSGradientValue.h" -#include "core/css/CSSGridLineNamesValue.h" -#include "core/css/CSSGridTemplateAreasValue.h" -#include "core/css/CSSImageSetValue.h" -#include "core/css/CSSImageValue.h" -#include "core/css/CSSInheritedValue.h" -#include "core/css/CSSInitialValue.h" +#include "RuntimeEnabledFeatures.h" #include "core/css/CSSKeyframeRule.h" -#include "core/css/CSSKeyframesRule.h" -#include "core/css/CSSLineBoxContainValue.h" -#include "core/css/CSSPrimitiveValue.h" -#include "core/css/CSSPropertySourceData.h" -#include "core/css/CSSReflectValue.h" -#include "core/css/CSSSVGDocumentValue.h" -#include "core/css/CSSSelector.h" -#include "core/css/CSSShadowValue.h" -#include "core/css/CSSStyleSheet.h" -#include "core/css/CSSTimingFunctionValue.h" -#include "core/css/CSSTransformValue.h" -#include "core/css/CSSUnicodeRangeValue.h" -#include "core/css/CSSValueList.h" -#include "core/css/CSSValuePool.h" -#include "core/css/Counter.h" #include "core/css/HashTools.h" #include "core/css/MediaList.h" #include "core/css/MediaQueryExp.h" -#include "core/css/Pair.h" -#include "core/css/Rect.h" #include "core/css/StylePropertySet.h" #include "core/css/StyleRule.h" #include "core/css/StyleRuleImport.h" #include "core/css/StyleSheetContents.h" +#include "core/css/CSSTransformValue.h" #include "core/css/parser/CSSParserIdioms.h" #include "core/dom/Document.h" +#include "core/css/CSSValuePool.h" #include "core/frame/FrameHost.h" #include "core/frame/PageConsole.h" #include "core/frame/Settings.h" @@ -81,14 +49,11 @@ #include "core/inspector/InspectorInstrumentation.h" #include "core/rendering/RenderTheme.h" #include "core/svg/SVGParserUtilities.h" -#include "platform/FloatConversion.h" #include "wtf/BitArray.h" #include "wtf/HexNumber.h" #include "wtf/text/StringBuffer.h" #include "wtf/text/StringBuilder.h" #include "wtf/text/StringImpl.h" -#include "wtf/text/TextEncoding.h" -#include <limits.h> #define YYDEBUG 0 @@ -104,84 +69,6 @@ using namespace WTF; namespace WebCore { static const unsigned INVALID_NUM_PARSED_PROPERTIES = UINT_MAX; -static const double MAX_SCALE = 1000000; - -template <unsigned N> -static bool equal(const CSSParserString& a, const char (&b)[N]) -{ - unsigned length = N - 1; // Ignore the trailing null character - if (a.length() != length) - return false; - - return a.is8Bit() ? WTF::equal(a.characters8(), reinterpret_cast<const LChar*>(b), length) : WTF::equal(a.characters16(), reinterpret_cast<const LChar*>(b), length); -} - -template <unsigned N> -static bool equalIgnoringCase(const CSSParserString& a, const char (&b)[N]) -{ - unsigned length = N - 1; // Ignore the trailing null character - if (a.length() != length) - return false; - - return a.is8Bit() ? WTF::equalIgnoringCase(b, a.characters8(), length) : WTF::equalIgnoringCase(b, a.characters16(), length); -} - -template <unsigned N> -static bool equalIgnoringCase(CSSParserValue* value, const char (&b)[N]) -{ - ASSERT(value->unit == CSSPrimitiveValue::CSS_IDENT || value->unit == CSSPrimitiveValue::CSS_STRING); - return equalIgnoringCase(value->string, b); -} - -static PassRefPtrWillBeRawPtr<CSSPrimitiveValue> createPrimitiveValuePair(PassRefPtrWillBeRawPtr<CSSPrimitiveValue> first, PassRefPtrWillBeRawPtr<CSSPrimitiveValue> second, Pair::IdenticalValuesPolicy identicalValuesPolicy = Pair::DropIdenticalValues) -{ - return cssValuePool().createValue(Pair::create(first, second, identicalValuesPolicy)); -} - -class AnimationParseContext { -public: - AnimationParseContext() - : m_animationPropertyKeywordAllowed(true) - , m_firstAnimationCommitted(false) - , m_hasSeenAnimationPropertyKeyword(false) - { - } - - void commitFirstAnimation() - { - m_firstAnimationCommitted = true; - } - - bool hasCommittedFirstAnimation() const - { - return m_firstAnimationCommitted; - } - - void commitAnimationPropertyKeyword() - { - m_animationPropertyKeywordAllowed = false; - } - - bool animationPropertyKeywordAllowed() const - { - return m_animationPropertyKeywordAllowed; - } - - bool hasSeenAnimationPropertyKeyword() const - { - return m_hasSeenAnimationPropertyKeyword; - } - - void sawAnimationPropertyKeyword() - { - m_hasSeenAnimationPropertyKeyword = true; - } - -private: - bool m_animationPropertyKeywordAllowed; - bool m_firstAnimationCommitted; - bool m_hasSeenAnimationPropertyKeyword; -}; BisonCSSParser::BisonCSSParser(const CSSParserContext& context) : m_context(context) @@ -441,483 +328,6 @@ static bool parseSimpleLengthValue(MutableStylePropertySet* declaration, CSSProp return true; } -static inline bool isValidKeywordPropertyAndValue(CSSPropertyID propertyId, int valueID, const CSSParserContext& parserContext) -{ - if (!valueID) - return false; - - switch (propertyId) { - case CSSPropertyBorderCollapse: // collapse | separate | inherit - if (valueID == CSSValueCollapse || valueID == CSSValueSeparate) - return true; - break; - case CSSPropertyBorderTopStyle: // <border-style> | inherit - case CSSPropertyBorderRightStyle: // Defined as: none | hidden | dotted | dashed | - case CSSPropertyBorderBottomStyle: // solid | double | groove | ridge | inset | outset - case CSSPropertyBorderLeftStyle: - case CSSPropertyWebkitBorderAfterStyle: - case CSSPropertyWebkitBorderBeforeStyle: - case CSSPropertyWebkitBorderEndStyle: - case CSSPropertyWebkitBorderStartStyle: - case CSSPropertyWebkitColumnRuleStyle: - if (valueID >= CSSValueNone && valueID <= CSSValueDouble) - return true; - break; - case CSSPropertyBoxSizing: - if (valueID == CSSValueBorderBox || valueID == CSSValueContentBox) - return true; - break; - case CSSPropertyCaptionSide: // top | bottom | left | right | inherit - if (valueID == CSSValueLeft || valueID == CSSValueRight || valueID == CSSValueTop || valueID == CSSValueBottom) - return true; - break; - case CSSPropertyClear: // none | left | right | both | inherit - if (valueID == CSSValueNone || valueID == CSSValueLeft || valueID == CSSValueRight || valueID == CSSValueBoth) - return true; - break; - case CSSPropertyDirection: // ltr | rtl | inherit - if (valueID == CSSValueLtr || valueID == CSSValueRtl) - return true; - break; - case CSSPropertyDisplay: - // inline | block | list-item | inline-block | table | - // inline-table | table-row-group | table-header-group | table-footer-group | table-row | - // table-column-group | table-column | table-cell | table-caption | -webkit-box | -webkit-inline-box | none | inherit - // flex | inline-flex | -webkit-flex | -webkit-inline-flex | grid | inline-grid | lazy-block - if ((valueID >= CSSValueInline && valueID <= CSSValueInlineFlex) || valueID == CSSValueWebkitFlex || valueID == CSSValueWebkitInlineFlex || valueID == CSSValueNone) - return true; - if (valueID == CSSValueGrid || valueID == CSSValueInlineGrid) - return RuntimeEnabledFeatures::cssGridLayoutEnabled(); - break; - - case CSSPropertyEmptyCells: // show | hide | inherit - if (valueID == CSSValueShow || valueID == CSSValueHide) - return true; - break; - case CSSPropertyFloat: // left | right | none | center (for buggy CSS, maps to none) - if (valueID == CSSValueLeft || valueID == CSSValueRight || valueID == CSSValueNone || valueID == CSSValueCenter) - return true; - break; - case CSSPropertyFontStyle: // normal | italic | oblique | inherit - if (valueID == CSSValueNormal || valueID == CSSValueItalic || valueID == CSSValueOblique) - return true; - break; - case CSSPropertyImageRendering: // auto | optimizeContrast - if (valueID == CSSValueAuto || valueID == CSSValueWebkitOptimizeContrast) - return true; - break; - case CSSPropertyIsolation: // auto | isolate - if (valueID == CSSValueAuto || valueID == CSSValueIsolate) - return RuntimeEnabledFeatures::cssCompositingEnabled(); - break; - case CSSPropertyListStylePosition: // inside | outside | inherit - if (valueID == CSSValueInside || valueID == CSSValueOutside) - return true; - break; - case CSSPropertyListStyleType: - // See section CSS_PROP_LIST_STYLE_TYPE of file CSSValueKeywords.in - // for… (message too large)
The CQ bit was checked by eseidel@chromium.org
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/eseidel@chromium.org/171233004/210001
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/eseidel@chromium.org/171233004/210001
Message was sent while issue was closed.
Committed patchset #3 manually as r167440 (presubmit successful).
The CQ bit was checked by eseidel@chromium.org
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/eseidel@chromium.org/171233004/300001
The CQ bit was unchecked by commit-bot@chromium.org
Retried try job too often on mac_blink_rel for step(s) blink_heap_unittests, blink_platform_unittests, webkit_lint, webkit_python_tests, webkit_tests, webkit_unit_tests, wtf_unittests http://build.chromium.org/p/tryserver.chromium/buildstatus?builder=mac_blink_...
I'm giving up on this change for now. Really hard to land this via the CQ, since it seems to break mac (likely due to a stray "inline" somewhere which only is noticed by clang or something) and is constantly made out of date by other patches to CSS stuff.
On 2014/02/24 16:32:27, eseidel wrote: > I'm giving up on this change for now. Really hard to land this via the CQ, > since it seems to break mac (likely due to a stray "inline" somewhere which only > is noticed by clang or something) and is constantly made out of date by other > patches to CSS stuff. Since I am not the owner of this CL I could not upload a new patchset, so I moved it to: https://codereview.chromium.org/185293006/ I started from scratch since the patch set 4 above is not rebased. mac_blink_rel is now green and I am running some more trybots...
Thank you, closing. |