summaryrefslogtreecommitdiff
path: root/chromium/third_party/blink/renderer/core/css/properties
diff options
context:
space:
mode:
authorAllan Sandfeld Jensen <allan.jensen@qt.io>2020-11-18 16:35:47 +0100
committerAllan Sandfeld Jensen <allan.jensen@qt.io>2020-11-18 15:45:54 +0000
commit32f5a1c56531e4210bc4cf8d8c7825d66e081888 (patch)
treeeeeec6822f4d738d8454525233fd0e2e3a659e6d /chromium/third_party/blink/renderer/core/css/properties
parent99677208ff3b216fdfec551fbe548da5520cd6fb (diff)
downloadqtwebengine-chromium-32f5a1c56531e4210bc4cf8d8c7825d66e081888.tar.gz
BASELINE: Update Chromium to 87.0.4280.67
Change-Id: Ib157360be8c2ffb2c73125751a89f60e049c1d54 Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
Diffstat (limited to 'chromium/third_party/blink/renderer/core/css/properties')
-rw-r--r--chromium/third_party/blink/renderer/core/css/properties/css_parsing_utils.cc101
-rw-r--r--chromium/third_party/blink/renderer/core/css/properties/css_parsing_utils.h8
-rw-r--r--chromium/third_party/blink/renderer/core/css/properties/css_property_test.cc12
-rw-r--r--chromium/third_party/blink/renderer/core/css/properties/longhands/longhands_custom.cc240
-rw-r--r--chromium/third_party/blink/renderer/core/css/properties/shorthands/shorthands_custom.cc10
5 files changed, 259 insertions, 112 deletions
diff --git a/chromium/third_party/blink/renderer/core/css/properties/css_parsing_utils.cc b/chromium/third_party/blink/renderer/core/css/properties/css_parsing_utils.cc
index e41beba08bf..c9dd2a00413 100644
--- a/chromium/third_party/blink/renderer/core/css/properties/css_parsing_utils.cc
+++ b/chromium/third_party/blink/renderer/core/css/properties/css_parsing_utils.cc
@@ -14,6 +14,7 @@
#include "third_party/blink/renderer/core/css/css_content_distribution_value.h"
#include "third_party/blink/renderer/core/css/css_crossfade_value.h"
#include "third_party/blink/renderer/core/css/css_custom_ident_value.h"
+#include "third_party/blink/renderer/core/css/css_element_offset_value.h"
#include "third_party/blink/renderer/core/css/css_font_family_value.h"
#include "third_party/blink/renderer/core/css/css_font_feature_value.h"
#include "third_party/blink/renderer/core/css/css_font_style_range_value.h"
@@ -1093,6 +1094,21 @@ cssvalue::CSSURIValue* ConsumeUrl(CSSParserTokenRange& range,
url_string, context.CompleteURL(url_string));
}
+CSSValue* ConsumeSelectorFunction(CSSParserTokenRange& range) {
+ if (range.Peek().FunctionId() != CSSValueID::kSelector)
+ return nullptr;
+ auto block = ConsumeFunction(range);
+ if (auto* id_value = ConsumeIdSelector(block)) {
+ if (!block.AtEnd())
+ return nullptr;
+ auto* selector_function =
+ MakeGarbageCollected<CSSFunctionValue>(CSSValueID::kSelector);
+ selector_function->Append(*id_value);
+ return selector_function;
+ }
+ return nullptr;
+}
+
CSSValue* ConsumeIdSelector(CSSParserTokenRange& range) {
if (!IsHashIdentifier(range.Peek()))
return nullptr;
@@ -1295,15 +1311,6 @@ CSSValue* ConsumeColor(CSSParserTokenRange& range,
return cssvalue::CSSColorValue::Create(color);
}
-CSSValue* ConsumeInternalForcedBackgroundColor(
- CSSParserTokenRange& range,
- const CSSParserContext& context) {
- CSSValueID id = range.Peek().Id();
- if (!StyleColor::IsColorKeyword(id))
- return nullptr;
- return ConsumeIdent(range);
-}
-
CSSValue* ConsumeLineWidth(CSSParserTokenRange& range,
const CSSParserContext& context,
UnitlessQuirk unitless) {
@@ -2623,10 +2630,11 @@ bool IsTimelineName(const CSSParserToken& token) {
CSSValue* ConsumeScrollOffset(CSSParserTokenRange& range,
const CSSParserContext& context) {
- range.ConsumeWhitespace();
if (IdentMatches<CSSValueID::kAuto>(range.Peek().Id()))
return ConsumeIdent(range);
CSSParserContext::ParserModeOverridingScope scope(context, kHTMLStandardMode);
+ if (auto* element_offset = ConsumeElementOffset(range, context))
+ return element_offset;
CSSValue* value =
ConsumeLengthOrPercent(range, context, kValueRangeNonNegative);
if (!range.AtEnd())
@@ -2634,6 +2642,31 @@ CSSValue* ConsumeScrollOffset(CSSParserTokenRange& range,
return value;
}
+namespace {
+
+// https://drafts.csswg.org/scroll-animations-1/#typedef-element-offset-edge
+CSSValue* ConsumeElementOffsetEdge(CSSParserTokenRange& range) {
+ return ConsumeIdent<CSSValueID::kStart, CSSValueID::kEnd>(range);
+}
+
+} // namespace
+
+// https://drafts.csswg.org/scroll-animations-1/#typedef-element-offset
+CSSValue* ConsumeElementOffset(CSSParserTokenRange& range,
+ const CSSParserContext& context) {
+ CSSValue* target = ConsumeSelectorFunction(range);
+ if (!target)
+ return nullptr;
+ CSSValue* edge = ConsumeElementOffsetEdge(range);
+ CSSValue* threshold = ConsumeNumber(range, context, kValueRangeNonNegative);
+ // Edge and threshold may appear in any order.
+ edge = edge ? edge : ConsumeElementOffsetEdge(range);
+ if (!range.AtEnd())
+ return nullptr;
+ return MakeGarbageCollected<cssvalue::CSSElementOffsetValue>(target, edge,
+ threshold);
+}
+
CSSValue* ConsumeSelfPositionOverflowPosition(
CSSParserTokenRange& range,
IsPositionKeyword is_position_keyword) {
@@ -3466,33 +3499,26 @@ CSSValue* ConsumeCounter(CSSParserTokenRange& range,
return list;
}
-CSSValue* ConsumeScriptLevel(CSSParserTokenRange& range,
- const CSSParserContext& context) {
+CSSValue* ConsumeMathDepth(CSSParserTokenRange& range,
+ const CSSParserContext& context) {
+ if (range.Peek().Id() == CSSValueID::kAutoAdd)
+ return ConsumeIdent(range);
+
+ if (CSSPrimitiveValue* integer_value = ConsumeInteger(range, context))
+ return integer_value;
+
CSSValueID function_id = range.Peek().FunctionId();
- DCHECK(function_id == CSSValueID::kScriptlevel);
- CSSParserTokenRange args = ConsumeFunction(range);
- if (args.AtEnd())
- return nullptr;
- CSSValue* parsed_value = ConsumeIdent<CSSValueID::kAuto>(args);
- if (!parsed_value)
- parsed_value = ConsumeInteger(args, context);
- if (!parsed_value) {
- function_id = args.Peek().FunctionId();
- if (function_id == CSSValueID::kAdd) {
+ if (function_id == CSSValueID::kAdd) {
+ CSSParserTokenRange add_args = ConsumeFunction(range);
+ CSSValue* value = ConsumeInteger(add_args, context);
+ if (value && add_args.AtEnd()) {
auto* add_value = MakeGarbageCollected<CSSFunctionValue>(function_id);
- CSSParserTokenRange add_args = ConsumeFunction(args);
- if ((parsed_value = ConsumeInteger(add_args, context))) {
- add_value->Append(*parsed_value);
- parsed_value = add_value;
- }
+ add_value->Append(*value);
+ return add_value;
}
}
- if (!parsed_value || !args.AtEnd())
- return nullptr;
- auto* script_level_value =
- MakeGarbageCollected<CSSFunctionValue>(CSSValueID::kScriptlevel);
- script_level_value->Append(*parsed_value);
- return script_level_value;
+
+ return nullptr;
}
CSSValue* ConsumeFontSize(CSSParserTokenRange& range,
@@ -3500,12 +3526,11 @@ CSSValue* ConsumeFontSize(CSSParserTokenRange& range,
UnitlessQuirk unitless) {
if (range.Peek().Id() == CSSValueID::kWebkitXxxLarge)
context.Count(WebFeature::kFontSizeWebkitXxxLarge);
- if (range.Peek().Id() >= CSSValueID::kXxSmall &&
- range.Peek().Id() <= CSSValueID::kWebkitXxxLarge)
+ if ((range.Peek().Id() >= CSSValueID::kXxSmall &&
+ range.Peek().Id() <= CSSValueID::kWebkitXxxLarge) ||
+ (RuntimeEnabledFeatures::CSSMathDepthEnabled() &&
+ range.Peek().Id() == CSSValueID::kMath))
return ConsumeIdent(range);
- if (RuntimeEnabledFeatures::CSSMathStyleEnabled() &&
- range.Peek().FunctionId() == CSSValueID::kScriptlevel)
- return ConsumeScriptLevel(range, context);
return ConsumeLengthOrPercent(range, context, kValueRangeNonNegative,
unitless);
}
diff --git a/chromium/third_party/blink/renderer/core/css/properties/css_parsing_utils.h b/chromium/third_party/blink/renderer/core/css/properties/css_parsing_utils.h
index fac3416dc09..b051a17d667 100644
--- a/chromium/third_party/blink/renderer/core/css/properties/css_parsing_utils.h
+++ b/chromium/third_party/blink/renderer/core/css/properties/css_parsing_utils.h
@@ -129,15 +129,13 @@ StringView ConsumeUrlAsStringView(CSSParserTokenRange&,
const CSSParserContext&);
cssvalue::CSSURIValue* ConsumeUrl(CSSParserTokenRange&,
const CSSParserContext&);
+CSSValue* ConsumeSelectorFunction(CSSParserTokenRange&);
CORE_EXPORT CSSValue* ConsumeIdSelector(CSSParserTokenRange&);
CSSValue* ConsumeColor(CSSParserTokenRange&,
const CSSParserContext&,
bool accept_quirky_colors = false);
-CSSValue* ConsumeInternalForcedBackgroundColor(CSSParserTokenRange&,
- const CSSParserContext&);
-
CSSValue* ConsumeLineWidth(CSSParserTokenRange&,
const CSSParserContext&,
UnitlessQuirk);
@@ -246,6 +244,7 @@ bool IsCustomIdent(CSSValueID);
bool IsTimelineName(const CSSParserToken&);
CSSValue* ConsumeScrollOffset(CSSParserTokenRange&, const CSSParserContext&);
+CSSValue* ConsumeElementOffset(CSSParserTokenRange&, const CSSParserContext&);
CSSValue* ConsumeSelfPositionOverflowPosition(CSSParserTokenRange&,
IsPositionKeyword);
CSSValue* ConsumeSimplifiedDefaultPosition(CSSParserTokenRange&,
@@ -355,6 +354,9 @@ CSSValue* ConsumeFontSize(CSSParserTokenRange&,
CSSValue* ConsumeLineHeight(CSSParserTokenRange&, const CSSParserContext&);
+CSSValue* ConsumeMathDepth(CSSParserTokenRange& range,
+ const CSSParserContext& context);
+
CSSValueList* ConsumeFontFamily(CSSParserTokenRange&);
CSSValue* ConsumeGenericFamily(CSSParserTokenRange&);
CSSValue* ConsumeFamilyName(CSSParserTokenRange&);
diff --git a/chromium/third_party/blink/renderer/core/css/properties/css_property_test.cc b/chromium/third_party/blink/renderer/core/css/properties/css_property_test.cc
index 2614c2700b4..eda96e154bc 100644
--- a/chromium/third_party/blink/renderer/core/css/properties/css_property_test.cc
+++ b/chromium/third_party/blink/renderer/core/css/properties/css_property_test.cc
@@ -71,15 +71,9 @@ TEST_F(CSSPropertyTest, GetUnvisitedPropertyFromVisited) {
}
}
-TEST_F(CSSPropertyTest, InternalResetEffectiveNotWebExposed) {
- const CSSPropertyValueSet* ua_set = css_test_helpers::ParseDeclarationBlock(
- "zoom:-internal-reset-effective", kUASheetMode);
- const CSSPropertyValueSet* author_set =
- css_test_helpers::ParseDeclarationBlock("zoom:-internal-reset-effective",
- kHTMLStandardMode);
-
- EXPECT_TRUE(ua_set->HasProperty(CSSPropertyID::kZoom));
- EXPECT_FALSE(author_set->HasProperty(CSSPropertyID::kZoom));
+TEST_F(CSSPropertyTest, InternalFontSizeDeltaNotWebExposed) {
+ ASSERT_FALSE(
+ CSSProperty::Get(CSSPropertyID::kInternalFontSizeDelta).IsWebExposed());
}
TEST_F(CSSPropertyTest, VisitedPropertiesCanParseValues) {
diff --git a/chromium/third_party/blink/renderer/core/css/properties/longhands/longhands_custom.cc b/chromium/third_party/blink/renderer/core/css/properties/longhands/longhands_custom.cc
index 6edb180e905..43fc39df996 100644
--- a/chromium/third_party/blink/renderer/core/css/properties/longhands/longhands_custom.cc
+++ b/chromium/third_party/blink/renderer/core/css/properties/longhands/longhands_custom.cc
@@ -401,19 +401,41 @@ const CSSValue* AspectRatio::ParseSingleValue(
CSSParserTokenRange& range,
const CSSParserContext& context,
const CSSParserLocalContext&) const {
+ // Syntax: auto | auto 1/2 | 1/2 auto
+ CSSValue* auto_value = nullptr;
if (range.Peek().Id() == CSSValueID::kAuto)
- return css_parsing_utils::ConsumeIdent(range);
- CSSValue* width = css_parsing_utils::ConsumePositiveInteger(range, context);
+ auto_value = css_parsing_utils::ConsumeIdent(range);
+
+ if (range.AtEnd())
+ return auto_value;
+
+ CSSValue* width =
+ css_parsing_utils::ConsumeNumber(range, context, kValueRangeNonNegative);
if (!width)
return nullptr;
- if (!css_parsing_utils::ConsumeSlashIncludingWhitespace(range))
- return nullptr;
- CSSValue* height = css_parsing_utils::ConsumePositiveInteger(range, context);
- if (!height)
- return nullptr;
- CSSValueList* list = CSSValueList::CreateSlashSeparated();
- list->Append(*width);
- list->Append(*height);
+ CSSValue* height = nullptr;
+ if (css_parsing_utils::ConsumeSlashIncludingWhitespace(range)) {
+ height = css_parsing_utils::ConsumeNumber(range, context,
+ kValueRangeNonNegative);
+ }
+ // missing height is legal (treated as 1)
+
+ CSSValueList* ratio_list = CSSValueList::CreateSlashSeparated();
+ ratio_list->Append(*width);
+ if (height)
+ ratio_list->Append(*height);
+ if (!range.AtEnd()) {
+ if (auto_value)
+ return nullptr;
+ if (range.Peek().Id() != CSSValueID::kAuto)
+ return nullptr;
+ auto_value = css_parsing_utils::ConsumeIdent(range);
+ }
+
+ CSSValueList* list = CSSValueList::CreateSpaceSeparated();
+ if (auto_value)
+ list->Append(*auto_value);
+ list->Append(*ratio_list);
return list;
}
@@ -423,14 +445,23 @@ const CSSValue* AspectRatio::CSSValueFromComputedStyleInternal(
const LayoutObject* layout_object,
bool allow_visited_style) const {
auto& ratio = style.AspectRatio();
- if (!ratio.has_value())
+ if (ratio.GetTypeForComputedStyle() == EAspectRatioType::kAuto)
return CSSIdentifierValue::Create(CSSValueID::kAuto);
- CSSValueList* list = CSSValueList::CreateSlashSeparated();
- list->Append(*CSSNumericLiteralValue::Create(
- ratio->Width(), CSSPrimitiveValue::UnitType::kInteger));
- list->Append(*CSSNumericLiteralValue::Create(
- ratio->Height(), CSSPrimitiveValue::UnitType::kInteger));
+ CSSValueList* ratio_list = CSSValueList::CreateSlashSeparated();
+ ratio_list->Append(*CSSNumericLiteralValue::Create(
+ ratio.GetRatio().Width(), CSSPrimitiveValue::UnitType::kNumber));
+ if (ratio.GetRatio().Height() != 1.0f) {
+ ratio_list->Append(*CSSNumericLiteralValue::Create(
+ ratio.GetRatio().Height(), CSSPrimitiveValue::UnitType::kNumber));
+ }
+ if (ratio.GetTypeForComputedStyle() == EAspectRatioType::kRatio)
+ return ratio_list;
+
+ DCHECK_EQ(ratio.GetTypeForComputedStyle(), EAspectRatioType::kAutoAndRatio);
+ CSSValueList* list = CSSValueList::CreateSpaceSeparated();
+ list->Append(*CSSIdentifierValue::Create(CSSValueID::kAuto));
+ list->Append(*ratio_list);
return list;
}
@@ -2294,11 +2325,72 @@ void Direction::ApplyValue(StyleResolverState& state,
To<CSSIdentifierValue>(value).ConvertTo<TextDirection>());
}
+namespace {
+
+static bool IsDisplayOutside(CSSValueID id) {
+ return id >= CSSValueID::kInline && id <= CSSValueID::kBlock;
+}
+
+static bool IsDisplayInside(CSSValueID id) {
+ if (id >= CSSValueID::kFlowRoot && id <= CSSValueID::kGrid)
+ return true;
+ if (id == CSSValueID::kMath)
+ return RuntimeEnabledFeatures::MathMLCoreEnabled();
+ return false;
+}
+
+static bool IsDisplayBox(CSSValueID id) {
+ return css_parsing_utils::IdentMatches<CSSValueID::kNone,
+ CSSValueID::kContents>(id);
+}
+
+static bool IsDisplayInternal(CSSValueID id) {
+ return id >= CSSValueID::kTableRowGroup && id <= CSSValueID::kTableCaption;
+}
+
+static bool IsDisplayLegacy(CSSValueID id) {
+ return id >= CSSValueID::kInlineBlock && id <= CSSValueID::kWebkitInlineFlex;
+}
+
+} // namespace
+
const CSSValue* Display::ParseSingleValue(CSSParserTokenRange& range,
const CSSParserContext& context,
const CSSParserLocalContext&) const {
- // NOTE: All the keyword values for the display property are handled by the
- // CSSParserFastPaths.
+ CSSValueID id = range.Peek().Id();
+ CSSIdentifierValue* display_outside = nullptr;
+ CSSIdentifierValue* display_inside = nullptr;
+ if (IsDisplayOutside(id)) {
+ display_outside = css_parsing_utils::ConsumeIdent(range);
+ if (range.AtEnd())
+ return display_outside;
+ id = range.Peek().Id();
+ if (!IsDisplayInside(id))
+ return nullptr;
+ display_inside = css_parsing_utils::ConsumeIdent(range);
+ } else if (IsDisplayInside(id)) {
+ display_inside = css_parsing_utils::ConsumeIdent(range);
+ if (range.AtEnd())
+ return display_inside;
+ id = range.Peek().Id();
+ if (!IsDisplayOutside(id))
+ return nullptr;
+ display_outside = css_parsing_utils::ConsumeIdent(range);
+ }
+ if (display_outside && display_inside) {
+ // TODO(crbug.com/995106): should apply to more than just math.
+ if (display_inside->GetValueID() == CSSValueID::kMath) {
+ CSSValueList* parsed_values = CSSValueList::CreateSpaceSeparated();
+ parsed_values->Append(*display_outside);
+ parsed_values->Append(*display_inside);
+ return parsed_values;
+ }
+ return nullptr;
+ }
+ if (id == CSSValueID::kListItem || IsDisplayBox(id) ||
+ IsDisplayInternal(id) || IsDisplayLegacy(id))
+ return css_parsing_utils::ConsumeIdent(range);
+
if (!RuntimeEnabledFeatures::CSSLayoutAPIEnabled())
return nullptr;
@@ -2336,6 +2428,16 @@ const CSSValue* Display::CSSValueFromComputedStyleInternal(
style.IsDisplayInlineType());
}
+ if (style.Display() == EDisplay::kBlockMath) {
+ CSSValueList* values = CSSValueList::CreateSpaceSeparated();
+ if (style.Display() == EDisplay::kBlockMath)
+ values->Append(*CSSIdentifierValue::Create(CSSValueID::kBlock));
+ else
+ values->Append(*CSSIdentifierValue::Create(CSSValueID::kInline));
+ values->Append(*CSSIdentifierValue::Create(CSSValueID::kMath));
+ return values;
+ }
+
return CSSIdentifierValue::Create(style.Display());
}
@@ -2360,6 +2462,24 @@ void Display::ApplyValue(StyleResolverState& state,
return;
}
+ if (value.IsValueList()) {
+ state.Style()->SetDisplayLayoutCustomName(
+ ComputedStyleInitialValues::InitialDisplayLayoutCustomName());
+ const CSSValueList& display_pair = To<CSSValueList>(value);
+ DCHECK_EQ(display_pair.length(), 2u);
+ DCHECK(display_pair.Item(0).IsIdentifierValue());
+ DCHECK(display_pair.Item(1).IsIdentifierValue());
+ const auto& outside = To<CSSIdentifierValue>(display_pair.Item(0));
+ const auto& inside = To<CSSIdentifierValue>(display_pair.Item(1));
+ // TODO(crbug.com/995106): should apply to more than just math.
+ DCHECK(inside.GetValueID() == CSSValueID::kMath);
+ if (outside.GetValueID() == CSSValueID::kBlock)
+ state.Style()->SetDisplay(EDisplay::kBlockMath);
+ else
+ state.Style()->SetDisplay(EDisplay::kMath);
+ return;
+ }
+
const auto& layout_function_value =
To<cssvalue::CSSLayoutFunctionValue>(value);
@@ -3312,23 +3432,6 @@ const CSSValue* InsetInlineStart::ParseSingleValue(
range, context, css_parsing_utils::UnitlessQuirk::kForbid);
}
-const CSSValue*
-InternalForcedBackgroundColorRgb::CSSValueFromComputedStyleInternal(
- const ComputedStyle& style,
- const SVGComputedStyle&,
- const LayoutObject*,
- bool allow_visited_style) const {
- return CSSIdentifierValue::Create(style.InternalForcedBackgroundColorRgb());
-}
-
-const CSSValue* InternalForcedBackgroundColorRgb::ParseSingleValue(
- CSSParserTokenRange& range,
- const CSSParserContext& context,
- const CSSParserLocalContext& local_context) const {
- return css_parsing_utils::ConsumeInternalForcedBackgroundColor(range,
- context);
-}
-
const blink::Color InternalVisitedBackgroundColor::ColorIncludingFallback(
bool visited_link,
const ComputedStyle& style) const {
@@ -4100,6 +4203,14 @@ const CSSValue* MaskType::CSSValueFromComputedStyleInternal(
return CSSIdentifierValue::Create(svg_style.MaskType());
}
+const CSSValue* MathShift::CSSValueFromComputedStyleInternal(
+ const ComputedStyle& style,
+ const SVGComputedStyle&,
+ const LayoutObject*,
+ bool allow_visited_style) const {
+ return CSSIdentifierValue::Create(style.MathShift());
+}
+
const CSSValue* MathStyle::CSSValueFromComputedStyleInternal(
const ComputedStyle& style,
const SVGComputedStyle&,
@@ -4108,12 +4219,38 @@ const CSSValue* MathStyle::CSSValueFromComputedStyleInternal(
return CSSIdentifierValue::Create(style.MathStyle());
}
-const CSSValue* MathSuperscriptShiftStyle::CSSValueFromComputedStyleInternal(
+const CSSValue* MathDepth::ParseSingleValue(
+ CSSParserTokenRange& range,
+ const CSSParserContext& context,
+ const CSSParserLocalContext&) const {
+ return css_parsing_utils::ConsumeMathDepth(range, context);
+}
+
+const CSSValue* MathDepth::CSSValueFromComputedStyleInternal(
const ComputedStyle& style,
const SVGComputedStyle&,
const LayoutObject*,
bool allow_visited_style) const {
- return CSSIdentifierValue::Create(style.MathSuperscriptShiftStyle());
+ return CSSNumericLiteralValue::Create(style.MathDepth(),
+ CSSPrimitiveValue::UnitType::kNumber);
+}
+
+void MathDepth::ApplyValue(StyleResolverState& state,
+ const CSSValue& value) const {
+ if (const auto* list = DynamicTo<CSSValueList>(value)) {
+ DCHECK_EQ(list->length(), 1U);
+ const auto& relative_value = To<CSSPrimitiveValue>(list->Item(0));
+ state.Style()->SetMathDepth(state.ParentStyle()->MathDepth() +
+ relative_value.GetIntValue());
+ } else if (auto* identifier_value = DynamicTo<CSSIdentifierValue>(value)) {
+ DCHECK(identifier_value->GetValueID() == CSSValueID::kAutoAdd);
+ unsigned depth = 0;
+ if (state.ParentStyle()->MathStyle() == EMathStyle::kCompact)
+ depth += 1;
+ state.Style()->SetMathDepth(state.ParentStyle()->MathDepth() + depth);
+ } else if (DynamicTo<CSSPrimitiveValue>(value)) {
+ state.Style()->SetMathDepth(To<CSSPrimitiveValue>(value).GetIntValue());
+ }
}
const CSSValue* MaxBlockSize::ParseSingleValue(
@@ -4917,8 +5054,11 @@ void Position::ApplyInherit(StyleResolverState& state) const {
const CSSValue* Quotes::ParseSingleValue(CSSParserTokenRange& range,
const CSSParserContext& context,
const CSSParserLocalContext&) const {
- if (range.Peek().Id() == CSSValueID::kNone)
- return css_parsing_utils::ConsumeIdent(range);
+ if (auto* value =
+ css_parsing_utils::ConsumeIdent<CSSValueID::kAuto, CSSValueID::kNone>(
+ range)) {
+ return value;
+ }
CSSValueList* values = CSSValueList::CreateSpaceSeparated();
while (!range.AtEnd()) {
CSSStringValue* parsed_value = css_parsing_utils::ConsumeString(range);
@@ -4936,11 +5076,8 @@ const CSSValue* Quotes::CSSValueFromComputedStyleInternal(
const SVGComputedStyle&,
const LayoutObject*,
bool allow_visited_style) const {
- if (!style.Quotes()) {
- // TODO(ramya.v): We should return the quote values that we're actually
- // using.
- return nullptr;
- }
+ if (!style.Quotes())
+ return CSSIdentifierValue::Create(CSSValueID::kAuto);
if (style.Quotes()->size()) {
CSSValueList* list = CSSValueList::CreateSpaceSeparated();
for (int i = 0; i < style.Quotes()->size(); i++) {
@@ -7131,7 +7268,7 @@ const CSSValue* WebkitBoxReflect::CSSValueFromComputedStyleInternal(
allow_visited_style);
}
-const CSSValue* WebkitFontSizeDelta::ParseSingleValue(
+const CSSValue* InternalFontSizeDelta::ParseSingleValue(
CSSParserTokenRange& range,
const CSSParserContext& context,
const CSSParserLocalContext&) const {
@@ -8233,10 +8370,7 @@ const CSSValue* Zoom::ParseSingleValue(CSSParserTokenRange& range,
const CSSParserToken& token = range.Peek();
CSSValue* zoom = nullptr;
if (token.GetType() == kIdentToken) {
- CSSIdentifierValue* ident = css_parsing_utils::ConsumeIdent<
- CSSValueID::kNormal, CSSValueID::kInternalResetEffective>(range);
- if (ident && isValueAllowedInMode(ident->GetValueID(), context.Mode()))
- zoom = ident;
+ zoom = css_parsing_utils::ConsumeIdent<CSSValueID::kNormal>(range);
} else {
zoom = css_parsing_utils::ConsumePercent(range, context,
kValueRangeNonNegative);
@@ -8274,14 +8408,6 @@ void Zoom::ApplyInherit(StyleResolverState& state) const {
}
void Zoom::ApplyValue(StyleResolverState& state, const CSSValue& value) const {
- // TODO(crbug.com/976224): Support zoom on foreignObject
- if (const auto* ident = DynamicTo<CSSIdentifierValue>(value)) {
- if (ident->GetValueID() == CSSValueID::kInternalResetEffective) {
- state.SetEffectiveZoom(ComputedStyleInitialValues::InitialZoom());
- return;
- }
- }
-
state.SetZoom(StyleBuilderConverter::ConvertZoom(state, value));
}
diff --git a/chromium/third_party/blink/renderer/core/css/properties/shorthands/shorthands_custom.cc b/chromium/third_party/blink/renderer/core/css/properties/shorthands/shorthands_custom.cc
index d8399559a71..47bd06e633f 100644
--- a/chromium/third_party/blink/renderer/core/css/properties/shorthands/shorthands_custom.cc
+++ b/chromium/third_party/blink/renderer/core/css/properties/shorthands/shorthands_custom.cc
@@ -23,7 +23,7 @@
#include "third_party/blink/renderer/core/css/properties/shorthands.h"
#include "third_party/blink/renderer/core/css/zoom_adjusted_pixel_value.h"
#include "third_party/blink/renderer/core/layout/layout_object.h"
-#include "third_party/blink/renderer/core/layout/layout_theme.h"
+#include "third_party/blink/renderer/core/layout/layout_theme_font_provider.h"
#include "third_party/blink/renderer/core/style/computed_style.h"
#include "third_party/blink/renderer/core/style_property_shorthand.h"
#include "third_party/blink/renderer/platform/runtime_enabled_features.h"
@@ -1011,16 +1011,16 @@ bool ConsumeSystemFont(bool important,
if (!range.AtEnd())
return false;
- FontSelectionValue font_style = NormalSlopeValue();
+ FontSelectionValue font_slope = NormalSlopeValue();
FontSelectionValue font_weight = NormalWeightValue();
float font_size = 0;
AtomicString font_family;
- LayoutTheme::GetTheme().SystemFont(system_font_id, font_style, font_weight,
- font_size, font_family);
+ LayoutThemeFontProvider::SystemFont(system_font_id, font_slope, font_weight,
+ font_size, font_family);
css_parsing_utils::AddProperty(
CSSPropertyID::kFontStyle, CSSPropertyID::kFont,
- *CSSIdentifierValue::Create(font_style == ItalicSlopeValue()
+ *CSSIdentifierValue::Create(font_slope == ItalicSlopeValue()
? CSSValueID::kItalic
: CSSValueID::kNormal),
important, css_parsing_utils::IsImplicitProperty::kNotImplicit,