Bug 1141607. Fix the initial value of outline-color to actually be correct. r=dbaron
authorBoris Zbarsky <bzbarsky@mit.edu>
Tue, 28 Apr 2015 14:48:39 -0400
changeset 241585 8b43e06f82d6b78595f4cae08dc6e89aa78cfd51
parent 241584 0aff2f4087ed9cd0d9b1ce7e79860e1953e4ddbc
child 241586 fa8ccc8fb9ed6aa0a3b618009f62c4177d69a979
push id28665
push userkwierso@gmail.com
push dateWed, 29 Apr 2015 23:43:43 +0000
treeherderautoland@a86ed85747d8 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersdbaron
bugs1141607
milestone40.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 1141607. Fix the initial value of outline-color to actually be correct. r=dbaron
layout/reftests/outline/outline-initial-1-ref.html
layout/reftests/outline/outline-initial-1a.html
layout/reftests/outline/outline-initial-1b.html
layout/reftests/outline/reftest.list
layout/style/nsStyleStruct.cpp
layout/style/test/test_transitions_events.html
new file mode 100644
--- /dev/null
+++ b/layout/reftests/outline/outline-initial-1-ref.html
@@ -0,0 +1,5 @@
+<!DOCTYPE html>
+<span style="outline-width: 2px; outline-style: solid; color: green;
+             outline-color: green">
+  This should have a green outline.
+</span>
new file mode 100644
--- /dev/null
+++ b/layout/reftests/outline/outline-initial-1a.html
@@ -0,0 +1,4 @@
+<!DOCTYPE html>
+<span style="outline-width: 2px; outline-style: solid; color: green">
+  This should have a green outline.
+</span>
new file mode 100644
--- /dev/null
+++ b/layout/reftests/outline/outline-initial-1b.html
@@ -0,0 +1,5 @@
+<!DOCTYPE html>
+<span style="outline-width: 2px; outline-style: solid; color: green;
+             outline-color: initial">
+  This should have a green outline.
+</span>
--- a/layout/reftests/outline/reftest.list
+++ b/layout/reftests/outline/reftest.list
@@ -2,8 +2,10 @@
 == outline-and-3d-transform-1a.html outline-and-3d-transform-1-ref.html
 == outline-and-3d-transform-1b.html outline-and-3d-transform-1-ref.html
 fuzzy-if(d2d,16,96) == outline-and-3d-transform-2.html outline-and-3d-transform-2-ref.html
 == outline-overflow-block-abspos.html outline-overflow-block-ref.html
 == outline-overflow-block-float.html outline-overflow-block-ref.html
 == outline-overflow-inlineblock-abspos.html outline-overflow-inlineblock-ref.html
 == outline-overflow-inlineblock-float.html outline-overflow-inlineblock-ref.html
 pref(layout.css.outline-style-auto.enabled,true) skip-if((!gtk2Widget&&!winWidget&&!cocoaWidget)||Mulet) == outline-auto-001.html outline-auto-001-ref.html # only works on platforms that supports NS_THEME_FOCUS_OUTLINE # bug 1141511:  Disable some gtk2Widget-dependant reftests on Mulet
+== outline-initial-1a.html outline-initial-1-ref.html
+== outline-initial-1b.html outline-initial-1-ref.html
--- a/layout/style/nsStyleStruct.cpp
+++ b/layout/style/nsStyleStruct.cpp
@@ -603,16 +603,18 @@ nsStyleOutline::nsStyleOutline(nsPresCon
   mOutlineOffset = 0;
 
   mOutlineWidth = nsStyleCoord(NS_STYLE_BORDER_WIDTH_MEDIUM, eStyleUnit_Enumerated);
   mOutlineStyle = NS_STYLE_BORDER_STYLE_NONE;
   mOutlineColor = NS_RGB(0, 0, 0);
 
   mHasCachedOutline = false;
   mTwipsPerPixel = aPresContext->DevPixelsToAppUnits(1);
+
+  SetOutlineInitialColor();
 }
 
 nsStyleOutline::nsStyleOutline(const nsStyleOutline& aSrc)
   : mOutlineRadius(aSrc.mOutlineRadius)
   , mOutlineWidth(aSrc.mOutlineWidth)
   , mOutlineOffset(aSrc.mOutlineOffset)
   , mCachedOutlineWidth(aSrc.mCachedOutlineWidth)
   , mOutlineColor(aSrc.mOutlineColor)
--- a/layout/style/test/test_transitions_events.html
+++ b/layout/style/test/test_transitions_events.html
@@ -16,16 +16,17 @@ https://bugzilla.mozilla.org/show_bug.cg
 #two { transition: margin-left 1s; }
 #three { transition: margin 0.5s 0.25s; }
 
 #four, #five, #six, #seven::before, #seven::after {
   transition: 500ms color;
   border-color: black; /* don't derive from color */
   -moz-column-rule-color: black; /* don't derive from color */
   text-decoration-color: black; /* don't derive from color */
+  outline-color: black; /* don't derive from color */
 }
 
 #four {
   /* give the reversing transition a long duration; the reversing will
      still be quick */
   transition-duration: 30s;
   transition-timing-function: cubic-bezier(0, 1, 1, 0);
 }
@@ -67,16 +68,17 @@ function cs(id) { return getComputedStyl
 var got_one_root = false;
 var got_one_target = false;
 var got_one_target_bordertop = false;
 var got_one_target_borderright = false;
 var got_one_target_borderbottom = false;
 var got_one_target_borderleft = false;
 var got_one_target_columnrule = false;
 var got_one_target_textdecorationcolor = false;
+var got_one_target_outlinecolor = false;
 var got_two_target = false;
 var got_three_top = false;
 var got_three_right = false;
 var got_three_bottom = false;
 var got_three_left = false;
 var got_four_root = false;
 var got_body = false;
 var did_stops = false;
@@ -179,16 +181,22 @@ document.documentElement.addEventListene
         event.stopPropagation();
         break;
       case "text-decoration-color":
         ok(!got_one_target_textdecorationcolor,
            "transitionend on one on target (text-decoration-color)");
         got_one_target_textdecorationcolor = true;
         event.stopPropagation();
         break;
+      case "outline-color":
+        ok(!got_one_target_outlinecolor,
+           "transitionend on one on target (outline-color)");
+        got_one_target_outlinecolor = true;
+        event.stopPropagation();
+        break;
       default:
         ok(false, "unexpected property name " + event.propertyName +
                   " for transitionend on one on target");
     }
     is(event.elapsedTime, 0.5,
        "elapsedTime for transitionend on one");
     is(cs("one").getPropertyValue(event.propertyName), "rgb(0, 255, 0)",
        "computed style of " + event.propertyName + " for transitionend on one");