Commit 755a9214 authored by Fredrik Söderquist's avatar Fredrik Söderquist Committed by Commit Bot

Serialize 'oblique' computed values for 'font-style'

Handling of 'oblique' values were missing in
ComputedStyleUtils::ValueForFontStyle - serialize as 'oblique <angle>'.
Because of this the return value needs to be widened to CSSValue.

Bug: 809935, 809938
Change-Id: I1de846595ed955455d57ab9f6ea45326e502a65b
Reviewed-on: https://chromium-review.googlesource.com/995273Reviewed-by: default avatarDominik Röttsches <drott@chromium.org>
Commit-Queue: Fredrik Söderquist <fs@opera.com>
Cr-Commit-Position: refs/heads/master@{#548044}
parent 1eaa59e0
...@@ -2264,9 +2264,8 @@ crbug.com/626703 [ Debug ] external/wpt/html/semantics/tabular-data/processing-m ...@@ -2264,9 +2264,8 @@ crbug.com/626703 [ Debug ] external/wpt/html/semantics/tabular-data/processing-m
crbug.com/666993 external/wpt/requestidlecallback/callback-idle-periods.html [ Timeout ] crbug.com/666993 external/wpt/requestidlecallback/callback-idle-periods.html [ Timeout ]
# Crashes with DCHECK enabled, but not on normal Release builds. # Crashes with DCHECK enabled, but not on normal Release builds.
crbug.com/828746 external/wpt/css/css-fonts/variations/font-shorthand.html [ Pass Crash Failure ] crbug.com/809935 external/wpt/css/css-fonts/variations/font-style-interpolation.html [ Timeout ]
crbug.com/828746 external/wpt/css/css-fonts/variations/font-style-interpolation.html [ Pass Crash Timeout ] crbug.com/828748 external/wpt/css/css-fonts/variations/font-weight-lighter-bolder.html [ Pass Crash Failure ]
crbug.com/828747 external/wpt/css/css-fonts/variations/font-weight-lighter-bolder.html [ Pass Crash Failure ]
crbug.com/626703 external/wpt/css/css-ui/text-overflow-011.html [ Failure Crash Pass ] crbug.com/626703 external/wpt/css/css-ui/text-overflow-011.html [ Failure Crash Pass ]
crbug.com/626703 external/wpt/workers/opaque-origin.html [ Failure Crash Timeout ] crbug.com/626703 external/wpt/workers/opaque-origin.html [ Failure Crash Timeout ]
crbug.com/626703 external/wpt/html/rendering/non-replaced-elements/margin-collapsing-quirks/multicol-quirks-mode.html [ Pass Crash ] crbug.com/626703 external/wpt/html/rendering/non-replaced-elements/margin-collapsing-quirks/multicol-quirks-mode.html [ Pass Crash ]
......
...@@ -11,6 +11,7 @@ ...@@ -11,6 +11,7 @@
#include "core/css/CSSCounterValue.h" #include "core/css/CSSCounterValue.h"
#include "core/css/CSSCustomIdentValue.h" #include "core/css/CSSCustomIdentValue.h"
#include "core/css/CSSFontFamilyValue.h" #include "core/css/CSSFontFamilyValue.h"
#include "core/css/CSSFontStyleRangeValue.h"
#include "core/css/CSSFunctionValue.h" #include "core/css/CSSFunctionValue.h"
#include "core/css/CSSGridLineNamesValue.h" #include "core/css/CSSGridLineNamesValue.h"
#include "core/css/CSSInitialValue.h" #include "core/css/CSSInitialValue.h"
...@@ -745,8 +746,7 @@ CSSPrimitiveValue* ComputedStyleUtils::ValueForFontStretch( ...@@ -745,8 +746,7 @@ CSSPrimitiveValue* ComputedStyleUtils::ValueForFontStretch(
CSSPrimitiveValue::UnitType::kPercentage); CSSPrimitiveValue::UnitType::kPercentage);
} }
CSSIdentifierValue* ComputedStyleUtils::ValueForFontStyle( CSSValue* ComputedStyleUtils::ValueForFontStyle(const ComputedStyle& style) {
const ComputedStyle& style) {
FontSelectionValue angle = style.GetFontDescription().Style(); FontSelectionValue angle = style.GetFontDescription().Style();
if (angle == NormalSlopeValue()) { if (angle == NormalSlopeValue()) {
return CSSIdentifierValue::Create(CSSValueNormal); return CSSIdentifierValue::Create(CSSValueNormal);
...@@ -756,8 +756,14 @@ CSSIdentifierValue* ComputedStyleUtils::ValueForFontStyle( ...@@ -756,8 +756,14 @@ CSSIdentifierValue* ComputedStyleUtils::ValueForFontStyle(
return CSSIdentifierValue::Create(CSSValueItalic); return CSSIdentifierValue::Create(CSSValueItalic);
} }
NOTREACHED(); // The spec says: 'The lack of a number represents an angle of
return CSSIdentifierValue::Create(CSSValueNormal); // "20deg"', but since we compute that to 'italic' (handled above),
// we don't perform any special treatment of that value here.
CSSValueList* oblique_values = CSSValueList::CreateSpaceSeparated();
oblique_values->Append(
*CSSPrimitiveValue::Create(angle, CSSPrimitiveValue::UnitType::kDegrees));
return CSSFontStyleRangeValue::Create(
*CSSIdentifierValue::Create(CSSValueOblique), *oblique_values);
} }
CSSPrimitiveValue* ComputedStyleUtils::ValueForFontWeight( CSSPrimitiveValue* ComputedStyleUtils::ValueForFontWeight(
......
...@@ -102,7 +102,7 @@ class ComputedStyleUtils { ...@@ -102,7 +102,7 @@ class ComputedStyleUtils {
static CSSValueList* ValueForFontFamily(const ComputedStyle&); static CSSValueList* ValueForFontFamily(const ComputedStyle&);
static CSSPrimitiveValue* ValueForFontSize(const ComputedStyle&); static CSSPrimitiveValue* ValueForFontSize(const ComputedStyle&);
static CSSPrimitiveValue* ValueForFontStretch(const ComputedStyle&); static CSSPrimitiveValue* ValueForFontStretch(const ComputedStyle&);
static CSSIdentifierValue* ValueForFontStyle(const ComputedStyle&); static CSSValue* ValueForFontStyle(const ComputedStyle&);
static CSSPrimitiveValue* ValueForFontWeight(const ComputedStyle&); static CSSPrimitiveValue* ValueForFontWeight(const ComputedStyle&);
static CSSIdentifierValue* ValueForFontVariantCaps(const ComputedStyle&); static CSSIdentifierValue* ValueForFontVariantCaps(const ComputedStyle&);
static CSSValue* ValueForFontVariantLigatures(const ComputedStyle&); static CSSValue* ValueForFontVariantLigatures(const ComputedStyle&);
......
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