Commit 3a72daae authored by bdakin@apple.com's avatar bdakin@apple.com
Browse files

WebCore: Fix for <rdar://problem/6934421> Support CSS for Text Kerning and

ligature
-and corresponding-
https://bugs.webkit.org/show_bug.cgi?id=6136

Reviewed by Dave Hyatt.

This patch makes the SVG CSS property text-rendering work with any 
HTML, much like it does in Firefox. It accepts four possible input 
values: auto, optimizeSpeed, optimizeLegibility, and 
geometricPrecision. Right now, in this implementation, here is what 
those values correspond to:

auto = optimizeSpeed = what we normally when the value's not set
optimizeLegibility = geometricPrecision = ligatures + kerning

Add new file TextRenderingMode.h to the project files.
* WebCore.vcproj/WebCore.vcproj:
* WebCore.xcodeproj/project.pbxproj:

CSS support for the new CSSPropertyTextRendering
* css/CSSComputedStyleDeclaration.cpp:
(WebCore::):
(WebCore::CSSComputedStyleDeclaration::getPropertyCSSValue):
* css/CSSParser.cpp:
(WebCore::CSSParser::parseValue):
* css/CSSPrimitiveValueMappings.h:
(WebCore::CSSPrimitiveValue::CSSPrimitiveValue):
(WebCore::CSSPrimitiveValue::operator TextRenderingMode):
* css/CSSPropertyNames.in:
* css/CSSStyleSelector.cpp:
(WebCore::CSSStyleSelector::applyProperty):
* css/CSSValueKeywords.in:

All the old SVG CSS support for this property can go away. When 
it's used in SVG, it will just fall into the normal HTML case.
* css/SVGCSSComputedStyleDeclaration.cpp:
(WebCore::CSSComputedStyleDeclaration::getSVGPropertyCSSValue):
* css/SVGCSSParser.cpp:
(WebCore::CSSParser::parseSVGValue):
* css/SVGCSSPropertyNames.in:
* css/SVGCSSStyleSelector.cpp:
(WebCore::CSSStyleSelector::applySVGProperty):
* css/SVGCSSValueKeywords.in:

FontDescription stores the m_textRendering bit.
* platform/graphics/FontDescription.h:
(WebCore::FontDescription::FontDescription):
(WebCore::FontDescription::textRenderingMode):
(WebCore::FontDescription::setTextRenderingMode):
(WebCore::FontDescription::operator==):

We want to fall into the complex text rendering code path if 
kerning and ligatures have been enabled with this property.
* platform/graphics/FontFastPath.cpp:
(WebCore::Font::canUseGlyphCache):

Now takes a TextRenderingMode as a parameter.
* platform/graphics/SimpleFontData.h:

New header for the enum.
* platform/graphics/TextRenderingMode.h: Added.
(WebCore::):

getCFStringAttributes() now takes a TextRenderingMode as an 
attribute.
* platform/graphics/mac/CoreTextController.cpp:
(WebCore::CoreTextController::collectCoreTextRunsForCharacters):

Enable kerning and ligatures whenever the TextRenderingMode is 
OptimizeLegibility or GeometricPrecision
* platform/graphics/mac/FontMacATSUI.mm:
(WebCore::disableLigatures):
(WebCore::initializeATSUStyle):
(WebCore::ATSULayoutParameters::initialize):
* platform/graphics/mac/SimpleFontDataMac.mm:
(WebCore::SimpleFontData::getCFStringAttributes):

More SVG CSS stuff that isn't needed anymore since SVG will use the 
new HTML CSS implementation.
* rendering/style/SVGRenderStyle.h:
(WebCore::SVGRenderStyle::InheritedFlags::operator==):
(WebCore::SVGRenderStyle::setBitDefaults):
* rendering/style/SVGRenderStyleDefs.h:

LayoutTests: Tests for <rdar://problem/6934421> Support CSS for Text Kerning and 
ligature
-and corresponding-
https://bugs.webkit.org/show_bug.cgi?id=6136

Reviewed by Dave Hyatt.

New tests.
* fast/css/parsing-text-rendering-expected.txt: Added.
* fast/css/parsing-text-rendering.html: Added.
* fast/css/resources/parsing-text-rendering.js: Added.
(test):
* fast/css/text-rendering.html: Added.
* platform/mac/fast/css/text-rendering-expected.checksum: Added.
* platform/mac/fast/css/text-rendering-expected.png: Added.
* platform/mac/fast/css/text-rendering-expected.txt: Added.

New and improved results.
* platform/mac/fast/css/getComputedStyle/computed-style-expected.txt:
* platform/mac/fast/css/getComputedStyle/computed-style-without-renderer-expected.txt:
* platform/mac/svg/W3C-SVG-1.1/filters-conv-01-f-expected.checksum:
* platform/mac/svg/W3C-SVG-1.1/filters-conv-01-f-expected.png:
* platform/mac/svg/W3C-SVG-1.1/filters-conv-01-f-expected.txt:
* svg/css/getComputedStyle-basic-expected.txt:



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@48989 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent e59a07dd
2009-10-01 Beth Dakin <bdakin@apple.com>
Reviewed by Dave Hyatt.
Tests for <rdar://problem/6934421> Support CSS for Text Kerning and
ligature
-and corresponding-
https://bugs.webkit.org/show_bug.cgi?id=6136
New tests.
* fast/css/parsing-text-rendering-expected.txt: Added.
* fast/css/parsing-text-rendering.html: Added.
* fast/css/resources/parsing-text-rendering.js: Added.
(test):
* fast/css/text-rendering.html: Added.
* platform/mac/fast/css/text-rendering-expected.checksum: Added.
* platform/mac/fast/css/text-rendering-expected.png: Added.
* platform/mac/fast/css/text-rendering-expected.txt: Added.
New and improved results.
* platform/mac/fast/css/getComputedStyle/computed-style-expected.txt:
* platform/mac/fast/css/getComputedStyle/computed-style-without-renderer-expected.txt:
* platform/mac/svg/W3C-SVG-1.1/filters-conv-01-f-expected.checksum:
* platform/mac/svg/W3C-SVG-1.1/filters-conv-01-f-expected.png:
* platform/mac/svg/W3C-SVG-1.1/filters-conv-01-f-expected.txt:
* svg/css/getComputedStyle-basic-expected.txt:
2009-10-01 Nate Chapin <japhet@chromium.org>
 
Reviewed by Darin Adler.
......
This tests checks that all of the input values for background-repeat parse correctly.
On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
PASS test("text-rendering: auto;") is "auto"
PASS test("text-rendering: optimizeSpeed;") is "optimizespeed"
PASS test("text-rendering: optimizeLegibility;") is "optimizelegibility"
PASS test("text-rendering: geometricPrecision;") is "geometricprecision"
PASS test("text-rendering: auto auto;") is null
PASS test("text-rendering: optimizeCoconuts;") is null
PASS test("text-rendering: 15;") is null
PASS successfullyParsed is true
TEST COMPLETE
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
<html>
<head>
<link rel="stylesheet" href="../js/resources/js-test-style.css">
<script src="../js/resources/js-test-pre.js"></script>
</head>
<body>
<p id="description"></p>
<div id="console"></div>
<script src="resources/parsing-text-rendering.js"></script>
<script src="../js/resources/js-test-post.js"></script>
</body>
</html>
description("This tests checks that all of the input values for background-repeat parse correctly.");
function test(value)
{
var div = document.createElement("div");
div.setAttribute("style", value);
document.body.appendChild(div);
var result = div.style.getPropertyValue("text-rendering");
document.body.removeChild(div);
return result;
}
shouldBe('test("text-rendering: auto;")', '"auto"');
shouldBe('test("text-rendering: optimizeSpeed;")', '"optimizespeed"');
shouldBe('test("text-rendering: optimizeLegibility;")', '"optimizelegibility"');
shouldBe('test("text-rendering: geometricPrecision;")', '"geometricprecision"');
shouldBeNull('test("text-rendering: auto auto;")');
shouldBeNull('test("text-rendering: optimizeCoconuts;")');
shouldBeNull('test("text-rendering: 15;")');
var successfullyParsed = true;
<span style="font-size:60px; text-rendering: auto">fin LYAWA (No kerning or ligatures)</span>
<br>
<span style="font-size:60px; text-rendering: optimizeSpeed">fin LYAWA (No kerning or ligatures)</span>
<br>
<span style="font-size:60px; text-rendering: optimizeLegibility">fin LYAWA (Kerning and ligatures)</span>
<br>
<span style="font-size:60px; text-rendering: geometricPrecision">fin LYAWA (Kerning and ligatures)</span>
<br>
......@@ -78,6 +78,7 @@ table-layout: auto;
text-align: auto;
text-decoration: none;
text-indent: 0px;
text-rendering: auto;
text-shadow: none;
text-overflow: clip;
text-transform: none;
......@@ -195,7 +196,6 @@ stroke-linejoin: miter;
stroke-miterlimit: 4;
stroke-opacity: 1;
stroke-width: ;
text-rendering: auto;
alignment-baseline: auto;
baseline-shift: baseline;
dominant-baseline: auto;
......
......@@ -77,6 +77,7 @@ Computed style of an element whose parent's 'display' value is 'none':
text-align: auto
text-decoration: none
text-indent: 0px
text-rendering: auto
text-shadow: none
text-overflow: clip
text-transform: none
......@@ -194,7 +195,6 @@ Computed style of an element whose parent's 'display' value is 'none':
stroke-miterlimit: 4
stroke-opacity: 1
stroke-width:
text-rendering: auto
alignment-baseline: auto
baseline-shift: baseline
dominant-baseline: auto
......
4e5c6286a59b4a606973f7d932046bc3
\ No newline at end of file
layer at (0,0) size 800x600
RenderView at (0,0) size 800x600
layer at (0,0) size 800x600
RenderBlock {HTML} at (0,0) size 800x600
RenderBody {BODY} at (8,8) size 784x584
RenderInline {SPAN} at (0,0) size 677x138
RenderText {#text} at (0,0) size 677x138
text run at (0,0) width 677: "fin LYAWA (No kerning or"
text run at (0,69) width 228: "ligatures)"
RenderText {#text} at (228,109) size 4x18
text run at (228,109) width 4: " "
RenderBR {BR} at (232,123) size 0x0
RenderInline {SPAN} at (0,0) size 677x138
RenderText {#text} at (0,138) size 677x138
text run at (0,138) width 677: "fin LYAWA (No kerning or"
text run at (0,207) width 228: "ligatures)"
RenderText {#text} at (228,247) size 4x18
text run at (228,247) width 4: " "
RenderBR {BR} at (232,261) size 0x0
RenderInline {SPAN} at (0,0) size 609x138
RenderText {#text} at (0,276) size 609x138
text run at (0,276) width 609: "fin LYAWA (Kerning and"
text run at (0,345) width 228: "ligatures)"
RenderText {#text} at (228,385) size 4x18
text run at (228,385) width 4: " "
RenderBR {BR} at (232,399) size 0x0
RenderInline {SPAN} at (0,0) size 609x138
RenderText {#text} at (0,414) size 609x138
text run at (0,414) width 609: "fin LYAWA (Kerning and"
text run at (0,483) width 228: "ligatures)"
RenderText {#text} at (228,523) size 4x18
text run at (228,523) width 4: " "
RenderBR {BR} at (232,537) size 0x0
1469ff180d877f6e84ea57f95fe607ee
\ No newline at end of file
f6989b1d7f0b27b4e47df6802ee1cec9
\ No newline at end of file
......@@ -33,7 +33,7 @@ layer at (0,0) size 480x360
RenderSVGImage {image} at (180,163) size 50x63 [filter=convolve5]
RenderSVGText {text} at (10,20) size 117x18 contains 1 chunk(s)
RenderSVGInlineText {#text} at (0,-14) size 117x18
chunk 1 text run 1 at (10.00,20.00) startOffset 0 endOffset 19 width 117.00: "Vertical blur (1x3)"
chunk 1 text run 1 at (10.00,20.00) startOffset 0 endOffset 19 width 115.00: "Vertical blur (1x3)"
RenderSVGContainer {g} at (330,163) size 50x63 [transform={m=((1.00,0.00)(0.00,1.00)) t=(300.00,93.00)}]
RenderSVGImage {image} at (330,163) size 50x63 [filter=convolve6]
RenderSVGText {text} at (10,340) size 264x46 contains 1 chunk(s)
......
......@@ -154,6 +154,8 @@ rect: style.getPropertyValue(text-decoration) : none
rect: style.getPropertyCSSValue(text-decoration) : [object CSSPrimitiveValue]
rect: style.getPropertyValue(text-indent) : 0px
rect: style.getPropertyCSSValue(text-indent) : [object CSSPrimitiveValue]
rect: style.getPropertyValue(text-rendering) : auto
rect: style.getPropertyCSSValue(text-rendering) : [object CSSPrimitiveValue]
rect: style.getPropertyValue(text-shadow) : none
rect: style.getPropertyCSSValue(text-shadow) : [object CSSPrimitiveValue]
rect: style.getPropertyValue(text-overflow) : clip
......@@ -388,8 +390,6 @@ rect: style.getPropertyValue(stroke-opacity) : 1
rect: style.getPropertyCSSValue(stroke-opacity) : [object CSSPrimitiveValue]
rect: style.getPropertyValue(stroke-width) : 2px
rect: style.getPropertyCSSValue(stroke-width) : [object CSSPrimitiveValue]
rect: style.getPropertyValue(text-rendering) : auto
rect: style.getPropertyCSSValue(text-rendering) : [object CSSPrimitiveValue]
rect: style.getPropertyValue(alignment-baseline) : auto
rect: style.getPropertyCSSValue(alignment-baseline) : [object CSSPrimitiveValue]
rect: style.getPropertyValue(baseline-shift) : baseline
......@@ -562,6 +562,8 @@ g: style.getPropertyValue(text-decoration) : none
g: style.getPropertyCSSValue(text-decoration) : [object CSSPrimitiveValue]
g: style.getPropertyValue(text-indent) : 0px
g: style.getPropertyCSSValue(text-indent) : [object CSSPrimitiveValue]
g: style.getPropertyValue(text-rendering) : auto
g: style.getPropertyCSSValue(text-rendering) : [object CSSPrimitiveValue]
g: style.getPropertyValue(text-shadow) : none
g: style.getPropertyCSSValue(text-shadow) : [object CSSPrimitiveValue]
g: style.getPropertyValue(text-overflow) : clip
......@@ -796,8 +798,6 @@ g: style.getPropertyValue(stroke-opacity) : 1
g: style.getPropertyCSSValue(stroke-opacity) : [object CSSPrimitiveValue]
g: style.getPropertyValue(stroke-width) : 2px
g: style.getPropertyCSSValue(stroke-width) : [object CSSPrimitiveValue]
g: style.getPropertyValue(text-rendering) : auto
g: style.getPropertyCSSValue(text-rendering) : [object CSSPrimitiveValue]
g: style.getPropertyValue(alignment-baseline) : auto
g: style.getPropertyCSSValue(alignment-baseline) : [object CSSPrimitiveValue]
g: style.getPropertyValue(baseline-shift) : baseline
......
2009-10-01 Beth Dakin <bdakin@apple.com>
Reviewed by Dave Hyatt.
Fix for <rdar://problem/6934421> Support CSS for Text Kerning and
ligature
-and corresponding-
https://bugs.webkit.org/show_bug.cgi?id=6136
This patch makes the SVG CSS property text-rendering work with any
HTML, much like it does in Firefox. It accepts four possible input
values: auto, optimizeSpeed, optimizeLegibility, and
geometricPrecision. Right now, in this implementation, here is what
those values correspond to:
auto = optimizeSpeed = what we normally when the value's not set
optimizeLegibility = geometricPrecision = ligatures + kerning
Add new file TextRenderingMode.h to the project files.
* WebCore.vcproj/WebCore.vcproj:
* WebCore.xcodeproj/project.pbxproj:
CSS support for the new CSSPropertyTextRendering
* css/CSSComputedStyleDeclaration.cpp:
(WebCore::):
(WebCore::CSSComputedStyleDeclaration::getPropertyCSSValue):
* css/CSSParser.cpp:
(WebCore::CSSParser::parseValue):
* css/CSSPrimitiveValueMappings.h:
(WebCore::CSSPrimitiveValue::CSSPrimitiveValue):
(WebCore::CSSPrimitiveValue::operator TextRenderingMode):
* css/CSSPropertyNames.in:
* css/CSSStyleSelector.cpp:
(WebCore::CSSStyleSelector::applyProperty):
* css/CSSValueKeywords.in:
All the old SVG CSS support for this property can go away. When
it's used in SVG, it will just fall into the normal HTML case.
* css/SVGCSSComputedStyleDeclaration.cpp:
(WebCore::CSSComputedStyleDeclaration::getSVGPropertyCSSValue):
* css/SVGCSSParser.cpp:
(WebCore::CSSParser::parseSVGValue):
* css/SVGCSSPropertyNames.in:
* css/SVGCSSStyleSelector.cpp:
(WebCore::CSSStyleSelector::applySVGProperty):
* css/SVGCSSValueKeywords.in:
FontDescription stores the m_textRendering bit.
* platform/graphics/FontDescription.h:
(WebCore::FontDescription::FontDescription):
(WebCore::FontDescription::textRenderingMode):
(WebCore::FontDescription::setTextRenderingMode):
(WebCore::FontDescription::operator==):
We want to fall into the complex text rendering code path if
kerning and ligatures have been enabled with this property.
* platform/graphics/FontFastPath.cpp:
(WebCore::Font::canUseGlyphCache):
Now takes a TextRenderingMode as a parameter.
* platform/graphics/SimpleFontData.h:
New header for the enum.
* platform/graphics/TextRenderingMode.h: Added.
(WebCore::):
getCFStringAttributes() now takes a TextRenderingMode as an
attribute.
* platform/graphics/mac/CoreTextController.cpp:
(WebCore::CoreTextController::collectCoreTextRunsForCharacters):
Enable kerning and ligatures whenever the TextRenderingMode is
OptimizeLegibility or GeometricPrecision
* platform/graphics/mac/FontMacATSUI.mm:
(WebCore::disableLigatures):
(WebCore::initializeATSUStyle):
(WebCore::ATSULayoutParameters::initialize):
* platform/graphics/mac/SimpleFontDataMac.mm:
(WebCore::SimpleFontData::getCFStringAttributes):
More SVG CSS stuff that isn't needed anymore since SVG will use the
new HTML CSS implementation.
* rendering/style/SVGRenderStyle.h:
(WebCore::SVGRenderStyle::InheritedFlags::operator==):
(WebCore::SVGRenderStyle::setBitDefaults):
* rendering/style/SVGRenderStyleDefs.h:
2009-10-01 Yury Semikhatsky <yurys@chromium.org>
 
Reviewed by Timothy Hatcher.
......@@ -32024,6 +32024,10 @@
RelativePath="..\config.h"
>
</File>
<File
RelativePath="..\platform\graphics\TextRenderingMode.h"
>
</File>
<File
RelativePath="..\WebCorePrefix.cpp"
>
......
......@@ -2094,6 +2094,7 @@
9307F1D70AF2D59000DBA31A /* HitTestResult.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 9307F1D50AF2D59000DBA31A /* HitTestResult.cpp */; };
9307F1D80AF2D59000DBA31A /* HitTestResult.h in Headers */ = {isa = PBXBuildFile; fileRef = 9307F1D60AF2D59000DBA31A /* HitTestResult.h */; settings = {ATTRIBUTES = (Private, ); }; };
930908910AF7EDE40081DF01 /* HitTestRequest.h in Headers */ = {isa = PBXBuildFile; fileRef = 930908900AF7EDE40081DF01 /* HitTestRequest.h */; };
930FC68A1072B9280045293E /* TextRenderingMode.h in Headers */ = {isa = PBXBuildFile; fileRef = 930FC6891072B9280045293E /* TextRenderingMode.h */; settings = {ATTRIBUTES = (Private, ); }; };
9326DC0C09DAD5D600AFC847 /* CharsetData.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 656581AC09D14EE6000E61D7 /* CharsetData.cpp */; };
9327A94209968D1A0068A546 /* HTMLOptionsCollection.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 9327A94109968D1A0068A546 /* HTMLOptionsCollection.cpp */; };
932871C00B20DEB70049035A /* PlatformMenuDescription.h in Headers */ = {isa = PBXBuildFile; fileRef = 932871BF0B20DEB70049035A /* PlatformMenuDescription.h */; settings = {ATTRIBUTES = (Private, ); }; };
......@@ -7295,6 +7296,7 @@
9307F1D50AF2D59000DBA31A /* HitTestResult.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = HitTestResult.cpp; sourceTree = "<group>"; };
9307F1D60AF2D59000DBA31A /* HitTestResult.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = HitTestResult.h; sourceTree = "<group>"; };
930908900AF7EDE40081DF01 /* HitTestRequest.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = HitTestRequest.h; sourceTree = "<group>"; };
930FC6891072B9280045293E /* TextRenderingMode.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = TextRenderingMode.h; path = platform/graphics/TextRenderingMode.h; sourceTree = "<group>"; };
9327A94109968D1A0068A546 /* HTMLOptionsCollection.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = HTMLOptionsCollection.cpp; sourceTree = "<group>"; };
932871BF0B20DEB70049035A /* PlatformMenuDescription.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = PlatformMenuDescription.h; sourceTree = "<group>"; };
932E16080AF578340025F408 /* FrameLoader.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = FrameLoader.cpp; sourceTree = "<group>"; };
......@@ -9948,6 +9950,7 @@
034768DFFF38A50411DB9C8B /* Products */,
1CDD44660BA9C80000F90147 /* Configurations */,
449195900FBE175B00D9F824 /* Exports */,
930FC6891072B9280045293E /* TextRenderingMode.h */,
);
name = WebKit;
sourceTree = "<group>";
......@@ -17921,6 +17924,7 @@
7693BAD5106C2DCA007B0823 /* PluginHalterClient.h in Headers */,
BCACF3BD1072921A00C0C8A3 /* UserContentURLPattern.h in Headers */,
5DB1BC6A10715A6400EFAA49 /* TransformSource.h in Headers */,
930FC68A1072B9280045293E /* TextRenderingMode.h in Headers */,
);
runOnlyForDeploymentPostprocessing = 0;
};
......@@ -129,6 +129,7 @@ static const int computedProperties[] = {
CSSPropertyTextAlign,
CSSPropertyTextDecoration,
CSSPropertyTextIndent,
CSSPropertyTextRendering,
CSSPropertyTextShadow,
CSSPropertyTextOverflow,
CSSPropertyTextTransform,
......@@ -252,7 +253,6 @@ static const int computedProperties[] = {
CSSPropertyStrokeMiterlimit,
CSSPropertyStrokeOpacity,
CSSPropertyStrokeWidth,
CSSPropertyTextRendering,
CSSPropertyAlignmentBaseline,
CSSPropertyBaselineShift,
CSSPropertyDominantBaseline,
......@@ -1052,6 +1052,8 @@ PassRefPtr<CSSValue> CSSComputedStyleDeclaration::getPropertyCSSValue(int proper
return CSSPrimitiveValue::create(style->textIndent());
case CSSPropertyTextShadow:
return valueForShadow(style->textShadow(), static_cast<CSSPropertyID>(propertyID));
case CSSPropertyTextRendering:
return CSSPrimitiveValue::create(style->fontDescription().textRenderingMode());
case CSSPropertyTextOverflow:
if (style->textOverflow())
return CSSPrimitiveValue::createIdentifier(CSSValueEllipsis);
......
......@@ -1433,6 +1433,11 @@ bool CSSParser::parseValue(int propId, bool important)
id == CSSValueWave)
valid_primitive = true;
break;
case CSSPropertyTextRendering: // auto | optimizeSpeed | optimizeLegibility | geometricPrecision
if (id == CSSValueAuto || id == CSSValueOptimizespeed || id == CSSValueOptimizelegibility
|| id == CSSValueGeometricprecision)
valid_primitive = true;
break;
case CSSPropertyTextLineThroughWidth:
case CSSPropertyTextOverlineWidth:
case CSSPropertyTextUnderlineWidth:
......
......@@ -36,6 +36,7 @@
#include "RenderStyleConstants.h"
#include "SVGRenderStyleDefs.h"
#include "TextDirection.h"
#include "TextRenderingMode.h"
#include "ThemeTypes.h"
namespace WebCore {
......@@ -2241,39 +2242,39 @@ template<> inline CSSPrimitiveValue::operator ETextAnchor() const
}
}
template<> inline CSSPrimitiveValue::CSSPrimitiveValue(ETextRendering e)
template<> inline CSSPrimitiveValue::CSSPrimitiveValue(TextRenderingMode e)
: m_type(CSS_IDENT)
{
switch (e) {
case TR_AUTO:
case AutoTextRendering:
m_value.ident = CSSValueAuto;
break;
case TR_OPTIMIZESPEED:
case OptimizeSpeed:
m_value.ident = CSSValueOptimizespeed;
break;
case TR_OPTIMIZELEGIBILITY:
case OptimizeLegibility:
m_value.ident = CSSValueOptimizelegibility;
break;
case TR_GEOMETRICPRECISION:
case GeometricPrecision:
m_value.ident = CSSValueGeometricprecision;
break;
}
}
template<> inline CSSPrimitiveValue::operator ETextRendering() const
template<> inline CSSPrimitiveValue::operator TextRenderingMode() const
{
switch (m_value.ident) {
case CSSValueAuto:
return TR_AUTO;
return AutoTextRendering;
case CSSValueOptimizespeed:
return TR_OPTIMIZESPEED;
return OptimizeSpeed;
case CSSValueOptimizelegibility:
return TR_OPTIMIZELEGIBILITY;
return OptimizeLegibility;
case CSSValueGeometricprecision:
return TR_GEOMETRICPRECISION;
return GeometricPrecision;
default:
ASSERT_NOT_REACHED();
return TR_AUTO;
return AutoTextRendering;
}
}
......
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