Commit 976b8923 authored by HyunJi Kim's avatar HyunJi Kim Committed by Commit Bot

Remove webkit-font-size-delta

Deprecate `-webkit-font-size-delta` due to low usage(0.007%)
and replace it with `-internal-font-size-delta` for Editing module

Intent : https://groups.google.com/a/chromium.org/d/msg/blink-dev/p1D2Fj8WTe0/p6uQY-oACAAJ
Status Entry : https://chromestatus.com/feature/6267981828980736

Bug: 974092
Change-Id: I4b25c537d47eef508094bdfc498c824aaafeed2b
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2358723Reviewed-by: default avatarRune Lillesveen <futhark@chromium.org>
Reviewed-by: default avatarKent Tamura <tkent@chromium.org>
Reviewed-by: default avatarXiaocheng Hu <xiaochengh@chromium.org>
Reviewed-by: default avatarEric Willigers <ericwilligers@chromium.org>
Commit-Queue: Eric Willigers <ericwilligers@chromium.org>
Cr-Commit-Position: refs/heads/master@{#802043}
parent 1b64b663
......@@ -36,6 +36,7 @@ enum CSSSampleId {
kInternalVisitedTextEmphasisColor = 0,
kInternalVisitedTextFillColor = 0,
kInternalVisitedTextStrokeColor = 0,
kInternalFontSizeDelta = 0,
// This CSSSampleId represents page load for CSS histograms. It is recorded once
// per page visit for each CSS histogram being logged on the blink side and the
......@@ -284,7 +285,7 @@ enum CSSSampleId {
kFlexShrink = 238,
kFlexWrap = 239,
kJustifyContent = 240,
kWebkitFontSizeDelta = 241,
// kWebkitFontSizeDelta = 241,
kGridTemplateColumns = 242,
kGridTemplateRows = 243,
kGridColumnStart = 244,
......
......@@ -5025,8 +5025,10 @@
affected_by_all: false,
style_builder_template: "empty",
},
// TODO(hjkim3323@gmail.com): Remove -internal-font-size-delta.
// fontSizeDelta execCommand does not need separate CSS property.
{
name: "-webkit-font-size-delta",
name: "-internal-font-size-delta",
property_methods: ["ParseSingleValue"],
style_builder_template: "empty",
},
......
......@@ -121,9 +121,11 @@ static bool IsPropertyMatch(const CSSPropertyValueMetadata& metadata,
CSSPropertyID property_id) {
DCHECK_EQ(id, static_cast<uint16_t>(property_id));
bool result = static_cast<uint16_t>(metadata.PropertyID()) == id;
// Only enabled properties should be part of the style.
// Only enabled properties except kInternalFontSizeDelta should be part of the
// style.
// TODO(hjkim3323@gmail.com): Remove kInternalFontSizeDelta bypassing hack
#if DCHECK_IS_ON()
DCHECK(!result ||
DCHECK(!result || property_id == CSSPropertyID::kInternalFontSizeDelta ||
CSSProperty::Get(resolveCSSPropertyID(property_id)).IsWebExposed());
#endif
return result;
......
......@@ -1006,7 +1006,6 @@ const std::string Converter::kPropertyLookupTable[] = {
"max-block-size",
"-webkit-animation-play-state",
"border-image-repeat",
"-webkit-font-size-delta",
"scroll-padding-bottom",
"border-right-style",
"border-left-style",
......
......@@ -82,6 +82,11 @@ TEST_F(CSSPropertyTest, InternalResetEffectiveNotWebExposed) {
EXPECT_FALSE(author_set->HasProperty(CSSPropertyID::kZoom));
}
TEST_F(CSSPropertyTest, InternalFontSizeDeltaNotWebExposed) {
ASSERT_FALSE(
CSSProperty::Get(CSSPropertyID::kInternalFontSizeDelta).IsWebExposed());
}
TEST_F(CSSPropertyTest, VisitedPropertiesCanParseValues) {
scoped_refptr<ComputedStyle> initial_style = ComputedStyle::Create();
......
......@@ -7131,7 +7131,7 @@ const CSSValue* WebkitBoxReflect::CSSValueFromComputedStyleInternal(
allow_visited_style);
}
const CSSValue* WebkitFontSizeDelta::ParseSingleValue(
const CSSValue* InternalFontSizeDelta::ParseSingleValue(
CSSParserTokenRange& range,
const CSSParserContext& context,
const CSSParserLocalContext&) const {
......
......@@ -92,9 +92,8 @@ TEST_F(ApplyStyleCommandTest, FontSizeDeltaWithSpanElement) {
"<div contenteditable>^<div></div>a<span></span>|</div>"),
SetSelectionOptions());
auto* style =
MakeGarbageCollected<MutableCSSPropertyValueSet>(kHTMLQuirksMode);
style->SetProperty(CSSPropertyID::kWebkitFontSizeDelta, "3",
auto* style = MakeGarbageCollected<MutableCSSPropertyValueSet>(kUASheetMode);
style->SetProperty(CSSPropertyID::kInternalFontSizeDelta, "3px",
/* important */ false,
GetFrame().DomWindow()->GetSecureContextMode());
MakeGarbageCollected<ApplyStyleCommand>(
......
......@@ -162,8 +162,10 @@ bool StyleCommands::ExecuteFontSizeDelta(LocalFrame& frame,
Event*,
EditorCommandSource source,
const String& value) {
// TODO(hjkim3323@gmail.com): Directly set EditingStyle::font_size_delta_
// instead of setting it via CSS property
return ExecuteApplyStyle(frame, source, InputEvent::InputType::kNone,
CSSPropertyID::kWebkitFontSizeDelta, value);
CSSPropertyID::kInternalFontSizeDelta, value);
}
bool StyleCommands::ExecuteMakeTextWritingDirectionLeftToRight(
......@@ -625,7 +627,7 @@ String StyleCommands::ValueFontSize(const EditorInternalCommand&,
String StyleCommands::ValueFontSizeDelta(const EditorInternalCommand&,
LocalFrame& frame,
Event*) {
return ValueStyle(frame, CSSPropertyID::kWebkitFontSizeDelta);
return ValueStyle(frame, CSSPropertyID::kInternalFontSizeDelta);
}
} // namespace blink
......@@ -610,13 +610,13 @@ void EditingStyle::ExtractFontSizeDelta() {
if (mutable_style_->GetPropertyCSSValue(CSSPropertyID::kFontSize)) {
// Explicit font size overrides any delta.
mutable_style_->RemoveProperty(CSSPropertyID::kWebkitFontSizeDelta);
mutable_style_->RemoveProperty(CSSPropertyID::kInternalFontSizeDelta);
return;
}
// Get the adjustment amount out of the style.
const CSSValue* value =
mutable_style_->GetPropertyCSSValue(CSSPropertyID::kWebkitFontSizeDelta);
const CSSValue* value = mutable_style_->GetPropertyCSSValue(
CSSPropertyID::kInternalFontSizeDelta);
const auto* primitive_value = DynamicTo<CSSPrimitiveValue>(value);
if (!primitive_value)
return;
......@@ -627,7 +627,7 @@ void EditingStyle::ExtractFontSizeDelta() {
return;
font_size_delta_ = primitive_value->GetFloatValue();
mutable_style_->RemoveProperty(CSSPropertyID::kWebkitFontSizeDelta);
mutable_style_->RemoveProperty(CSSPropertyID::kInternalFontSizeDelta);
}
bool EditingStyle::IsEmpty() const {
......
......@@ -440,7 +440,6 @@ webkitFlexGrow
webkitFlexShrink
webkitFlexWrap
webkitFontFeatureSettings
webkitFontSizeDelta
webkitFontSmoothing
webkitHighlight
webkitHyphenateCharacter
......
......@@ -14,7 +14,6 @@ All changes to this list should go through Blink's feature review process: http:
-webkit-box-orient
-webkit-box-pack
-webkit-box-reflect
-webkit-font-size-delta
-webkit-font-smoothing
-webkit-highlight
-webkit-hyphenate-character
......
......@@ -479,7 +479,6 @@ webkitFlexGrow
webkitFlexShrink
webkitFlexWrap
webkitFontFeatureSettings
webkitFontSizeDelta
webkitFontSmoothing
webkitHighlight
webkitHyphenateCharacter
......
......@@ -14,7 +14,6 @@ All changes to this list should go through Blink's feature review process: http:
-webkit-box-orient
-webkit-box-pack
-webkit-box-reflect
-webkit-font-size-delta
-webkit-font-smoothing
-webkit-highlight
-webkit-hyphenate-character
......
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