Bug 1221874 - Ignore the sideways-orientation flag when logical-coordinate classes are checking writing-mode compatibility. r=smontagu
authorJonathan Kew <jkew@mozilla.com>
Thu, 05 Nov 2015 15:38:53 +0000
changeset 293040 13dd11b7a0f8bc8dded14a39140c740d7f81f491
parent 293039 a00a4faead69df2a87111318c83f9d774459c467
child 293041 d4284fa3e8b1df993b95dffed159d6897281e26b
push id8824
push userraliiev@mozilla.com
push dateMon, 14 Dec 2015 20:18:56 +0000
treeherdermozilla-aurora@e2031358e2a6 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerssmontagu
bugs1221874
milestone45.0a1
Bug 1221874 - Ignore the sideways-orientation flag when logical-coordinate classes are checking writing-mode compatibility. r=smontagu
layout/generic/WritingModes.h
layout/generic/crashtests/crashtests.list
--- a/layout/generic/WritingModes.h
+++ b/layout/generic/WritingModes.h
@@ -19,19 +19,22 @@
 // support using debug builds.
 
 // Methods in logical-coordinate classes that take another logical-coordinate
 // object as a parameter should call CHECK_WRITING_MODE on it to verify that
 // the writing modes match.
 // (In some cases, there are internal (private) methods that don't do this;
 // such methods should only be used by other methods that have already checked
 // the writing modes.)
+// The check ignores the eSidewaysMask bit of writing mode, because this does
+// not affect the interpretation of logical coordinates.
 
 #define CHECK_WRITING_MODE(param) \
-   NS_ASSERTION(param == GetWritingMode(), "writing-mode mismatch")
+   NS_ASSERTION(param.IgnoreSideways() == GetWritingMode().IgnoreSideways(), \
+                "writing-mode mismatch")
 
 namespace mozilla {
 
 namespace widget {
 struct IMENotification;
 } // namespace widget
 
 // Physical axis constants.
@@ -254,16 +257,23 @@ public:
    * in vertical lines, in which case we should prefer an alphabetic baseline;
    * otherwise, the default is centered.
    * Note that some glyph runs may be rendered sideways even if this is false,
    * due to text-orientation:mixed resolution, but in that case the dominant
    * baseline remains centered.
    */
   bool IsSideways() const { return !!(mWritingMode & eSidewaysMask); }
 
+#ifdef DEBUG // Used by CHECK_WRITING_MODE to compare modes without regard
+             // for the eSidewaysMask flag.
+  WritingMode IgnoreSideways() const {
+    return WritingMode(mWritingMode & ~eSidewaysMask);
+  }
+#endif
+
   static mozilla::PhysicalAxis PhysicalAxisForLogicalAxis(
                                               uint8_t aWritingModeValue,
                                               LogicalAxis aAxis)
   {
     // This relies on bit 0 of a writing-value mode indicating vertical
     // orientation and bit 0 of a LogicalAxis value indicating the inline axis,
     // so that it can correctly form mozilla::PhysicalAxis values using bit
     // manipulation.
--- a/layout/generic/crashtests/crashtests.list
+++ b/layout/generic/crashtests/crashtests.list
@@ -582,17 +582,17 @@ load 1146114.html
 load 1156222.html
 pref(layout.css.grid.enabled,true) load 1156257.html
 load 1157011.html
 load 1169420-1.html
 load 1169420-2.html
 load 1183431.html
 load 1221112-1.html
 load 1221112-2.html
-asserts(1) load 1221874-1.html
+load 1221874-1.html
 load first-letter-638937-1.html
 load first-letter-638937-2.html
 pref(dom.meta-viewport.enabled,true) test-pref(font.size.inflation.emPerLine,15) asserts(1-100) load font-inflation-762332.html # bug 762332
 load outline-on-frameset.xhtml
 load text-overflow-bug666751-1.html
 load text-overflow-bug666751-2.html
 load text-overflow-bug670564.xhtml
 load text-overflow-bug671796.xhtml