Bug 1158500 - make writing-mode a mapped CSS property. r=cam
authorRobert Longson <longsonr@gmail.com>
Fri, 01 Apr 2016 22:08:04 +0100
changeset 291373 104e03d0e4082f82227e3e2c658510fa41346362
parent 291372 dc40f46fae4832e4ff2e15e1034c40a96bf1851c
child 291374 45de51023c1f88e77dea266467ea2f1a1da526f1
push id30132
push userryanvm@gmail.com
push dateSat, 02 Apr 2016 17:18:33 +0000
treeherdermozilla-central@df803eb33993 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerscam
bugs1158500
milestone48.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1158500 - make writing-mode a mapped CSS property. r=cam
dom/base/nsGkAtomList.h
dom/base/nsTreeSanitizer.cpp
dom/svg/nsSVGElement.cpp
layout/reftests/svg/text/reftest.list
layout/reftests/svg/text/vertical-01-ref.svg
layout/reftests/svg/text/vertical-01.svg
--- a/dom/base/nsGkAtomList.h
+++ b/dom/base/nsGkAtomList.h
@@ -1359,17 +1359,16 @@ GK_ATOM(colorInterpolation, "color-inter
 GK_ATOM(colorInterpolationFilters, "color-interpolation-filters")
 GK_ATOM(colorProfile, "color-profile")
 GK_ATOM(cursor, "cursor")
 GK_ATOM(cx, "cx")
 GK_ATOM(cy, "cy")
 GK_ATOM(d, "d")
 GK_ATOM(darken, "darken")
 GK_ATOM(defs, "defs")
-GK_ATOM(definition_src, "definition-src")
 GK_ATOM(deg, "deg")
 GK_ATOM(desc, "desc")
 GK_ATOM(diffuseConstant, "diffuseConstant")
 GK_ATOM(dilate, "dilate")
 GK_ATOM(direction, "direction")
 GK_ATOM(disable, "disable")
 GK_ATOM(discrete, "discrete")
 GK_ATOM(divisor, "divisor")
@@ -1433,37 +1432,32 @@ GK_ATOM(foreignObject, "foreignObject")
 GK_ATOM(fractalNoise, "fractalNoise")
 GK_ATOM(fx, "fx")
 GK_ATOM(fy, "fy")
 GK_ATOM(G, "G")
 GK_ATOM(g, "g")
 GK_ATOM(gamma, "gamma")
 // 'generic' conflicts with msvc11 winrt compiler extensions
 GK_ATOM(generic_, "generic")
-GK_ATOM(glyph, "glyph")
 GK_ATOM(glyphRef, "glyphRef")
-GK_ATOM(glyph_orientation_horizontal, "glyph-orientation-horizontal")
-GK_ATOM(glyph_orientation_vertical, "glyph-orientation-vertical")
 GK_ATOM(grad, "grad")
 GK_ATOM(gradientTransform, "gradientTransform")
 GK_ATOM(gradientUnits, "gradientUnits")
 GK_ATOM(hardLight, "hard-light")
-GK_ATOM(hkern, "hkern")
 GK_ATOM(hue, "hue")
 GK_ATOM(hueRotate, "hueRotate")
 GK_ATOM(identity, "identity")
 GK_ATOM(image_rendering, "image-rendering")
 GK_ATOM(in, "in")
 GK_ATOM(in2, "in2")
 GK_ATOM(intercept, "intercept")
 GK_ATOM(k1, "k1")
 GK_ATOM(k2, "k2")
 GK_ATOM(k3, "k3")
 GK_ATOM(k4, "k4")
-GK_ATOM(kerning, "kerning")
 GK_ATOM(kernelMatrix, "kernelMatrix")
 GK_ATOM(kernelUnitLength, "kernelUnitLength")
 GK_ATOM(lengthAdjust, "lengthAdjust")
 GK_ATOM(letter_spacing, "letter-spacing")
 GK_ATOM(lighten, "lighten")
 GK_ATOM(lighting_color, "lighting-color")
 GK_ATOM(limitingConeAngle, "limitingConeAngle")
 GK_ATOM(linear, "linear")
@@ -1582,19 +1576,19 @@ GK_ATOM(textPath, "textPath")
 GK_ATOM(tref, "tref")
 GK_ATOM(tspan, "tspan")
 GK_ATOM(turbulence, "turbulence")
 GK_ATOM(unicode_bidi, "unicode-bidi")
 GK_ATOM(userSpaceOnUse, "userSpaceOnUse")
 GK_ATOM(view, "view")
 GK_ATOM(viewBox, "viewBox")
 GK_ATOM(viewTarget, "viewTarget")
-GK_ATOM(vkern, "vkern")
 GK_ATOM(white_space, "white-space")
 GK_ATOM(word_spacing, "word-spacing")
+GK_ATOM(writing_mode, "writing-mode")
 GK_ATOM(x, "x")
 GK_ATOM(x1, "x1")
 GK_ATOM(x2, "x2")
 GK_ATOM(xChannelSelector, "xChannelSelector")
 GK_ATOM(xor_, "xor")
 GK_ATOM(y, "y")
 GK_ATOM(y1, "y1")
 GK_ATOM(y2, "y2")
--- a/dom/base/nsTreeSanitizer.cpp
+++ b/dom/base/nsTreeSanitizer.cpp
@@ -325,19 +325,19 @@ nsIAtom** const kElementsSVG[] = {
   &nsGkAtoms::font, // font
   &nsGkAtoms::font_face, // font-face
   &nsGkAtoms::font_face_format, // font-face-format
   &nsGkAtoms::font_face_name, // font-face-name
   &nsGkAtoms::font_face_src, // font-face-src
   &nsGkAtoms::font_face_uri, // font-face-uri
   &nsGkAtoms::foreignObject, // foreignObject
   &nsGkAtoms::g, // g
-  &nsGkAtoms::glyph, // glyph
+  // glyph
   &nsGkAtoms::glyphRef, // glyphRef
-  &nsGkAtoms::hkern, // hkern
+  // hkern
   &nsGkAtoms::image, // image
   &nsGkAtoms::line, // line
   &nsGkAtoms::linearGradient, // linearGradient
   &nsGkAtoms::marker, // marker
   &nsGkAtoms::mask, // mask
   &nsGkAtoms::metadata, // metadata
   &nsGkAtoms::missingGlyph, // missingGlyph
   &nsGkAtoms::mpath, // mpath
@@ -353,17 +353,17 @@ nsIAtom** const kElementsSVG[] = {
   &nsGkAtoms::symbol, // symbol
   &nsGkAtoms::text, // text
   &nsGkAtoms::textPath, // textPath
   &nsGkAtoms::title, // title
   &nsGkAtoms::tref, // tref
   &nsGkAtoms::tspan, // tspan
   &nsGkAtoms::use, // use
   &nsGkAtoms::view, // view
-  &nsGkAtoms::vkern, // vkern
+  // vkern
   nullptr
 };
 
 nsIAtom** const kAttributesSVG[] = {
   // accent-height
   &nsGkAtoms::accumulate, // accumulate
   &nsGkAtoms::additive, // additive
   &nsGkAtoms::alignment_baseline, // alignment-baseline
@@ -426,18 +426,18 @@ nsIAtom** const kAttributesSVG[] = {
   &nsGkAtoms::format, // format
   &nsGkAtoms::from, // from
   &nsGkAtoms::fx, // fx
   &nsGkAtoms::fy, // fy
   // g1
   // g2
   // glyph-name
   // glyphRef
-  &nsGkAtoms::glyph_orientation_horizontal, // glyph-orientation-horizontal
-  &nsGkAtoms::glyph_orientation_vertical, // glyph-orientation-vertical
+  // glyph-orientation-horizontal
+  // glyph-orientation-vertical
   &nsGkAtoms::gradientTransform, // gradientTransform
   &nsGkAtoms::gradientUnits, // gradientUnits
   &nsGkAtoms::height, // height
   // horiz-adv-x
   // horiz-origin-x
   // horiz-origin-y
   &nsGkAtoms::id, // id
   // ideographic
@@ -445,17 +445,17 @@ nsIAtom** const kAttributesSVG[] = {
   &nsGkAtoms::in, // in
   &nsGkAtoms::in2, // in2
   &nsGkAtoms::intercept, // intercept
   // k
   &nsGkAtoms::k1, // k1
   &nsGkAtoms::k2, // k2
   &nsGkAtoms::k3, // k3
   &nsGkAtoms::k4, // k4
-  &nsGkAtoms::kerning, // kerning
+  // kerning
   &nsGkAtoms::kernelMatrix, // kernelMatrix
   &nsGkAtoms::kernelUnitLength, // kernelUnitLength
   &nsGkAtoms::keyPoints, // keyPoints
   &nsGkAtoms::keySplines, // keySplines
   &nsGkAtoms::keyTimes, // keyTimes
   &nsGkAtoms::lang, // lang
   // lengthAdjust
   &nsGkAtoms::letter_spacing, // letter-spacing
@@ -575,17 +575,17 @@ nsIAtom** const kAttributesSVG[] = {
   // vert-origin-x
   // vert-origin-y
   &nsGkAtoms::viewBox, // viewBox
   &nsGkAtoms::viewTarget, // viewTarget
   &nsGkAtoms::visibility, // visibility
   &nsGkAtoms::width, // width
   // widths
   &nsGkAtoms::word_spacing, // word-spacing
-  // writing-mode
+  &nsGkAtoms::writing_mode, // writing-mode
   &nsGkAtoms::x, // x
   // x-height
   &nsGkAtoms::x1, // x1
   &nsGkAtoms::x2, // x2
   &nsGkAtoms::xChannelSelector, // xChannelSelector
   &nsGkAtoms::y, // y
   &nsGkAtoms::y1, // y1
   &nsGkAtoms::y2, // y2
--- a/dom/svg/nsSVGElement.cpp
+++ b/dom/svg/nsSVGElement.cpp
@@ -990,24 +990,22 @@ nsSVGElement::sGraphicsMap[] = {
 // PresentationAttributes-TextContentElements
 /* static */ const Element::MappedAttributeEntry
 nsSVGElement::sTextContentElementsMap[] = {
   // Properties that we don't support are commented out.
   // { &nsGkAtoms::alignment_baseline },
   // { &nsGkAtoms::baseline_shift },
   { &nsGkAtoms::direction },
   { &nsGkAtoms::dominant_baseline },
-  // { &nsGkAtoms::glyph_orientation_horizontal },
-  // { &nsGkAtoms::glyph_orientation_vertical },
-  // { &nsGkAtoms::kerning },
   { &nsGkAtoms::letter_spacing },
   { &nsGkAtoms::text_anchor },
   { &nsGkAtoms::text_decoration },
   { &nsGkAtoms::unicode_bidi },
   { &nsGkAtoms::word_spacing },
+  { &nsGkAtoms::writing_mode },
   { nullptr }
 };
 
 // PresentationAttributes-FontSpecification
 /* static */ const Element::MappedAttributeEntry
 nsSVGElement::sFontSpecificationMap[] = {
   { &nsGkAtoms::font_family },
   { &nsGkAtoms::font_size },
--- a/layout/reftests/svg/text/reftest.list
+++ b/layout/reftests/svg/text/reftest.list
@@ -125,16 +125,19 @@ fuzzy-if(skiaContent,1,200) == textLengt
 fuzzy-if(/^Windows\x20NT\x2010\.0/.test(http.oscpu)||/^Windows\x20NT\x206\.[12]/.test(http.oscpu),4,17) fuzzy-if(skiaContent,1,100) == textLength-3.svg textLength-3-ref.svg
 == textLength-4.svg textLength-4-ref.svg
 == textLength-5.svg textLength-5-ref.svg
 == textLength-6.svg textLength-6-ref.svg
 
 # text-shadow
 == text-shadow.svg text-shadow-ref.svg
 
+# vertical text
+pref(layout.css.vertical-text.enabled,true) == vertical-01.svg vertical-01-ref.svg
+
 # tests for ignoring various properties
 == ignore-border.svg ignore-prop-ref.svg
 == ignore-display.svg ignore-display-ref.svg
 == ignore-float.svg ignore-prop-ref.svg
 == ignore-float-first-letter.svg ignore-prop-ref.svg
 == ignore-position.svg ignore-position-ref.svg
 == ignore-margin.svg ignore-prop-ref.svg
 == ignore-padding.svg ignore-prop-ref.svg
new file mode 100644
--- /dev/null
+++ b/layout/reftests/svg/text/vertical-01-ref.svg
@@ -0,0 +1,12 @@
+<!--
+     Any copyright is dedicated to the Public Domain.
+     http://creativecommons.org/publicdomain/zero/1.0/
+-->
+<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
+  <defs>
+    <path id="path" d="M 100, 100 v 200" />
+  </defs>
+  <text style="font: 48px sans-serif" text-rendering="geometricPrecision">
+    <textPath xlink:href="#path">A B C</textPath>
+  </text>
+</svg>
new file mode 100644
--- /dev/null
+++ b/layout/reftests/svg/text/vertical-01.svg
@@ -0,0 +1,10 @@
+<!--
+     Any copyright is dedicated to the Public Domain.
+     http://creativecommons.org/publicdomain/zero/1.0/
+-->
+<svg xmlns="http://www.w3.org/2000/svg">
+  <text x="100" y="100" text-rendering="geometricPrecision"
+        writing-mode="vertical-rl" style="text-orientation: sideways-right;font: 48px sans-serif">
+    A B C
+  </text>
+</svg>