Commit 8852ff80 authored by aazzam's avatar aazzam Committed by Commit bot

Implements CSSPropertyAPI for the outline-offset property.

A part of Project Ribbon, separating the parsing logic for CSS
properties from the parser into an API. This patch removes
CSSPropertyOutlineOffset from the switch statement in parseSingleValue,
and calls the API instead.

A function pointer to the parseSingleValue function from the API for the
page property is stored in a CSSPropertyDescriptor, and is called from
CSSPropertyParser.

This patch:
- Adds CSSPropertyAPIOutlineOffset.cpp to the BUILD.gn file.
- Adds api_class flag to CSSProperties.in, which indicates that
  CSSPropertyAPIOutlineOffset.h is generated.
- Moves the parsing logic for page from CSSPropertyParser.cpp to
  CSSPropertyAPIOutlineOffset.cpp, which implements
  CSSPropertyAPI.h.

BUG=668012

Review-Url: https://codereview.chromium.org/2610813004
Cr-Commit-Position: refs/heads/master@{#442876}
parent c713c645
......@@ -351,6 +351,7 @@ blink_core_sources("css") {
"properties/CSSPropertyAPIFontSizeAdjust.cpp",
"properties/CSSPropertyAPIFontVariationSettings.cpp",
"properties/CSSPropertyAPIOffsetPosition.cpp",
"properties/CSSPropertyAPIOutlineOffset.cpp",
"properties/CSSPropertyAPISize.cpp",
"properties/CSSPropertyAPITextDecorationColor.cpp",
"properties/CSSPropertyAPITextDecorationSkip.cpp",
......
......@@ -321,7 +321,7 @@ opacity interpolable, type_name=float
order type_name=int
orphans interpolable, inherited, type_name=short
outline-color interpolable, custom_all
outline-offset interpolable, converter=convertComputedLength<int>
outline-offset interpolable, converter=convertComputedLength<int>, api_class
outline-style custom_all
outline-width interpolable, converter=convertLineWidth<unsigned short>
overflow-anchor runtime_flag=ScrollAnchoring, type_name=EOverflowAnchor
......
......@@ -3442,8 +3442,6 @@ const CSSValue* CSSPropertyParser::parseSingleValue(
return consumeTextEmphasisStyle(m_range);
case CSSPropertyOutlineColor:
return consumeOutlineColor(m_range, m_context.mode());
case CSSPropertyOutlineOffset:
return consumeLength(m_range, m_context.mode(), ValueRangeAll);
case CSSPropertyOutlineWidth:
return consumeLineWidth(m_range, m_context.mode(), UnitlessQuirk::Forbid);
case CSSPropertyTransform:
......
// 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/CSSPropertyAPIOutlineOffset.h"
#include "core/css/parser/CSSParserContext.h"
#include "core/css/parser/CSSPropertyParserHelpers.h"
namespace blink {
const CSSValue* CSSPropertyAPIOutlineOffset::parseSingleValue(
CSSParserTokenRange& range,
const CSSParserContext& context) {
return CSSPropertyParserHelpers::consumeLength(range, context.mode(),
ValueRangeAll);
}
} // namespace blink
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