Bug 1315874 - Tweak some line wrapping in DoGetStyleContextNoFlush; r=heycam draft
authorBrian Birtles <birtles@gmail.com>
Mon, 03 Apr 2017 16:49:10 +0900
changeset 555974 392e53f521689422e92643d22189a55f0b491f2e
parent 555973 6f9f8231654952ceadf49c2887b8868c2c18934b
child 555975 e47894de78368ecdf2b07cd4f21e5348909f30da
push id52387
push userbbirtles@mozilla.com
push dateWed, 05 Apr 2017 06:09:34 +0000
reviewersheycam
bugs1315874
milestone55.0a1
Bug 1315874 - Tweak some line wrapping in DoGetStyleContextNoFlush; r=heycam In ensuring that this method does *not* re-use the existing style context if aStyleType != eAll, I found it easy to miss this check in the multi-condition if statement due to the way some, but not all, of the conditions are on one line. I think this would be a little easier to read if this multi-line condition used one line per condition. MozReview-Commit-ID: 4UOAGhAndIV
layout/style/nsComputedDOMStyle.cpp
--- a/layout/style/nsComputedDOMStyle.cpp
+++ b/layout/style/nsComputedDOMStyle.cpp
@@ -592,17 +592,19 @@ nsComputedDOMStyle::DoGetStyleContextNoF
     presShell = aPresShell;
     if (!presShell)
       return nullptr;
   }
 
   // XXX the !aElement->IsHTMLElement(nsGkAtoms::area)
   // check is needed due to bug 135040 (to avoid using
   // mPrimaryFrame). Remove it once that's fixed.
-  if (!aPseudo && aStyleType == eAll && inDocWithShell &&
+  if (!aPseudo &&
+      aStyleType == eAll &&
+      inDocWithShell &&
       !aElement->IsHTMLElement(nsGkAtoms::area)) {
     nsIFrame* frame = nsLayoutUtils::GetStyleFrame(aElement);
     if (frame) {
       nsStyleContext* result = frame->StyleContext();
       // Don't use the style context if it was influenced by
       // pseudo-elements, since then it's not the primary style
       // for this element.
       if (!result->HasPseudoElementData()) {