Commit 3dd3e056 authored by Guido Urdaneta's avatar Guido Urdaneta Committed by Commit Bot

Revert "Moved parsing logic to property APIs for grouped longhand properties"

This reverts commit 264ba723.

Reason for revert: Speculative revert. Suspect of causing tables/mozilla_expected_failures/marvin/backgr_fixed-bg.html to fail reliably on WebKit Mac10.9 bot.

Sample failed build:
https://build.chromium.org/p/chromium.webkit/builders/WebKit%20Mac10.9/builds/48635

Will reland if it does not fix the problem.

Original change's description:
> Moved parsing logic to property APIs for grouped longhand properties
> 
> This patch:
> - Moved parsing logic to property APIs for the following grouped
>   properties:
>     border-image-repeat
>     border-image-slice
>     border-image-outset
>     border-image-width
>     background-clip
>     background-image
>     background-origin
>     -webkit-transform-origin-x
>     -webkit-transform-origin-y
>    -webkit-perspective-origin-x
>     -webkit-perspective-origin-y
>     -webkit-mask-box-image-repeat
>     -webkit-mask-box-image-slice
>     -webkit-mask-box-image-outset
>     -webkit-mask-box-image-width
>     -webkit-mask-image
> - Replaced the bool literal argument in BorderImageUtils with a
>   new enum class to comply with the style guide
> - Added #includes to PositionUtils that should have been there
>   when the file was created. For some reason this only started
>   causing build errors in this patch
> 
> Bug: 668012
> Change-Id: I796f0967e4222689c14700b12d7726df7ab35170
> Reviewed-on: https://chromium-review.googlesource.com/597378
> Reviewed-by: meade_UTC10 <meade@chromium.org>
> Commit-Queue: Bugs Nash <bugsnash@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#491288}

TBR=meade@chromium.org,bugsnash@chromium.org

Change-Id: I1c6e1a29a52dfb99aaa6cb7fa1f064104fecc91e
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: 668012
Reviewed-on: https://chromium-review.googlesource.com/597888Reviewed-by: default avatarGuido Urdaneta <guidou@chromium.org>
Commit-Queue: Guido Urdaneta <guidou@chromium.org>
Cr-Commit-Position: refs/heads/master@{#491346}
parent 2186d4cb
......@@ -486,8 +486,6 @@ code_generator("make_core_generated_css_property_apis") {
"$blink_core_output_dir/css/properties/CSSPropertyAPIAutoOrString.h",
"$blink_core_output_dir/css/properties/CSSPropertyAPIBackgroundAttachment.h",
"$blink_core_output_dir/css/properties/CSSPropertyAPIBackgroundBlendMode.h",
"$blink_core_output_dir/css/properties/CSSPropertyAPIBackgroundBox.h",
"$blink_core_output_dir/css/properties/CSSPropertyAPIBackgroundOrMaskImage.h",
"$blink_core_output_dir/css/properties/CSSPropertyAPIBaselineShift.h",
"$blink_core_output_dir/css/properties/CSSPropertyAPIBorderColor.h",
"$blink_core_output_dir/css/properties/CSSPropertyAPIBorderImageOutset.h",
......@@ -513,8 +511,6 @@ code_generator("make_core_generated_css_property_apis") {
"$blink_core_output_dir/css/properties/CSSPropertyAPICounterReset.h",
"$blink_core_output_dir/css/properties/CSSPropertyAPICursor.h",
"$blink_core_output_dir/css/properties/CSSPropertyAPID.h",
"$blink_core_output_dir/css/properties/CSSPropertyAPIDelay.h",
"$blink_core_output_dir/css/properties/CSSPropertyAPIDuration.h",
"$blink_core_output_dir/css/properties/CSSPropertyAPIFilter.h",
"$blink_core_output_dir/css/properties/CSSPropertyAPIFlexBasis.h",
"$blink_core_output_dir/css/properties/CSSPropertyAPIFlexGrowOrShrink.h",
......@@ -531,7 +527,6 @@ code_generator("make_core_generated_css_property_apis") {
"$blink_core_output_dir/css/properties/CSSPropertyAPIFragmentation.h",
"$blink_core_output_dir/css/properties/CSSPropertyAPIGridAutoFlow.h",
"$blink_core_output_dir/css/properties/CSSPropertyAPIGridAutoLine.h",
"$blink_core_output_dir/css/properties/CSSPropertyAPIGridGap.h",
"$blink_core_output_dir/css/properties/CSSPropertyAPIGridLine.h",
"$blink_core_output_dir/css/properties/CSSPropertyAPIGridTemplateAreas.h",
"$blink_core_output_dir/css/properties/CSSPropertyAPIGridTemplateLine.h",
......@@ -584,7 +579,6 @@ code_generator("make_core_generated_css_property_apis") {
"$blink_core_output_dir/css/properties/CSSPropertyAPITextShadow.h",
"$blink_core_output_dir/css/properties/CSSPropertyAPITextSizeAdjust.h",
"$blink_core_output_dir/css/properties/CSSPropertyAPITextUnderlinePosition.h",
"$blink_core_output_dir/css/properties/CSSPropertyAPITimingFunction.h",
"$blink_core_output_dir/css/properties/CSSPropertyAPITouchAction.h",
"$blink_core_output_dir/css/properties/CSSPropertyAPITransform.h",
"$blink_core_output_dir/css/properties/CSSPropertyAPITransformOrigin.h",
......
......@@ -383,8 +383,6 @@ blink_core_sources("css") {
"properties/CSSPropertyAPIAutoOrString.cpp",
"properties/CSSPropertyAPIBackgroundAttachment.cpp",
"properties/CSSPropertyAPIBackgroundBlendMode.cpp",
"properties/CSSPropertyAPIBackgroundBox.cpp",
"properties/CSSPropertyAPIBackgroundOrMaskImage.cpp",
"properties/CSSPropertyAPIBaselineShift.cpp",
"properties/CSSPropertyAPIBorderColor.cpp",
"properties/CSSPropertyAPIBorderImageOutset.cpp",
......@@ -410,8 +408,6 @@ blink_core_sources("css") {
"properties/CSSPropertyAPICounterReset.cpp",
"properties/CSSPropertyAPICursor.cpp",
"properties/CSSPropertyAPID.cpp",
"properties/CSSPropertyAPIDelay.cpp",
"properties/CSSPropertyAPIDuration.cpp",
"properties/CSSPropertyAPIFilter.cpp",
"properties/CSSPropertyAPIFlexBasis.cpp",
"properties/CSSPropertyAPIFlexGrowOrShrink.cpp",
......@@ -429,7 +425,6 @@ blink_core_sources("css") {
"properties/CSSPropertyAPIFragmentation.cpp",
"properties/CSSPropertyAPIGridAutoFlow.cpp",
"properties/CSSPropertyAPIGridAutoLine.cpp",
"properties/CSSPropertyAPIGridGap.cpp",
"properties/CSSPropertyAPIGridLine.cpp",
"properties/CSSPropertyAPIGridTemplateAreas.cpp",
"properties/CSSPropertyAPIGridTemplateLine.cpp",
......@@ -482,7 +477,6 @@ blink_core_sources("css") {
"properties/CSSPropertyAPITextShadow.cpp",
"properties/CSSPropertyAPITextSizeAdjust.cpp",
"properties/CSSPropertyAPITextUnderlinePosition.cpp",
"properties/CSSPropertyAPITimingFunction.cpp",
"properties/CSSPropertyAPITouchAction.cpp",
"properties/CSSPropertyAPITransform.cpp",
"properties/CSSPropertyAPITransformOrigin.cpp",
......
......@@ -319,8 +319,6 @@
// Animation Priority properties
{
name: "animation-delay",
api_class: "CSSPropertyAPIDelay",
api_methods: ["parseSingleValue"],
custom_all: true,
priority: "Animation",
},
......@@ -335,8 +333,6 @@
},
{
name: "animation-duration",
api_class: "CSSPropertyAPIDuration",
api_methods: ["parseSingleValue"],
custom_all: true,
priority: "Animation",
},
......@@ -372,22 +368,16 @@
},
{
name: "animation-timing-function",
api_class: "CSSPropertyAPITimingFunction",
api_methods: ["parseSingleValue"],
custom_all: true,
priority: "Animation",
},
{
name: "transition-delay",
api_class: "CSSPropertyAPIDelay",
api_methods: ["parseSingleValue"],
custom_all: true,
priority: "Animation",
},
{
name: "transition-duration",
api_class: "CSSPropertyAPIDuration",
api_methods: ["parseSingleValue"],
custom_all: true,
priority: "Animation",
},
......@@ -400,8 +390,6 @@
},
{
name: "transition-timing-function",
api_class: "CSSPropertyAPITimingFunction",
api_methods: ["parseSingleValue"],
custom_all: true,
priority: "Animation",
},
......@@ -710,8 +698,6 @@
},
{
name: "background-clip",
api_class: "CSSPropertyAPIBackgroundBox",
api_methods: ["parseSingleValue"],
custom_all: true,
},
{
......@@ -729,8 +715,6 @@
},
{
name: "background-image",
api_class: "CSSPropertyAPIBackgroundOrMaskImage",
api_methods: ["parseSingleValue"],
custom_all: true,
interpolable: true,
keywords: ["auto", "none"],
......@@ -738,8 +722,6 @@
},
{
name: "background-origin",
api_class: "CSSPropertyAPIBackgroundBox",
api_methods: ["parseSingleValue"],
custom_all: true,
},
{
......@@ -844,20 +826,17 @@
{
name: "border-image-outset",
api_class: "CSSPropertyAPIBorderImageOutset",
api_methods: ["parseSingleValue"],
custom_all: true,
interpolable: true,
},
{
name: "border-image-repeat",
api_class: "CSSPropertyAPIBorderImageRepeat",
api_methods: ["parseSingleValue"],
custom_all: true,
},
{
name: "border-image-slice",
api_class: "CSSPropertyAPIBorderImageSlice",
api_methods: ["parseSingleValue"],
custom_all: true,
interpolable: true,
},
......@@ -873,7 +852,6 @@
{
name: "border-image-width",
api_class: "CSSPropertyAPIBorderImageWidth",
api_methods: ["parseSingleValue"],
custom_all: true,
interpolable: true,
},
......@@ -1412,8 +1390,6 @@
},
{
name: "grid-column-gap",
api_class: "CSSPropertyAPIGridGap",
api_methods: ["parseSingleValue"],
converter: "ConvertLength",
runtime_flag: "CSSGridLayout",
field_template: "<length>",
......@@ -1444,8 +1420,6 @@
},
{
name: "grid-row-gap",
api_class: "CSSPropertyAPIGridGap",
api_methods: ["parseSingleValue"],
converter: "ConvertLength",
runtime_flag: "CSSGridLayout",
field_template: "<length>",
......@@ -3162,20 +3136,17 @@
{
name: "-webkit-mask-box-image-outset",
api_class: "CSSPropertyAPIBorderImageOutset",
api_methods: ["parseSingleValue"],
custom_all: true,
interpolable: true,
},
{
name: "-webkit-mask-box-image-repeat",
api_class: "CSSPropertyAPIBorderImageRepeat",
api_methods: ["parseSingleValue"],
custom_all: true,
},
{
name: "-webkit-mask-box-image-slice",
api_class: "CSSPropertyAPIBorderImageSlice",
api_methods: ["parseSingleValue"],
custom_all: true,
interpolable: true,
},
......@@ -3189,7 +3160,6 @@
{
name: "-webkit-mask-box-image-width",
api_class: "CSSPropertyAPIBorderImageWidth",
api_methods: ["parseSingleValue"],
custom_all: true,
interpolable: true,
},
......@@ -3205,8 +3175,6 @@
},
{
name: "-webkit-mask-image",
api_class: "CSSPropertyAPIBackgroundOrMaskImage",
api_methods: ["parseSingleValue"],
custom_all: true,
interpolable: true,
},
......@@ -3242,14 +3210,12 @@
{
name: "-webkit-perspective-origin-x",
api_class: "CSSPropertyAPIWebkitOriginX",
api_methods: ["parseSingleValue"],
converter: "ConvertLength",
interpolable: true,
},
{
name: "-webkit-perspective-origin-y",
api_class: "CSSPropertyAPIWebkitOriginY",
api_methods: ["parseSingleValue"],
converter: "ConvertLength",
interpolable: true,
},
......@@ -3373,14 +3339,12 @@
{
name: "-webkit-transform-origin-x",
api_class: "CSSPropertyAPIWebkitOriginX",
api_methods: ["parseSingleValue"],
converter: "ConvertLength",
interpolable: true,
},
{
name: "-webkit-transform-origin-y",
api_class: "CSSPropertyAPIWebkitOriginY",
api_methods: ["parseSingleValue"],
converter: "ConvertLength",
interpolable: true,
},
......
......@@ -304,6 +304,11 @@ static CSSValue* ConsumeFontVariantList(CSSParserTokenRange& range) {
return nullptr;
}
static CSSValue* ConsumeBackgroundBox(CSSParserTokenRange& range) {
return ConsumeIdent<CSSValueBorderBox, CSSValuePaddingBox,
CSSValueContentBox>(range);
}
static CSSValue* ConsumePrefixedBackgroundBox(CSSParserTokenRange& range,
const CSSParserContext* context,
bool allow_text_value) {
......@@ -351,13 +356,13 @@ static CSSValue* ConsumeBackgroundComponent(CSSPropertyID unresolved_property,
const CSSParserContext* context) {
switch (unresolved_property) {
case CSSPropertyBackgroundClip:
return CSSPropertyBackgroundUtils::ConsumeBackgroundBox(range);
return ConsumeBackgroundBox(range);
case CSSPropertyBackgroundBlendMode:
return CSSPropertyBackgroundUtils::ConsumeBackgroundBlendMode(range);
case CSSPropertyBackgroundAttachment:
return CSSPropertyBackgroundUtils::ConsumeBackgroundAttachment(range);
case CSSPropertyBackgroundOrigin:
return CSSPropertyBackgroundUtils::ConsumeBackgroundBox(range);
return ConsumeBackgroundBox(range);
case CSSPropertyWebkitMaskComposite:
return CSSPropertyBackgroundUtils::ConsumeBackgroundComposite(range);
case CSSPropertyMaskSourceType:
......@@ -667,10 +672,55 @@ const CSSValue* CSSPropertyParser::ParseSingleValue(
case CSSPropertyWebkitLogicalWidth:
case CSSPropertyWebkitLogicalHeight:
return CSSPropertyLengthUtils::ConsumeWidthOrHeight(range_, *context_);
case CSSPropertyAnimationDelay:
case CSSPropertyTransitionDelay:
return ConsumeCommaSeparatedList(ConsumeTime, range_, kValueRangeAll);
case CSSPropertyAnimationDuration:
case CSSPropertyTransitionDuration:
return ConsumeCommaSeparatedList(ConsumeTime, range_,
kValueRangeNonNegative);
case CSSPropertyAnimationTimingFunction:
case CSSPropertyTransitionTimingFunction:
return ConsumeCommaSeparatedList(CSSPropertyAnimationTimingFunctionUtils::
ConsumeAnimationTimingFunction,
range_);
case CSSPropertyGridColumnGap:
case CSSPropertyGridRowGap:
return ConsumeLengthOrPercent(range_, context_->Mode(),
kValueRangeNonNegative);
case CSSPropertyTextDecoration:
DCHECK(!RuntimeEnabledFeatures::CSS3TextDecorationsEnabled());
return CSSPropertyTextDecorationLineUtils::ConsumeTextDecorationLine(
range_);
case CSSPropertyWebkitTransformOriginX:
case CSSPropertyWebkitPerspectiveOriginX:
return CSSPropertyPositionUtils::ConsumePositionLonghand<CSSValueLeft,
CSSValueRight>(
range_, context_->Mode());
case CSSPropertyWebkitTransformOriginY:
case CSSPropertyWebkitPerspectiveOriginY:
return CSSPropertyPositionUtils::ConsumePositionLonghand<CSSValueTop,
CSSValueBottom>(
range_, context_->Mode());
case CSSPropertyBorderImageRepeat:
case CSSPropertyWebkitMaskBoxImageRepeat:
return CSSPropertyBorderImageUtils::ConsumeBorderImageRepeat(range_);
case CSSPropertyBorderImageSlice:
case CSSPropertyWebkitMaskBoxImageSlice:
return CSSPropertyBorderImageUtils::ConsumeBorderImageSlice(
range_, false /* default_fill */);
case CSSPropertyBorderImageOutset:
case CSSPropertyWebkitMaskBoxImageOutset:
return CSSPropertyBorderImageUtils::ConsumeBorderImageOutset(range_);
case CSSPropertyBorderImageWidth:
case CSSPropertyWebkitMaskBoxImageWidth:
return CSSPropertyBorderImageUtils::ConsumeBorderImageWidth(range_);
case CSSPropertyBackgroundClip:
case CSSPropertyBackgroundOrigin:
return ConsumeCommaSeparatedList(ConsumeBackgroundBox, range_);
case CSSPropertyBackgroundImage:
case CSSPropertyWebkitMaskImage:
return ConsumeCommaSeparatedList(ConsumeImageOrNone, range_, context_);
case CSSPropertyBackgroundPositionX:
case CSSPropertyWebkitMaskPositionX:
return ConsumeCommaSeparatedList(
......
// Copyright 2017 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "core/css/properties/CSSPropertyAPIBackgroundBox.h"
#include "core/css/parser/CSSPropertyParserHelpers.h"
#include "core/css/properties/CSSPropertyBackgroundUtils.h"
namespace blink {
const CSSValue* CSSPropertyAPIBackgroundBox::parseSingleValue(
CSSParserTokenRange& range,
const CSSParserContext&,
const CSSParserLocalContext&) {
return CSSPropertyParserHelpers::ConsumeCommaSeparatedList(
CSSPropertyBackgroundUtils::ConsumeBackgroundBox, range);
}
} // namespace blink
// Copyright 2017 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "core/css/properties/CSSPropertyAPIBackgroundOrMaskImage.h"
#include "core/css/parser/CSSPropertyParserHelpers.h"
namespace blink {
const CSSValue* CSSPropertyAPIBackgroundOrMaskImage::parseSingleValue(
CSSParserTokenRange& range,
const CSSParserContext& context,
const CSSParserLocalContext&) {
return CSSPropertyParserHelpers::ConsumeCommaSeparatedList(
CSSPropertyParserHelpers::ConsumeImageOrNone, range, &context);
}
} // namespace blink
......@@ -4,15 +4,4 @@
#include "core/css/properties/CSSPropertyAPIBorderImageOutset.h"
#include "core/css/properties/CSSPropertyBorderImageUtils.h"
namespace blink {
const CSSValue* CSSPropertyAPIBorderImageOutset::parseSingleValue(
CSSParserTokenRange& range,
const CSSParserContext&,
const CSSParserLocalContext&) {
return CSSPropertyBorderImageUtils::ConsumeBorderImageOutset(range);
}
} // namespace blink
namespace blink {} // namespace blink
......@@ -4,15 +4,4 @@
#include "core/css/properties/CSSPropertyAPIBorderImageRepeat.h"
#include "core/css/properties/CSSPropertyBorderImageUtils.h"
namespace blink {
const CSSValue* CSSPropertyAPIBorderImageRepeat::parseSingleValue(
CSSParserTokenRange& range,
const CSSParserContext&,
const CSSParserLocalContext&) {
return CSSPropertyBorderImageUtils::ConsumeBorderImageRepeat(range);
}
} // namespace blink
namespace blink {} // namespace blink
......@@ -4,16 +4,4 @@
#include "core/css/properties/CSSPropertyAPIBorderImageSlice.h"
#include "core/css/properties/CSSPropertyBorderImageUtils.h"
namespace blink {
const CSSValue* CSSPropertyAPIBorderImageSlice::parseSingleValue(
CSSParserTokenRange& range,
const CSSParserContext&,
const CSSParserLocalContext&) {
return CSSPropertyBorderImageUtils::ConsumeBorderImageSlice(
range, DefaultFill::kNoFill);
}
} // namespace blink
namespace blink {} // namespace blink
......@@ -4,15 +4,4 @@
#include "core/css/properties/CSSPropertyAPIBorderImageWidth.h"
#include "core/css/properties/CSSPropertyBorderImageUtils.h"
namespace blink {
const CSSValue* CSSPropertyAPIBorderImageWidth::parseSingleValue(
CSSParserTokenRange& range,
const CSSParserContext&,
const CSSParserLocalContext&) {
return CSSPropertyBorderImageUtils::ConsumeBorderImageWidth(range);
}
} // namespace blink
namespace blink {} // namespace blink
// Copyright 2017 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "core/css/properties/CSSPropertyAPIDelay.h"
#include "core/css/parser/CSSPropertyParserHelpers.h"
#include "platform/Length.h"
namespace blink {
const CSSValue* CSSPropertyAPIDelay::parseSingleValue(
CSSParserTokenRange& range,
const CSSParserContext&,
const CSSParserLocalContext&) {
return CSSPropertyParserHelpers::ConsumeCommaSeparatedList(
CSSPropertyParserHelpers::ConsumeTime, range, kValueRangeAll);
}
} // namespace blink
// Copyright 2017 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "core/css/properties/CSSPropertyAPIDuration.h"
#include "core/css/parser/CSSPropertyParserHelpers.h"
#include "platform/Length.h"
namespace blink {
const CSSValue* CSSPropertyAPIDuration::parseSingleValue(
CSSParserTokenRange& range,
const CSSParserContext&,
const CSSParserLocalContext&) {
return CSSPropertyParserHelpers::ConsumeCommaSeparatedList(
CSSPropertyParserHelpers::ConsumeTime, range, kValueRangeNonNegative);
}
} // namespace blink
// Copyright 2017 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "core/css/properties/CSSPropertyAPIGridGap.h"
#include "core/css/parser/CSSParserContext.h"
#include "core/css/parser/CSSPropertyParserHelpers.h"
#include "platform/Length.h"
namespace blink {
const CSSValue* CSSPropertyAPIGridGap::parseSingleValue(
CSSParserTokenRange& range,
const CSSParserContext& context,
const CSSParserLocalContext&) {
return CSSPropertyParserHelpers::ConsumeLengthOrPercent(
range, context.Mode(), kValueRangeNonNegative);
}
} // namespace blink
// Copyright 2017 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "core/css/properties/CSSPropertyAPITimingFunction.h"
#include "core/css/parser/CSSPropertyParserHelpers.h"
#include "core/css/properties/CSSPropertyAnimationTimingFunctionUtils.h"
namespace blink {
const CSSValue* CSSPropertyAPITimingFunction::parseSingleValue(
CSSParserTokenRange& range,
const CSSParserContext&,
const CSSParserLocalContext&) {
return CSSPropertyParserHelpers::ConsumeCommaSeparatedList(
CSSPropertyAnimationTimingFunctionUtils::ConsumeAnimationTimingFunction,
range);
}
} // namespace blink
......@@ -4,19 +4,4 @@
#include "core/css/properties/CSSPropertyAPIWebkitOriginX.h"
#include "core/CSSValueKeywords.h"
#include "core/css/parser/CSSParserContext.h"
#include "core/css/properties/CSSPropertyPositionUtils.h"
namespace blink {
const CSSValue* CSSPropertyAPIWebkitOriginX::parseSingleValue(
CSSParserTokenRange& range,
const CSSParserContext& context,
const CSSParserLocalContext&) {
return CSSPropertyPositionUtils::ConsumePositionLonghand<CSSValueLeft,
CSSValueRight>(
range, context.Mode());
}
} // namespace blink
namespace blink {} // namespace blink
......@@ -4,19 +4,4 @@
#include "core/css/properties/CSSPropertyAPIWebkitOriginY.h"
#include "core/CSSValueKeywords.h"
#include "core/css/parser/CSSParserContext.h"
#include "core/css/properties/CSSPropertyPositionUtils.h"
namespace blink {
const CSSValue* CSSPropertyAPIWebkitOriginY::parseSingleValue(
CSSParserTokenRange& range,
const CSSParserContext& context,
const CSSParserLocalContext&) {
return CSSPropertyPositionUtils::ConsumePositionLonghand<CSSValueTop,
CSSValueBottom>(
range, context.Mode());
}
} // namespace blink
namespace blink {} // namespace blink
......@@ -43,12 +43,6 @@ CSSValue* CSSPropertyBackgroundUtils::ConsumeBackgroundBlendMode(
return nullptr;
}
CSSValue* CSSPropertyBackgroundUtils::ConsumeBackgroundBox(
CSSParserTokenRange& range) {
return CSSPropertyParserHelpers::ConsumeIdent<
CSSValueBorderBox, CSSValuePaddingBox, CSSValueContentBox>(range);
}
CSSValue* CSSPropertyBackgroundUtils::ConsumeBackgroundComposite(
CSSParserTokenRange& range) {
return CSSPropertyParserHelpers::ConsumeIdentRange(range, CSSValueClear,
......
......@@ -24,7 +24,6 @@ class CSSPropertyBackgroundUtils {
static CSSValue* ConsumeBackgroundAttachment(CSSParserTokenRange&);
static CSSValue* ConsumeBackgroundBlendMode(CSSParserTokenRange&);
static CSSValue* ConsumeBackgroundBox(CSSParserTokenRange&);
static CSSValue* ConsumeBackgroundComposite(CSSParserTokenRange&);
static CSSValue* ConsumeMaskSourceType(CSSParserTokenRange&);
......
......@@ -34,7 +34,7 @@ CSSValue* CSSPropertyBorderImageUtils::ConsumeWebkitBorderImage(
CSSValue* outset = nullptr;
CSSValue* repeat = nullptr;
if (ConsumeBorderImageComponents(range, context, source, slice, width, outset,
repeat, DefaultFill::kFill))
repeat, true /* default_fill */))
return CreateBorderImageValue(source, slice, width, outset, repeat);
return nullptr;
}
......@@ -47,7 +47,7 @@ bool CSSPropertyBorderImageUtils::ConsumeBorderImageComponents(
CSSValue*& width,
CSSValue*& outset,
CSSValue*& repeat,
DefaultFill default_fill) {
bool default_fill) {
do {
if (!source) {
source = CSSPropertyParserHelpers::ConsumeImageOrNone(range, &context);
......@@ -99,7 +99,7 @@ CSSValue* CSSPropertyBorderImageUtils::ConsumeBorderImageRepeat(
CSSValue* CSSPropertyBorderImageUtils::ConsumeBorderImageSlice(
CSSParserTokenRange& range,
DefaultFill default_fill) {
bool default_fill) {
bool fill = CSSPropertyParserHelpers::ConsumeIdent<CSSValueFill>(range);
CSSValue* slices[4] = {0};
......@@ -122,7 +122,7 @@ CSSValue* CSSPropertyBorderImageUtils::ConsumeBorderImageSlice(
fill = true;
}
CSSPropertyParserHelpers::Complete4Sides(slices);
if (default_fill == DefaultFill::kFill)
if (default_fill)
fill = true;
return CSSBorderImageSliceValue::Create(
CSSQuadValue::Create(slices[0], slices[1], slices[2], slices[3],
......
......@@ -13,8 +13,6 @@ class CSSParserContext;
class CSSParserTokenRange;
class CSSValue;
enum class DefaultFill { kFill, kNoFill };
class CSSPropertyBorderImageUtils {
STATIC_ONLY(CSSPropertyBorderImageUtils);
......@@ -28,9 +26,10 @@ class CSSPropertyBorderImageUtils {
CSSValue*& width,
CSSValue*& outset,
CSSValue*& repeat,
DefaultFill);
bool default_fill);
static CSSValue* ConsumeBorderImageRepeat(CSSParserTokenRange&);
static CSSValue* ConsumeBorderImageSlice(CSSParserTokenRange&, DefaultFill);
static CSSValue* ConsumeBorderImageSlice(CSSParserTokenRange&,
bool default_fill);
static CSSValue* ConsumeBorderImageWidth(CSSParserTokenRange&);
static CSSValue* ConsumeBorderImageOutset(CSSParserTokenRange&);
};
......
......@@ -6,8 +6,6 @@
#include "core/CSSValueKeywords.h"
#include "core/css/parser/CSSParserMode.h"
#include "core/css/parser/CSSParserTokenRange.h"
#include "core/css/parser/CSSPropertyParserHelpers.h"
#include "platform/wtf/Allocator.h"
......
......@@ -24,8 +24,7 @@ bool CSSShorthandPropertyAPIBorderImage::parseShorthand(
CSSValue* repeat = nullptr;
if (!CSSPropertyBorderImageUtils::ConsumeBorderImageComponents(
range, context, source, slice, width, outset, repeat,
DefaultFill::kNoFill)) {
range, context, source, slice, width, outset, repeat, false)) {
return false;
}
......
......@@ -24,8 +24,7 @@ bool CSSShorthandPropertyAPIWebkitMaskBoxImage::parseShorthand(
CSSValue* repeat = nullptr;
if (!CSSPropertyBorderImageUtils::ConsumeBorderImageComponents(
range, context, source, slice, width, outset, repeat,
DefaultFill::kFill)) {
range, context, source, slice, width, outset, repeat, true)) {
return false;
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment