Commit c7370d7a authored by Rob Buis's avatar Rob Buis Committed by Commit Bot

Implements CSSPropertyAPI for logical width/height properties

As part of Project Ribbon, separate the parsing logic for these CSS
properties from the parser into an API:
- block-size
- inline-size
- min-block-size
- min-inline-size
- -webkit-min-logical-width
- -webkit-min-logical-height
- -webkit-logical-width
- -webkit-logical-height

Bug: 668012
Signed-off-by: default avatarRob Buis <rob.buis@samsung.com>
Change-Id: I1689c5df226f0dd0adf660705ba80c5ed4c7bd9e
Reviewed-on: https://chromium-review.googlesource.com/589607Reviewed-by: default avatarBugs Nash <bugsnash@chromium.org>
Cr-Commit-Position: refs/heads/master@{#491402}
parent aa14880e
...@@ -541,6 +541,7 @@ code_generator("make_core_generated_css_property_apis") { ...@@ -541,6 +541,7 @@ code_generator("make_core_generated_css_property_apis") {
"$blink_core_output_dir/css/properties/CSSPropertyAPILetterAndWordSpacing.h", "$blink_core_output_dir/css/properties/CSSPropertyAPILetterAndWordSpacing.h",
"$blink_core_output_dir/css/properties/CSSPropertyAPILineHeight.h", "$blink_core_output_dir/css/properties/CSSPropertyAPILineHeight.h",
"$blink_core_output_dir/css/properties/CSSPropertyAPILineHeightStep.h", "$blink_core_output_dir/css/properties/CSSPropertyAPILineHeightStep.h",
"$blink_core_output_dir/css/properties/CSSPropertyAPILogicalWidthOrHeight.h",
"$blink_core_output_dir/css/properties/CSSPropertyAPIMargin.h", "$blink_core_output_dir/css/properties/CSSPropertyAPIMargin.h",
"$blink_core_output_dir/css/properties/CSSPropertyAPIMarker.h", "$blink_core_output_dir/css/properties/CSSPropertyAPIMarker.h",
"$blink_core_output_dir/css/properties/CSSPropertyAPIMaskSourceType.h", "$blink_core_output_dir/css/properties/CSSPropertyAPIMaskSourceType.h",
...@@ -600,7 +601,6 @@ code_generator("make_core_generated_css_property_apis") { ...@@ -600,7 +601,6 @@ code_generator("make_core_generated_css_property_apis") {
"$blink_core_output_dir/css/properties/CSSPropertyAPIWebkitFontSizeDelta.h", "$blink_core_output_dir/css/properties/CSSPropertyAPIWebkitFontSizeDelta.h",
"$blink_core_output_dir/css/properties/CSSPropertyAPIWebkitHighlight.h", "$blink_core_output_dir/css/properties/CSSPropertyAPIWebkitHighlight.h",
"$blink_core_output_dir/css/properties/CSSPropertyAPIWebkitLineClamp.h", "$blink_core_output_dir/css/properties/CSSPropertyAPIWebkitLineClamp.h",
"$blink_core_output_dir/css/properties/CSSPropertyAPIWebkitLogicalWidthOrHeight.h",
"$blink_core_output_dir/css/properties/CSSPropertyAPIWebkitMargin.h", "$blink_core_output_dir/css/properties/CSSPropertyAPIWebkitMargin.h",
"$blink_core_output_dir/css/properties/CSSPropertyAPIWebkitMaskComposite.h", "$blink_core_output_dir/css/properties/CSSPropertyAPIWebkitMaskComposite.h",
"$blink_core_output_dir/css/properties/CSSPropertyAPIWebkitMaskRepeat.h", "$blink_core_output_dir/css/properties/CSSPropertyAPIWebkitMaskRepeat.h",
......
...@@ -439,6 +439,7 @@ blink_core_sources("css") { ...@@ -439,6 +439,7 @@ blink_core_sources("css") {
"properties/CSSPropertyAPILetterAndWordSpacing.cpp", "properties/CSSPropertyAPILetterAndWordSpacing.cpp",
"properties/CSSPropertyAPILineHeight.cpp", "properties/CSSPropertyAPILineHeight.cpp",
"properties/CSSPropertyAPILineHeightStep.cpp", "properties/CSSPropertyAPILineHeightStep.cpp",
"properties/CSSPropertyAPILogicalWidthOrHeight.cpp",
"properties/CSSPropertyAPIMargin.cpp", "properties/CSSPropertyAPIMargin.cpp",
"properties/CSSPropertyAPIMarker.cpp", "properties/CSSPropertyAPIMarker.cpp",
"properties/CSSPropertyAPIMaskSourceType.cpp", "properties/CSSPropertyAPIMaskSourceType.cpp",
...@@ -498,7 +499,6 @@ blink_core_sources("css") { ...@@ -498,7 +499,6 @@ blink_core_sources("css") {
"properties/CSSPropertyAPIWebkitFontSizeDelta.cpp", "properties/CSSPropertyAPIWebkitFontSizeDelta.cpp",
"properties/CSSPropertyAPIWebkitHighlight.cpp", "properties/CSSPropertyAPIWebkitHighlight.cpp",
"properties/CSSPropertyAPIWebkitLineClamp.cpp", "properties/CSSPropertyAPIWebkitLineClamp.cpp",
"properties/CSSPropertyAPIWebkitLogicalWidthOrHeight.cpp",
"properties/CSSPropertyAPIWebkitMargin.cpp", "properties/CSSPropertyAPIWebkitMargin.cpp",
"properties/CSSPropertyAPIWebkitMaskComposite.cpp", "properties/CSSPropertyAPIWebkitMaskComposite.cpp",
"properties/CSSPropertyAPIWebkitMaskRepeat.cpp", "properties/CSSPropertyAPIWebkitMaskRepeat.cpp",
......
...@@ -3491,18 +3491,26 @@ ...@@ -3491,18 +3491,26 @@
// CSS logical props // CSS logical props
{ {
name: "inline-size", name: "inline-size",
api_class: "CSSPropertyAPILogicalWidthOrHeight",
api_methods: ["parseSingleValue"],
direction_aware: true, direction_aware: true,
}, },
{ {
name: "block-size", name: "block-size",
api_class: "CSSPropertyAPILogicalWidthOrHeight",
api_methods: ["parseSingleValue"],
direction_aware: true, direction_aware: true,
}, },
{ {
name: "min-inline-size", name: "min-inline-size",
api_class: "CSSPropertyAPILogicalWidthOrHeight",
api_methods: ["parseSingleValue"],
direction_aware: true, direction_aware: true,
}, },
{ {
name: "min-block-size", name: "min-block-size",
api_class: "CSSPropertyAPILogicalWidthOrHeight",
api_methods: ["parseSingleValue"],
direction_aware: true, direction_aware: true,
}, },
{ {
...@@ -3634,22 +3642,22 @@ ...@@ -3634,22 +3642,22 @@
}, },
{ {
name: "-webkit-logical-width", name: "-webkit-logical-width",
api_class: "CSSPropertyAPIWebkitLogicalWidthOrHeight", api_class: "CSSPropertyAPILogicalWidthOrHeight",
direction_aware: true, direction_aware: true,
}, },
{ {
name: "-webkit-logical-height", name: "-webkit-logical-height",
api_class: "CSSPropertyAPIWebkitLogicalWidthOrHeight", api_class: "CSSPropertyAPILogicalWidthOrHeight",
direction_aware: true, direction_aware: true,
}, },
{ {
name: "-webkit-min-logical-width", name: "-webkit-min-logical-width",
api_class: "CSSPropertyAPIWebkitLogicalWidthOrHeight", api_class: "CSSPropertyAPILogicalWidthOrHeight",
direction_aware: true, direction_aware: true,
}, },
{ {
name: "-webkit-min-logical-height", name: "-webkit-min-logical-height",
api_class: "CSSPropertyAPIWebkitLogicalWidthOrHeight", api_class: "CSSPropertyAPILogicalWidthOrHeight",
direction_aware: true, direction_aware: true,
}, },
{ {
......
...@@ -658,15 +658,6 @@ const CSSValue* CSSPropertyParser::ParseSingleValue( ...@@ -658,15 +658,6 @@ const CSSValue* CSSPropertyParser::ParseSingleValue(
case CSSPropertyHeight: case CSSPropertyHeight:
return CSSPropertyLengthUtils::ConsumeWidthOrHeight( return CSSPropertyLengthUtils::ConsumeWidthOrHeight(
range_, *context_, UnitlessQuirk::kAllow); range_, *context_, UnitlessQuirk::kAllow);
case CSSPropertyInlineSize:
case CSSPropertyBlockSize:
case CSSPropertyMinInlineSize:
case CSSPropertyMinBlockSize:
case CSSPropertyWebkitMinLogicalWidth:
case CSSPropertyWebkitMinLogicalHeight:
case CSSPropertyWebkitLogicalWidth:
case CSSPropertyWebkitLogicalHeight:
return CSSPropertyLengthUtils::ConsumeWidthOrHeight(range_, *context_);
case CSSPropertyTextDecoration: case CSSPropertyTextDecoration:
DCHECK(!RuntimeEnabledFeatures::CSS3TextDecorationsEnabled()); DCHECK(!RuntimeEnabledFeatures::CSS3TextDecorationsEnabled());
return CSSPropertyTextDecorationLineUtils::ConsumeTextDecorationLine( return CSSPropertyTextDecorationLineUtils::ConsumeTextDecorationLine(
......
// 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/CSSPropertyAPILogicalWidthOrHeight.h"
#include "core/css/parser/CSSPropertyParserHelpers.h"
#include "core/css/properties/CSSPropertyLengthUtils.h"
namespace blink {
class CSSParserLocalContext;
const CSSValue* CSSPropertyAPILogicalWidthOrHeight::parseSingleValue(
CSSParserTokenRange& range,
const CSSParserContext& context,
const CSSParserLocalContext&) {
return CSSPropertyLengthUtils::ConsumeWidthOrHeight(range, context);
}
} // 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/CSSPropertyAPIWebkitLogicalWidthOrHeight.h"
namespace blink {} // 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