Changeset 207757 in webkit
- Timestamp:
- Oct 24, 2016 7:39:40 AM (7 years ago)
- Location:
- trunk
- Files:
-
- 28 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r207756 r207757 1 2016-10-24 Dave Hyatt <hyatt@apple.com> 2 3 [CSS Parser] Unprefix -webkit-writing-mode 4 https://bugs.webkit.org/show_bug.cgi?id=163870 5 6 Reviewed by Zalan Bujtas. 7 8 * fast/css/getComputedStyle/computed-style-expected.txt: 9 * fast/css/getComputedStyle/computed-style-without-renderer-expected.txt: 10 * platform/mac/svg/W3C-SVG-1.1/text-align-06-b-expected.txt: 11 * platform/mac/svg/text/text-align-06-b-expected.txt: 12 * svg/css/getComputedStyle-basic-expected.txt: 13 1 14 2016-10-24 Youenn Fablet <youenn@apple.com> 2 15 -
trunk/LayoutTests/fast/css/getComputedStyle/computed-style-expected.txt
r205809 r207757 218 218 -webkit-user-modify: read-only; 219 219 -webkit-user-select: text; 220 -webkit-writing-mode: horizontal-tb;221 220 clip-path: none; 222 221 clip-rule: nonzero; … … 251 250 kerning: 0; 252 251 text-anchor: start; 253 writing-mode: lr-tb;252 writing-mode: horizontal-tb; 254 253 glyph-orientation-horizontal: 0deg; 255 254 glyph-orientation-vertical: auto; -
trunk/LayoutTests/fast/css/getComputedStyle/computed-style-without-renderer-expected.txt
r205809 r207757 217 217 -webkit-user-modify: read-only 218 218 -webkit-user-select: text 219 -webkit-writing-mode: horizontal-tb220 219 clip-path: none 221 220 clip-rule: nonzero … … 250 249 kerning: 0 251 250 text-anchor: start 252 writing-mode: lr-tb251 writing-mode: horizontal-tb 253 252 glyph-orientation-horizontal: 0deg 254 253 glyph-orientation-vertical: auto -
trunk/LayoutTests/platform/mac/svg/W3C-SVG-1.1/text-align-06-b-expected.txt
r177774 r207757 13 13 chunk 1 (vertical) text run 1 at (-10.40,0.00) startOffset 0 endOffset 1 height 33.52: "t" 14 14 chunk 1 (vertical) text run 2 at (-10.40,33.52) startOffset 1 endOffset 2 height 33.52: "e" 15 RenderSVGTSpan {tspan} at (0,0) size 17x3415 RenderSVGTSpan {tspan} at (0,0) size 34x17 16 16 RenderSVGInlineText {#text} at (7,67) size 17x34 17 17 chunk 1 (vertical) text run 1 at (-3.40,67.03) startOffset 0 endOffset 1 height 33.52: "7" … … 23 23 chunk 1 (vertical) text run 1 at (69.60,0.00) startOffset 0 endOffset 1 height 33.52: "t" 24 24 chunk 1 (vertical) text run 2 at (69.60,33.52) startOffset 1 endOffset 2 height 33.52: "e" 25 RenderSVGTSpan {tspan} at (0,0) size 27x13525 RenderSVGTSpan {tspan} at (0,0) size 135x27 26 26 RenderSVGInlineText {#text} at (0,67) size 27x135 27 27 chunk 1 (vertical) text run 1 at (48.60,67.03) startOffset 0 endOffset 1 height 33.52: "-" … … 36 36 chunk 1 (vertical) text run 1 at (169.60,0.00) startOffset 0 endOffset 1 height 33.52: "t" 37 37 chunk 1 (vertical) text run 2 at (169.60,33.52) startOffset 1 endOffset 2 height 33.52: "e" 38 RenderSVGTSpan {tspan} at (0,0) size 1 7x10138 RenderSVGTSpan {tspan} at (0,0) size 101x17 39 39 RenderSVGInlineText {#text} at (0,67) size 17x101 40 40 chunk 1 (vertical) text run 1 at (152.84,67.03) startOffset 0 endOffset 1 height 33.52: "s" 41 41 chunk 1 (vertical) text run 2 at (152.84,100.55) startOffset 1 endOffset 2 height 33.52: "u" 42 42 chunk 1 (vertical) text run 3 at (152.84,134.06) startOffset 2 endOffset 3 height 33.52: "b" 43 RenderSVGTSpan {tspan} at (0,0) size 16x3543 RenderSVGTSpan {tspan} at (0,0) size 35x16 44 44 RenderSVGInlineText {#text} at (17,167) size 15x34 45 45 chunk 1 (vertical) text run 1 at (169.60,167.58) startOffset 0 endOffset 1 height 33.52: "x" … … 50 50 chunk 1 (vertical) text run 1 at (249.60,0.00) startOffset 0 endOffset 1 height 33.52: "t" 51 51 chunk 1 (vertical) text run 2 at (249.60,33.52) startOffset 1 endOffset 2 height 33.52: "e" 52 RenderSVGTSpan {tspan} at (0,0) size 1 8x16852 RenderSVGTSpan {tspan} at (0,0) size 169x17 53 53 RenderSVGInlineText {#text} at (16,67) size 17x168 54 54 chunk 1 (vertical) text run 1 at (266.36,67.03) startOffset 0 endOffset 1 height 33.52: "s" … … 57 57 chunk 1 (vertical) text run 4 at (266.36,167.58) startOffset 3 endOffset 4 height 33.52: "e" 58 58 chunk 1 (vertical) text run 5 at (266.36,201.09) startOffset 4 endOffset 5 height 33.52: "r" 59 RenderSVGTSpan {tspan} at (0,0) size 16x3559 RenderSVGTSpan {tspan} at (0,0) size 35x16 60 60 RenderSVGInlineText {#text} at (0,234) size 15x34 61 61 chunk 1 (vertical) text run 1 at (249.60,234.61) startOffset 0 endOffset 1 height 33.52: "x" -
trunk/LayoutTests/platform/mac/svg/text/text-align-06-b-expected.txt
r177774 r207757 13 13 chunk 1 (vertical) text run 1 at (-10.40,0.00) startOffset 0 endOffset 1 height 33.52: "t" 14 14 chunk 1 (vertical) text run 2 at (-10.40,33.52) startOffset 1 endOffset 2 height 33.52: "e" 15 RenderSVGTSpan {tspan} at (0,0) size 17x3415 RenderSVGTSpan {tspan} at (0,0) size 34x17 16 16 RenderSVGInlineText {#text} at (7,67) size 17x34 17 17 chunk 1 (vertical) text run 1 at (-3.40,67.03) startOffset 0 endOffset 1 height 33.52: "7" … … 23 23 chunk 1 (vertical) text run 1 at (69.60,0.00) startOffset 0 endOffset 1 height 33.52: "t" 24 24 chunk 1 (vertical) text run 2 at (69.60,33.52) startOffset 1 endOffset 2 height 33.52: "e" 25 RenderSVGTSpan {tspan} at (0,0) size 27x13525 RenderSVGTSpan {tspan} at (0,0) size 135x27 26 26 RenderSVGInlineText {#text} at (0,67) size 27x135 27 27 chunk 1 (vertical) text run 1 at (48.60,67.03) startOffset 0 endOffset 1 height 33.52: "-" … … 36 36 chunk 1 (vertical) text run 1 at (169.60,0.00) startOffset 0 endOffset 1 height 33.52: "t" 37 37 chunk 1 (vertical) text run 2 at (169.60,33.52) startOffset 1 endOffset 2 height 33.52: "e" 38 RenderSVGTSpan {tspan} at (0,0) size 1 7x10138 RenderSVGTSpan {tspan} at (0,0) size 101x17 39 39 RenderSVGInlineText {#text} at (0,67) size 17x101 40 40 chunk 1 (vertical) text run 1 at (152.84,67.03) startOffset 0 endOffset 1 height 33.52: "s" 41 41 chunk 1 (vertical) text run 2 at (152.84,100.55) startOffset 1 endOffset 2 height 33.52: "u" 42 42 chunk 1 (vertical) text run 3 at (152.84,134.06) startOffset 2 endOffset 3 height 33.52: "b" 43 RenderSVGTSpan {tspan} at (0,0) size 16x3543 RenderSVGTSpan {tspan} at (0,0) size 35x16 44 44 RenderSVGInlineText {#text} at (17,167) size 15x34 45 45 chunk 1 (vertical) text run 1 at (169.60,167.58) startOffset 0 endOffset 1 height 33.52: "x" … … 50 50 chunk 1 (vertical) text run 1 at (249.60,0.00) startOffset 0 endOffset 1 height 33.52: "t" 51 51 chunk 1 (vertical) text run 2 at (249.60,33.52) startOffset 1 endOffset 2 height 33.52: "e" 52 RenderSVGTSpan {tspan} at (0,0) size 1 8x16852 RenderSVGTSpan {tspan} at (0,0) size 169x17 53 53 RenderSVGInlineText {#text} at (16,67) size 17x168 54 54 chunk 1 (vertical) text run 1 at (266.36,67.03) startOffset 0 endOffset 1 height 33.52: "s" … … 57 57 chunk 1 (vertical) text run 4 at (266.36,167.58) startOffset 3 endOffset 4 height 33.52: "e" 58 58 chunk 1 (vertical) text run 5 at (266.36,201.09) startOffset 4 endOffset 5 height 33.52: "r" 59 RenderSVGTSpan {tspan} at (0,0) size 16x3559 RenderSVGTSpan {tspan} at (0,0) size 35x16 60 60 RenderSVGInlineText {#text} at (0,234) size 15x34 61 61 chunk 1 (vertical) text run 1 at (249.60,234.61) startOffset 0 endOffset 1 height 33.52: "x" -
trunk/LayoutTests/svg/css/getComputedStyle-basic-expected.txt
r205809 r207757 433 433 rect: style.getPropertyValue(-webkit-user-select) : text 434 434 rect: style.getPropertyCSSValue(-webkit-user-select) : [object CSSPrimitiveValue] 435 rect: style.getPropertyValue(-webkit-writing-mode) : horizontal-tb436 rect: style.getPropertyCSSValue(-webkit-writing-mode) : [object CSSPrimitiveValue]437 435 rect: style.getPropertyValue(clip-path) : none 438 436 rect: style.getPropertyCSSValue(clip-path) : [object CSSPrimitiveValue] … … 499 497 rect: style.getPropertyValue(text-anchor) : start 500 498 rect: style.getPropertyCSSValue(text-anchor) : [object CSSPrimitiveValue] 501 rect: style.getPropertyValue(writing-mode) : lr-tb499 rect: style.getPropertyValue(writing-mode) : horizontal-tb 502 500 rect: style.getPropertyCSSValue(writing-mode) : [object CSSPrimitiveValue] 503 501 rect: style.getPropertyValue(glyph-orientation-horizontal) : 0deg … … 943 941 g: style.getPropertyValue(-webkit-user-select) : text 944 942 g: style.getPropertyCSSValue(-webkit-user-select) : [object CSSPrimitiveValue] 945 g: style.getPropertyValue(-webkit-writing-mode) : horizontal-tb946 g: style.getPropertyCSSValue(-webkit-writing-mode) : [object CSSPrimitiveValue]947 943 g: style.getPropertyValue(clip-path) : none 948 944 g: style.getPropertyCSSValue(clip-path) : [object CSSPrimitiveValue] … … 1009 1005 g: style.getPropertyValue(text-anchor) : start 1010 1006 g: style.getPropertyCSSValue(text-anchor) : [object CSSPrimitiveValue] 1011 g: style.getPropertyValue(writing-mode) : lr-tb1007 g: style.getPropertyValue(writing-mode) : horizontal-tb 1012 1008 g: style.getPropertyCSSValue(writing-mode) : [object CSSPrimitiveValue] 1013 1009 g: style.getPropertyValue(glyph-orientation-horizontal) : 0deg -
trunk/Source/WebCore/ChangeLog
r207755 r207757 1 2016-10-24 Dave Hyatt <hyatt@apple.com> 2 3 [CSS Parser] Unprefix -webkit-writing-mode 4 https://bugs.webkit.org/show_bug.cgi?id=163870 5 6 Reviewed by Zalan Bujtas. 7 8 * css/CSSComputedStyleDeclaration.cpp: 9 (WebCore::ComputedStyleExtractor::propertyValue): 10 Change -webkit-writing mode to writing-mode. 11 12 * css/CSSPrimitiveValueMappings.h: 13 (WebCore::CSSPrimitiveValue::operator WritingMode): 14 (WebCore::CSSPrimitiveValue::operator SVGWritingMode): Deleted. 15 Eliminate the SVGWritingMode converters. Add support for the unique SVG-specific 16 values to the WritingMode converters. 17 18 * css/CSSPropertyNames.in: 19 Alias -webkit-writing-mode to writing-mode. Move writing-mode up to be 20 high priority like -webkit-writing mode was. Alias -epub-writing-mode to writing-mode 21 instead of to -webkit-writing-mode. 22 23 * css/SVGCSSComputedStyleDeclaration.cpp: 24 (WebCore::ComputedStyleExtractor::svgPropertyValue): 25 Remove writing-mode from SVG computed style, since the base CSSComputedStyleDeclaration handles it. 26 27 * css/StyleBuilderCustom.h: 28 (WebCore::StyleBuilderCustom::applyValueWritingMode): 29 (WebCore::StyleBuilderCustom::applyValueWebkitWritingMode): Deleted. 30 Renamed applyValueWebkitWritingMode to applyValueWritingMode. Removed the SVG code, since 31 the underlying converter for WritingMode now handles those values. 32 33 * css/StyleResolver.cpp: 34 (WebCore::extractDirectionAndWritingMode): 35 Rename -webkit-writing-mode to writing-mode. 36 37 * css/parser/CSSParser.cpp: 38 (WebCore::isValidKeywordPropertyAndValue): 39 Eliminate -webkit-writing-mode and make sure writing-mode handles both the SVG values 40 and the normal values. 41 42 * css/parser/CSSParserFastPaths.cpp: 43 (WebCore::CSSParserFastPaths::isValidKeywordPropertyAndValue): 44 (WebCore::CSSParserFastPaths::isKeywordPropertyID): 45 Same deal here. 46 47 * html/track/TextTrackCueGeneric.cpp: 48 (WebCore::TextTrackCueGenericBoxElement::applyCSSProperties): 49 * html/track/VTTCue.cpp: 50 (WebCore::VTTCueBox::applyCSSProperties): 51 Cue stuff was setting -webkit-writing-mode, so make it set writing-mode instead now. 52 53 * rendering/RenderLineBreak.cpp: 54 (WebCore::RenderLineBreak::collectSelectionRects): 55 * rendering/RenderText.cpp: 56 (WebCore::RenderText::collectSelectionRects): 57 Switch the SVG-specific code here over to accessing the RenderStyle writing-mode and not 58 the SVG-specific one. 59 60 * rendering/style/RenderStyle.h: 61 (WebCore::RenderStyle::isVerticalWritingMode): 62 Add a helper function for asking if something is vertical writing mode. 63 64 * rendering/style/SVGRenderStyle.cpp: 65 * rendering/style/SVGRenderStyle.h: 66 * rendering/style/SVGRenderStyleDefs.h: 67 (WebCore::SVGRenderStyle::diff): 68 Remove the SVG writing mode code. 69 70 * rendering/svg/RenderSVGInlineText.cpp: 71 (WebCore::RenderSVGInlineText::computeNewScaledFontForStyle): 72 Make sure to force SVG font descriptions to be horizontal, since SVG controls 73 its own glyph orientation. 74 75 * rendering/svg/SVGRenderTreeAsText.cpp: 76 (WebCore::writeSVGInlineTextBox): 77 * rendering/svg/SVGTextChunk.cpp: 78 (WebCore::SVGTextChunk::SVGTextChunk): 79 * rendering/svg/SVGTextLayoutEngine.cpp: 80 (WebCore::SVGTextLayoutEngine::layoutInlineTextBox): 81 * rendering/svg/SVGTextQuery.cpp: 82 (WebCore::SVGTextQuery::executeQuery): 83 Changed to access the RenderStyle writing mode instead of the SVG-specific one. 84 1 85 2016-10-23 Antti Koivisto <antti@apple.com> 2 86 -
trunk/Source/WebCore/css/CSSComputedStyleDeclaration.cpp
r207755 r207757 408 408 CSSPropertyWebkitUserModify, 409 409 CSSPropertyWebkitUserSelect, 410 CSSPropertyWebkitWritingMode,411 410 #if ENABLE(CSS_REGIONS) 412 411 CSSPropertyWebkitFlowInto, … … 3685 3684 case CSSPropertyWebkitLineAlign: 3686 3685 return CSSPrimitiveValue::create(style->lineAlign()); 3687 case CSSPropertyW ebkitWritingMode:3686 case CSSPropertyWritingMode: 3688 3687 return cssValuePool.createValue(style->writingMode()); 3689 3688 case CSSPropertyWebkitTextCombine: … … 3986 3985 case CSSPropertyTextAnchor: 3987 3986 case CSSPropertyVectorEffect: 3988 case CSSPropertyWritingMode:3989 3987 case CSSPropertyWebkitSvgShadow: 3990 3988 return svgPropertyValue(propertyID, DoNotUpdateLayout); -
trunk/Source/WebCore/css/CSSPrimitiveValueMappings.h
r207396 r207757 3243 3243 switch (m_value.valueID) { 3244 3244 case CSSValueHorizontalTb: 3245 case CSSValueLrTb: 3246 case CSSValueRl: 3247 case CSSValueRlTb: 3245 3248 return TopToBottomWritingMode; 3246 3249 case CSSValueVerticalRl: 3250 case CSSValueTb: 3251 case CSSValueTbRl: 3247 3252 return RightToLeftWritingMode; 3248 3253 case CSSValueVerticalLr: … … 4888 4893 } 4889 4894 4890 template<> inline CSSPrimitiveValue::CSSPrimitiveValue(SVGWritingMode e)4891 : CSSValue(PrimitiveClass)4892 {4893 m_primitiveUnitType = CSS_VALUE_ID;4894 switch (e) {4895 case WM_LRTB:4896 m_value.valueID = CSSValueLrTb;4897 break;4898 case WM_LR:4899 m_value.valueID = CSSValueLr;4900 break;4901 case WM_RLTB:4902 m_value.valueID = CSSValueRlTb;4903 break;4904 case WM_RL:4905 m_value.valueID = CSSValueRl;4906 break;4907 case WM_TBRL:4908 m_value.valueID = CSSValueTbRl;4909 break;4910 case WM_TB:4911 m_value.valueID = CSSValueTb;4912 break;4913 }4914 }4915 4916 template<> inline CSSPrimitiveValue::operator SVGWritingMode() const4917 {4918 ASSERT(isValueID());4919 4920 switch (m_value.valueID) {4921 case CSSValueLrTb:4922 return WM_LRTB;4923 case CSSValueLr:4924 return WM_LR;4925 case CSSValueRlTb:4926 return WM_RLTB;4927 case CSSValueRl:4928 return WM_RL;4929 case CSSValueTbRl:4930 return WM_TBRL;4931 case CSSValueTb:4932 return WM_TB;4933 default:4934 break;4935 }4936 4937 ASSERT_NOT_REACHED();4938 return WM_LRTB;4939 }4940 4941 4895 template<> inline CSSPrimitiveValue::CSSPrimitiveValue(const Color& color) 4942 4896 : CSSValue(PrimitiveClass) -
trunk/Source/WebCore/css/CSSPropertyNames.in
r207630 r207757 124 124 -webkit-text-size-adjust [Inherited, Custom=Value] 125 125 #endif 126 -webkit-writing-mode [Inherited, Custom=Value] 127 -epub-writing-mode = -webkit-writing-mode 126 writing-mode [Inherited, Custom=Value] 127 -webkit-writing-mode = writing-mode 128 -epub-writing-mode = writing-mode 128 129 -webkit-text-zoom [Inherited, Custom=Value] 129 130 zoom [Custom=All] … … 369 370 word-spacing [Inherited, ConditionalConverter=WordSpacing] 370 371 word-wrap [Inherited=EOverflowWrap, NameForMethods=OverflowWrap] 371 writing-mode [Inherited, SVG]372 372 x [Initial=initialZeroLength, Converter=Length] 373 373 y [Initial=initialZeroLength, Converter=Length] -
trunk/Source/WebCore/css/SVGCSSComputedStyleDeclaration.cpp
r207686 r207757 150 150 case CSSPropertyTextAnchor: 151 151 return CSSPrimitiveValue::create(svgStyle.textAnchor()); 152 case CSSPropertyWritingMode:153 return CSSPrimitiveValue::create(svgStyle.writingMode());154 152 case CSSPropertyClipPath: 155 153 if (!svgStyle.clipperResource().isEmpty()) -
trunk/Source/WebCore/css/StyleBuilderCustom.h
r207726 r207757 134 134 #endif 135 135 static void applyValueWebkitTextZoom(StyleResolver&, CSSValue&); 136 static void applyValueW ebkitWritingMode(StyleResolver&, CSSValue&);136 static void applyValueWritingMode(StyleResolver&, CSSValue&); 137 137 static void applyValueAlt(StyleResolver&, CSSValue&); 138 138 #if ENABLE(CSS_SCROLL_SNAP) … … 706 706 } 707 707 708 inline void StyleBuilderCustom::applyValueW ebkitWritingMode(StyleResolver& styleResolver, CSSValue& value)708 inline void StyleBuilderCustom::applyValueWritingMode(StyleResolver& styleResolver, CSSValue& value) 709 709 { 710 710 styleResolver.setWritingMode(downcast<CSSPrimitiveValue>(value)); 711 711 styleResolver.style()->setHasExplicitlySetWritingMode(true); 712 712 } 713 713 714 714 inline void StyleBuilderCustom::applyValueWebkitTextOrientation(StyleResolver& styleResolver, CSSValue& value) 715 715 { … … 1178 1178 { 1179 1179 SVGRenderStyle& svgStyle = styleResolver.style()->accessSVGStyle(); 1180 SVGPaint& svgPaint = downcast<SVGPaint>(value); 1181 svgStyle.setFillPaint(svgPaint.paintType(), StyleBuilderConverter::convertSVGColor(styleResolver, svgPaint), svgPaint.uri(), styleResolver.applyPropertyToRegularStyle(), styleResolver.applyPropertyToVisitedLinkStyle()); 1180 1181 // FIXME-NEWPARSER: SVGPaint as a back-end CSSValue is bad, since it's bypassing 1182 // the style resolver's colorFromPrimitiveValue code. It's also not necessary, since it's 1183 // not even how we store things in the front end. 1184 // Remove this block of code when the new parser is turned on. 1185 if (value.isSVGPaint()) { 1186 auto& svgPaint = downcast<SVGPaint>(value); 1187 svgStyle.setFillPaint(svgPaint.paintType(), StyleBuilderConverter::convertSVGColor(styleResolver, svgPaint), svgPaint.uri(), styleResolver.applyPropertyToRegularStyle(), styleResolver.applyPropertyToVisitedLinkStyle()); 1188 return; 1189 } 1190 1191 const CSSPrimitiveValue* localValue = value.isPrimitiveValue() ? &downcast<CSSPrimitiveValue>(value) : nullptr; 1192 String url; 1193 if (value.isValueList()) { 1194 const CSSValueList& list = downcast<CSSValueList>(value); 1195 url = downcast<CSSPrimitiveValue>(list.item(0))->stringValue(); 1196 localValue = downcast<CSSPrimitiveValue>(list.item(1)); 1197 } 1198 1199 if (!localValue) 1200 return; 1201 1202 Color color; 1203 SVGPaint::SVGPaintType paintType = SVGPaint::SVG_PAINTTYPE_RGBCOLOR; 1204 if (localValue->isURI()) { 1205 paintType = SVGPaint::SVG_PAINTTYPE_URI; 1206 url = downcast<CSSPrimitiveValue>(localValue)->stringValue(); 1207 } else if (localValue->isValueID() && localValue->valueID() == CSSValueNone) 1208 paintType = url.isEmpty() ? SVGPaint::SVG_PAINTTYPE_NONE : SVGPaint::SVG_PAINTTYPE_URI_NONE; 1209 else if (localValue->isValueID() && localValue->valueID() == CSSValueCurrentcolor) { 1210 color = styleResolver.style()->color(); 1211 paintType = url.isEmpty() ? SVGPaint::SVG_PAINTTYPE_CURRENTCOLOR :SVGPaint:: SVG_PAINTTYPE_URI_CURRENTCOLOR; 1212 } else { 1213 color = styleResolver.colorFromPrimitiveValue(*localValue); 1214 paintType = url.isEmpty() ? SVGPaint::SVG_PAINTTYPE_RGBCOLOR : SVGPaint::SVG_PAINTTYPE_URI_RGBCOLOR; 1215 } 1216 svgStyle.setFillPaint(paintType, color, url, styleResolver.applyPropertyToRegularStyle(), styleResolver.applyPropertyToVisitedLinkStyle()); 1182 1217 } 1183 1218 … … 1198 1233 { 1199 1234 SVGRenderStyle& svgStyle = styleResolver.style()->accessSVGStyle(); 1200 auto& svgPaint = downcast<SVGPaint>(value); 1201 svgStyle.setStrokePaint(svgPaint.paintType(), StyleBuilderConverter::convertSVGColor(styleResolver, svgPaint), svgPaint.uri(), styleResolver.applyPropertyToRegularStyle(), styleResolver.applyPropertyToVisitedLinkStyle()); 1235 1236 // FIXME-NEWPARSER: SVGPaint as a back-end CSSValue is bad, since it's bypassing 1237 // the style resolver's colorFromPrimitiveValue code. It's also not necessary, since it's 1238 // not even how we store things in the front end. 1239 // Remove this block of code when the new parser is turned on. 1240 if (value.isSVGPaint()) { 1241 auto& svgPaint = downcast<SVGPaint>(value); 1242 svgStyle.setStrokePaint(svgPaint.paintType(), StyleBuilderConverter::convertSVGColor(styleResolver, svgPaint), svgPaint.uri(), styleResolver.applyPropertyToRegularStyle(), styleResolver.applyPropertyToVisitedLinkStyle()); 1243 return; 1244 } 1245 1246 const CSSPrimitiveValue* localValue = value.isPrimitiveValue() ? &downcast<CSSPrimitiveValue>(value) : nullptr; 1247 String url; 1248 if (value.isValueList()) { 1249 const CSSValueList& list = downcast<CSSValueList>(value); 1250 url = downcast<CSSPrimitiveValue>(list.item(0))->stringValue(); 1251 localValue = downcast<CSSPrimitiveValue>(list.item(1)); 1252 } 1253 1254 if (!localValue) 1255 return; 1256 1257 Color color; 1258 SVGPaint::SVGPaintType paintType = SVGPaint::SVG_PAINTTYPE_RGBCOLOR; 1259 if (localValue->isURI()) { 1260 paintType = SVGPaint::SVG_PAINTTYPE_URI; 1261 url = downcast<CSSPrimitiveValue>(localValue)->stringValue(); 1262 } else if (localValue->isValueID() && localValue->valueID() == CSSValueNone) 1263 paintType = url.isEmpty() ? SVGPaint::SVG_PAINTTYPE_NONE : SVGPaint::SVG_PAINTTYPE_URI_NONE; 1264 else if (localValue->isValueID() && localValue->valueID() == CSSValueCurrentcolor) { 1265 color = styleResolver.style()->color(); 1266 paintType = url.isEmpty() ? SVGPaint::SVG_PAINTTYPE_CURRENTCOLOR :SVGPaint:: SVG_PAINTTYPE_URI_CURRENTCOLOR; 1267 } else { 1268 color = styleResolver.colorFromPrimitiveValue(*localValue); 1269 paintType = url.isEmpty() ? SVGPaint::SVG_PAINTTYPE_RGBCOLOR : SVGPaint::SVG_PAINTTYPE_URI_RGBCOLOR; 1270 } 1271 svgStyle.setStrokePaint(paintType, color, url, styleResolver.applyPropertyToRegularStyle(), styleResolver.applyPropertyToVisitedLinkStyle()); 1202 1272 } 1203 1273 -
trunk/Source/WebCore/css/StyleResolver.cpp
r207755 r207757 1293 1293 writingMode = style.writingMode(); 1294 1294 1295 bool hadImportantW ebkitWritingMode = false;1295 bool hadImportantWritingMode = false; 1296 1296 bool hadImportantDirection = false; 1297 1297 … … 1302 1302 continue; 1303 1303 switch (property.id()) { 1304 case CSSPropertyW ebkitWritingMode:1305 if (!hadImportantW ebkitWritingMode || property.isImportant()) {1304 case CSSPropertyWritingMode: 1305 if (!hadImportantWritingMode || property.isImportant()) { 1306 1306 writingMode = downcast<CSSPrimitiveValue>(*property.value()); 1307 hadImportantW ebkitWritingMode = property.isImportant();1307 hadImportantWritingMode = property.isImportant(); 1308 1308 } 1309 1309 break; -
trunk/Source/WebCore/css/parser/CSSParser.cpp
r207630 r207757 1014 1014 } 1015 1015 break; 1016 case CSSPropertyWebkitWritingMode:1017 if (valueID >= CSSValueHorizontalTb && valueID <= CSSValueHorizontalBt)1018 return true;1019 break;1020 1016 case CSSPropertyWhiteSpace: // normal | pre | nowrap | inherit 1021 1017 if (valueID == CSSValueNormal || valueID == CSSValuePre || valueID == CSSValuePreWrap || valueID == CSSValuePreLine || valueID == CSSValueNowrap) … … 1128 1124 break; 1129 1125 case CSSPropertyWritingMode: 1130 if (valueID == CSSValueLrTb || valueID == CSSValueRlTb || valueID == CSSValueTbRl || valueID == CSSValueLr || valueID == CSSValueRl || valueID == CSSValueTb) 1126 if ((valueID >= CSSValueHorizontalTb && valueID <= CSSValueHorizontalBt) 1127 || valueID == CSSValueLrTb || valueID == CSSValueRlTb || valueID == CSSValueTbRl 1128 || valueID == CSSValueLr || valueID == CSSValueRl || valueID == CSSValueTb) 1131 1129 return true; 1132 1130 break; -
trunk/Source/WebCore/css/parser/CSSParserFastPaths.cpp
r207682 r207757 742 742 case CSSPropertyWebkitUserSelect: // auto | none | text | all 743 743 return valueID == CSSValueAuto || valueID == CSSValueNone || valueID == CSSValueText || valueID == CSSValueAll; 744 case CSSPropertyWebkitWritingMode:745 return valueID >= CSSValueHorizontalTb && valueID <= CSSValueHorizontalBt;746 744 case CSSPropertyWritingMode: 747 return valueID == CSSValueHorizontalTb 748 || valueID == CSSValueVerticalRl || valueID == CSSValueVerticalLr 745 // Note that horizontal-bt is not supported by the unprefixed version of 746 // the property, only by the -webkit- version. 747 return (valueID >= CSSValueHorizontalTb && valueID <= CSSValueHorizontalBt) 749 748 || valueID == CSSValueLrTb || valueID == CSSValueRlTb || valueID == CSSValueTbRl 750 749 || valueID == CSSValueLr || valueID == CSSValueRl || valueID == CSSValueTb; … … 878 877 case CSSPropertyWebkitUserModify: 879 878 case CSSPropertyWebkitUserSelect: 880 case CSSPropertyWebkitWritingMode:881 879 case CSSPropertyWhiteSpace: 882 880 case CSSPropertyWordBreak: -
trunk/Source/WebCore/html/track/TextTrackCueGeneric.cpp
r207720 r207757 141 141 if (cue->backgroundColor().isValid()) 142 142 setInlineStyleProperty(CSSPropertyBackgroundColor, cue->backgroundColor().serialized()); 143 setInlineStyleProperty(CSSPropertyW ebkitWritingMode, cue->getCSSWritingMode(), false);143 setInlineStyleProperty(CSSPropertyWritingMode, cue->getCSSWritingMode(), false); 144 144 setInlineStyleProperty(CSSPropertyWhiteSpace, CSSValuePreWrap); 145 145 } -
trunk/Source/WebCore/html/track/VTTCue.cpp
r207720 r207757 159 159 160 160 // the 'writing-mode' property must be set to writing-mode 161 setInlineStyleProperty(CSSPropertyW ebkitWritingMode, m_cue.getCSSWritingMode(), false);161 setInlineStyleProperty(CSSPropertyWritingMode, m_cue.getCSSWritingMode(), false); 162 162 163 163 std::pair<float, float> position = m_cue.getCSSPosition(); -
trunk/Source/WebCore/rendering/RenderLineBreak.cpp
r204400 r207757 265 265 bool isFixed = false; 266 266 IntRect absRect = localToAbsoluteQuad(FloatRect(rect), UseTransforms, &isFixed).enclosingBoundingBox(); 267 bool boxIsHorizontal = !box->isSVGInlineTextBox() ? box->isHorizontal() : !style(). svgStyle().isVerticalWritingMode();267 bool boxIsHorizontal = !box->isSVGInlineTextBox() ? box->isHorizontal() : !style().isVerticalWritingMode(); 268 268 // If the containing block is an inline element, we want to check the inlineBoxWrapper orientation 269 269 // to determine the orientation of the block. In this case we also use the inlineBoxWrapper to -
trunk/Source/WebCore/rendering/RenderText.cpp
r206395 r207757 385 385 bool isFixed = false; 386 386 IntRect absRect = localToAbsoluteQuad(FloatRect(rect), UseTransforms, &isFixed).enclosingBoundingBox(); 387 bool boxIsHorizontal = !box->isSVGInlineTextBox() ? box->isHorizontal() : !style(). svgStyle().isVerticalWritingMode();387 bool boxIsHorizontal = !box->isSVGInlineTextBox() ? box->isHorizontal() : !style().isVerticalWritingMode(); 388 388 // If the containing block is an inline element, we want to check the inlineBoxWrapper orientation 389 389 // to determine the orientation of the block. In this case we also use the inlineBoxWrapper to -
trunk/Source/WebCore/rendering/style/RenderStyle.h
r207535 r207757 1162 1162 WritingMode writingMode() const { return static_cast<WritingMode>(inherited_flags.m_writingMode); } 1163 1163 bool isHorizontalWritingMode() const { return WebCore::isHorizontalWritingMode(writingMode()); } 1164 bool isVerticalWritingMode() const { return WebCore::isVerticalWritingMode(writingMode()); } 1164 1165 bool isFlippedLinesWritingMode() const { return WebCore::isFlippedLinesWritingMode(writingMode()); } 1165 1166 bool isFlippedBlocksWritingMode() const { return WebCore::isFlippedWritingMode(writingMode()); } -
trunk/Source/WebCore/rendering/style/SVGRenderStyle.cpp
r199964 r207757 207 207 // All text related properties influence layout. 208 208 if (svg_inherited_flags._textAnchor != other->svg_inherited_flags._textAnchor 209 || svg_inherited_flags._writingMode != other->svg_inherited_flags._writingMode210 209 || svg_inherited_flags._glyphOrientationHorizontal != other->svg_inherited_flags._glyphOrientationHorizontal 211 210 || svg_inherited_flags._glyphOrientationVertical != other->svg_inherited_flags._glyphOrientationVertical -
trunk/Source/WebCore/rendering/style/SVGRenderStyle.h
r207716 r207757 71 71 static EShapeRendering initialShapeRendering() { return SR_AUTO; } 72 72 static ETextAnchor initialTextAnchor() { return TA_START; } 73 static SVGWritingMode initialWritingMode() { return WM_LRTB; }74 73 static EGlyphOrientation initialGlyphOrientationHorizontal() { return GO_0DEG; } 75 74 static EGlyphOrientation initialGlyphOrientationVertical() { return GO_AUTO; } … … 127 126 void setShapeRendering(EShapeRendering val) { svg_inherited_flags._shapeRendering = val; } 128 127 void setTextAnchor(ETextAnchor val) { svg_inherited_flags._textAnchor = val; } 129 void setWritingMode(SVGWritingMode val) { svg_inherited_flags._writingMode = val; }130 128 void setGlyphOrientationHorizontal(EGlyphOrientation val) { svg_inherited_flags._glyphOrientationHorizontal = val; } 131 129 void setGlyphOrientationVertical(EGlyphOrientation val) { svg_inherited_flags._glyphOrientationVertical = val; } … … 335 333 EShapeRendering shapeRendering() const { return (EShapeRendering) svg_inherited_flags._shapeRendering; } 336 334 ETextAnchor textAnchor() const { return (ETextAnchor) svg_inherited_flags._textAnchor; } 337 SVGWritingMode writingMode() const { return (SVGWritingMode) svg_inherited_flags._writingMode; }338 335 EGlyphOrientation glyphOrientationHorizontal() const { return (EGlyphOrientation) svg_inherited_flags._glyphOrientationHorizontal; } 339 336 EGlyphOrientation glyphOrientationVertical() const { return (EGlyphOrientation) svg_inherited_flags._glyphOrientationVertical; } … … 388 385 bool hasVisibleStroke() const { return hasStroke() && !strokeWidth().isZero(); } 389 386 bool hasFill() const { return fillPaintType() != SVGPaint::SVG_PAINTTYPE_NONE; } 390 bool isVerticalWritingMode() const { return writingMode() == WM_TBRL || writingMode() == WM_TB; }391 387 bool isolatesBlending() const { return hasMasker() || shadow(); } 392 388 … … 405 401 && (_colorInterpolation == other._colorInterpolation) 406 402 && (_colorInterpolationFilters == other._colorInterpolationFilters) 407 && (_writingMode == other._writingMode)408 403 && (_glyphOrientationHorizontal == other._glyphOrientationHorizontal) 409 404 && (_glyphOrientationVertical == other._glyphOrientationVertical) … … 425 420 unsigned _colorInterpolation : 2; // EColorInterpolation 426 421 unsigned _colorInterpolationFilters : 2; // EColorInterpolation 427 unsigned _writingMode : 3; // SVGWritingMode428 422 unsigned _glyphOrientationHorizontal : 3; // EGlyphOrientation 429 423 unsigned _glyphOrientationVertical : 3; // EGlyphOrientation … … 482 476 svg_inherited_flags._colorInterpolation = initialColorInterpolation(); 483 477 svg_inherited_flags._colorInterpolationFilters = initialColorInterpolationFilters(); 484 svg_inherited_flags._writingMode = initialWritingMode();485 478 svg_inherited_flags._glyphOrientationHorizontal = initialGlyphOrientationHorizontal(); 486 479 svg_inherited_flags._glyphOrientationVertical = initialGlyphOrientationVertical(); -
trunk/Source/WebCore/rendering/style/SVGRenderStyleDefs.h
r188647 r207757 56 56 enum EShapeRendering { 57 57 SR_AUTO, SR_OPTIMIZESPEED, SR_CRISPEDGES, SR_GEOMETRICPRECISION 58 };59 60 enum SVGWritingMode {61 WM_LRTB, WM_LR, WM_RLTB, WM_RL, WM_TBRL, WM_TB62 58 }; 63 59 -
trunk/Source/WebCore/rendering/svg/RenderSVGInlineText.cpp
r204400 r207757 241 241 fontDescription.setComputedSize(Style::computedFontSizeFromSpecifiedSizeForSVGInlineText(fontDescription.computedSize(), fontDescription.isAbsoluteSize(), scalingFactor, renderer.document())); 242 242 243 // SVG controls its own glyph orientation, so don't allow writing-mode 244 // to affect it. 245 if (fontDescription.orientation() != FontOrientation::Horizontal) 246 fontDescription.setOrientation(FontOrientation::Horizontal); 247 243 248 scaledFont = FontCascade(fontDescription, 0, 0); 244 249 scaledFont.update(&renderer.document().fontSelector()); -
trunk/Source/WebCore/rendering/svg/SVGRenderTreeAsText.cpp
r195946 r207757 324 324 ts << "chunk 1 "; 325 325 ETextAnchor anchor = svgStyle.textAnchor(); 326 bool isVerticalText = svgStyle.isVerticalWritingMode();326 bool isVerticalText = textBox->renderer().style().isVerticalWritingMode(); 327 327 if (anchor == TA_MIDDLE) { 328 328 ts << "(middle anchor"; -
trunk/Source/WebCore/rendering/svg/SVGTextChunk.cpp
r182840 r207757 38 38 m_chunkStyle |= SVGTextChunk::RightToLeftText; 39 39 40 if (s vgStyle.isVerticalWritingMode())40 if (style.isVerticalWritingMode()) 41 41 m_chunkStyle |= SVGTextChunk::VerticalText; 42 42 -
trunk/Source/WebCore/rendering/svg/SVGTextLayoutEngine.cpp
r198074 r207757 221 221 222 222 textBox.clearTextFragments(); 223 m_isVerticalText = style. svgStyle().isVerticalWritingMode();223 m_isVerticalText = style.isVerticalWritingMode(); 224 224 layoutTextOnLineOrPath(textBox, text, style); 225 225 -
trunk/Source/WebCore/rendering/svg/SVGTextQuery.cpp
r204400 r207757 116 116 queryData->textRenderer = &queryData->textBox->renderer(); 117 117 118 queryData->isVerticalText = queryData->textRenderer->style(). svgStyle().isVerticalWritingMode();118 queryData->isVerticalText = queryData->textRenderer->style().isVerticalWritingMode(); 119 119 const Vector<SVGTextFragment>& fragments = queryData->textBox->textFragments(); 120 120
Note: See TracChangeset
for help on using the changeset viewer.