Bug 778654 - Display tabIndex outline; r?heycam draft
authorDaosheng Mu <daoshengmu@gmail.com>
Tue, 24 May 2016 12:23:22 +0800
changeset 397491 1825a970a82a5436ca530a046e247bcbf448d79f
parent 397490 55e77661aee6febd4e2e28aa8f191dff26e6b774
child 397492 90082401289fbb38a3b76a775d3a1fc11ffe3ae0
child 397494 05a522588bdd3150600827a84caa8613528a707d
child 397497 437c4388a6e888796d53d57f733ba3d43ff1a862
push id25322
push userbmo:dmu@mozilla.com
push dateSat, 06 Aug 2016 03:01:49 +0000
reviewersheycam
bugs778654
milestone50.0a1
Bug 778654 - Display tabIndex outline; r?heycam MozReview-Commit-ID: GRZzECINScl
layout/svg/SVGTextFrame.cpp
layout/svg/nsSVGContainerFrame.cpp
layout/svg/nsSVGForeignObjectFrame.cpp
layout/svg/nsSVGPathGeometryFrame.cpp
layout/svg/svg.css
--- a/layout/svg/SVGTextFrame.cpp
+++ b/layout/svg/SVGTextFrame.cpp
@@ -3254,16 +3254,17 @@ SVGTextFrame::BuildDisplayList(nsDisplay
     // have updated mPositions, etc.  In this case, we just avoid
     // painting.
     return;
   }
   if (!IsVisibleForPainting(aBuilder) &&
       aBuilder->IsForPainting()) {
     return;
   }
+  DisplayOutline(aBuilder, aLists);
   aLists.Content()->AppendNewToTop(
     new (aBuilder) nsDisplaySVGText(aBuilder, this));
 }
 
 nsresult
 SVGTextFrame::AttributeChanged(int32_t aNameSpaceID,
                                nsIAtom* aAttribute,
                                int32_t aModType)
--- a/layout/svg/nsSVGContainerFrame.cpp
+++ b/layout/svg/nsSVGContainerFrame.cpp
@@ -143,16 +143,17 @@ nsSVGDisplayContainerFrame::BuildDisplay
                                              const nsRect&           aDirtyRect,
                                              const nsDisplayListSet& aLists)
 {
   // mContent could be a XUL element so check for an SVG element before casting
   if (mContent->IsSVGElement() &&
       !static_cast<const nsSVGElement*>(mContent)->HasValidDimensions()) {
     return;
   }
+  DisplayOutline(aBuilder, aLists);
   return BuildDisplayListForNonBlockChildren(aBuilder, aDirtyRect, aLists);
 }
 
 void
 nsSVGDisplayContainerFrame::InsertFrames(ChildListID aListID,
                                          nsIFrame* aPrevFrame,
                                          nsFrameList& aFrameList)
 {
--- a/layout/svg/nsSVGForeignObjectFrame.cpp
+++ b/layout/svg/nsSVGForeignObjectFrame.cpp
@@ -161,16 +161,17 @@ nsSVGForeignObjectFrame::Reflow(nsPresCo
 void
 nsSVGForeignObjectFrame::BuildDisplayList(nsDisplayListBuilder*   aBuilder,
                                           const nsRect&           aDirtyRect,
                                           const nsDisplayListSet& aLists)
 {
   if (!static_cast<const nsSVGElement*>(mContent)->HasValidDimensions()) {
     return;
   }
+  DisplayOutline(aBuilder, aLists);
   BuildDisplayListForNonBlockChildren(aBuilder, aDirtyRect, aLists);
 }
 
 bool
 nsSVGForeignObjectFrame::IsSVGTransformed(Matrix *aOwnTransform,
                                           Matrix *aFromParentTransform) const
 {
   bool foundTransform = false;
--- a/layout/svg/nsSVGPathGeometryFrame.cpp
+++ b/layout/svg/nsSVGPathGeometryFrame.cpp
@@ -261,16 +261,17 @@ void
 nsSVGPathGeometryFrame::BuildDisplayList(nsDisplayListBuilder*   aBuilder,
                                          const nsRect&           aDirtyRect,
                                          const nsDisplayListSet& aLists)
 {
   if (!static_cast<const nsSVGElement*>(mContent)->HasValidDimensions() ||
       (!IsVisibleForPainting(aBuilder) && aBuilder->IsForPainting())) {
     return;
   }
+  DisplayOutline(aBuilder, aLists);
   aLists.Content()->AppendNewToTop(
     new (aBuilder) nsDisplaySVGPathGeometry(aBuilder, this));
 }
 
 //----------------------------------------------------------------------
 // nsISVGChildFrame methods
 
 DrawResult
--- a/layout/svg/svg.css
+++ b/layout/svg/svg.css
@@ -71,16 +71,21 @@ foreignObject {
 
 *|*::-moz-svg-marker-anon-child {
   clip-path: inherit;
   filter: inherit;
   mask: inherit;
   opacity: inherit;
 }
 
+*:-moz-focusring {
+  /* Don't specify the outline-color, we should always use initial value. */
+  outline: 1px dotted;
+}
+
 /* nsDocumentViewer::CreateStyleSet doesn't load ua.css.
  * A few styles are common to html and SVG though
  * so we copy the rules below from that file.
  */
 
 /* Links */
 
 *|*:any-link {