Bug 1581579 - Fix scrollbar style caching conflict for <resizer dir="bottom"> vs <resizer dir="bottomleft">. r=emilio
authorCameron McCormack <cam@mcc.id.au>
Mon, 30 Sep 2019 09:51:07 +0000
changeset 495839 d7e8ed7c8e5b6cf53abe5bfb9247a50ade475e9b
parent 495838 f5cce52461bac31945b083e51a085fb429a36f04
child 495840 46c2aeec240856f8f86678dc32ed9717ea2f41fd
push id36639
push userrgurzau@mozilla.com
push dateWed, 02 Oct 2019 16:35:54 +0000
treeherdermozilla-central@314a0fee08fd [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersemilio
bugs1581579
milestone71.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 1581579 - Fix scrollbar style caching conflict for <resizer dir="bottom"> vs <resizer dir="bottomleft">. r=emilio Differential Revision: https://phabricator.services.mozilla.com/D47568
layout/generic/AnonymousContentKey.h
layout/generic/nsGfxScrollFrame.cpp
layout/style/crashtests/1581579.html
layout/style/crashtests/crashtests.list
--- a/layout/generic/AnonymousContentKey.h
+++ b/layout/generic/AnonymousContentKey.h
@@ -32,19 +32,22 @@ enum class AnonymousContentKey : uint8_t
   Type_Scrollbar                 = 0x03,
   Type_ScrollbarButton           = 0x04,
   Type_Slider                    = 0x05,
 
   // scrollbar, scrollbarbutton, slider
   Flag_Vertical                  = 0x08,
 
   // resizer
+  // 3-bit bitfield in 0x38 storing dir="" and flip=""
   Flag_Resizer_Right             = 0x08,
   Flag_Resizer_Bottom            = 0x10,
-  Flag_Resizer_Flip              = 0x20,
+  Flag_Resizer_BottomLeft        = 0x18,
+  Flag_Resizer_BottomRight       = 0x20,
+  Flag_Resizer_Bottom_Flip       = 0x28,
 
   // scrollbarbutton
   Flag_ScrollbarButton_Down      = 0x10,
   Flag_ScrollbarButton_Bottom    = 0x20,
   Flag_ScrollbarButton_Decrement = 0x40,
 };
 
 // clang-format on
--- a/layout/generic/nsGfxScrollFrame.cpp
+++ b/layout/generic/nsGfxScrollFrame.cpp
@@ -4902,30 +4902,31 @@ nsresult ScrollFrameHelper::CreateAnonym
           dir.AssignLiteral("right");
           key |= AnonymousContentKey::Flag_Resizer_Right;
         } else {
           dir.AssignLiteral("left");
         }
         break;
       case StyleResize::Vertical:
         dir.AssignLiteral("bottom");
-        key |= AnonymousContentKey::Flag_Resizer_Bottom;
         if (!IsScrollbarOnRight()) {
           mResizerContent->SetAttr(kNameSpaceID_None, nsGkAtoms::flip,
                                    EmptyString(), false);
-          key |= AnonymousContentKey::Flag_Resizer_Flip;
+          key |= AnonymousContentKey::Flag_Resizer_Bottom_Flip;
+        } else {
+          key |= AnonymousContentKey::Flag_Resizer_Bottom;
         }
         break;
       case StyleResize::Both:
-        key |= AnonymousContentKey::Flag_Resizer_Bottom;
         if (IsScrollbarOnRight()) {
           dir.AssignLiteral("bottomright");
-          key |= AnonymousContentKey::Flag_Resizer_Right;
+          key |= AnonymousContentKey::Flag_Resizer_BottomRight;
         } else {
           dir.AssignLiteral("bottomleft");
+          key |= AnonymousContentKey::Flag_Resizer_BottomLeft;
         }
         break;
       default:
         NS_WARNING("only resizable types should have resizers");
     }
     mResizerContent->SetAttr(kNameSpaceID_None, nsGkAtoms::dir, dir, false);
 
     if (mIsRoot) {
new file mode 100644
--- /dev/null
+++ b/layout/style/crashtests/1581579.html
@@ -0,0 +1,3 @@
+<div dir="RTL">
+<textarea style="resize: vertical" dir="auto"></textarea>
+<textarea></textarea>
--- a/layout/style/crashtests/crashtests.list
+++ b/layout/style/crashtests/crashtests.list
@@ -305,8 +305,9 @@ pref(gfx.omta.background-color,true) loa
 load 1541126.html
 load 1545177.html
 skip-if(geckoview&&webrender) skip-if(Android) load 1546255.html # Bug 1563020 for GV+WR & Bug 1553971
 pref(layout.css.resizeobserver.enabled,true) load 1552911.html
 load 1562361.html
 load 1566684.html
 load 1579788.html
 load 1580307.html
+load 1581579.html