Bug 1164693 - part 3: Exclude optimizations that don't apply to preformatted paragraphs. r=smontagu
authorTed Clancy <tclancy@mozilla.com>
Sat, 20 Jun 2015 08:52:34 -0700
changeset 250037 b232c2a5af6dbf745e52b8514b529914d27da3a1
parent 250036 2a383ebb99d5a76b2fdd13b4248368feec57e639
child 250038 1019348c77860c34354e5674e21cbba09877c891
push id28943
push usercbook@mozilla.com
push dateWed, 24 Jun 2015 14:02:00 +0000
treeherdermozilla-central@4cdc1a95a672 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerssmontagu
bugs1164693
milestone41.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 1164693 - part 3: Exclude optimizations that don't apply to preformatted paragraphs. r=smontagu
layout/generic/nsTextFrame.cpp
--- a/layout/generic/nsTextFrame.cpp
+++ b/layout/generic/nsTextFrame.cpp
@@ -614,29 +614,30 @@ int32_t nsTextFrame::GetContentEnd() con
 struct FlowLengthProperty {
   int32_t mStartOffset;
   // The offset of the next fixed continuation after mStartOffset, or
   // of the end of the text if there is none
   int32_t mEndFlowOffset;
 };
 
 int32_t nsTextFrame::GetInFlowContentLength() {
-  if (!(mState & NS_FRAME_IS_BIDI)) {
+  if (!(mState & NS_FRAME_IS_BIDI) &&
+      !StyleText()->NewlineIsSignificant(this)) {
     return mContent->TextLength() - mContentOffset;
   }
 
   FlowLengthProperty* flowLength =
     static_cast<FlowLengthProperty*>(mContent->GetProperty(nsGkAtoms::flowlength));
 
   /**
    * This frame must start inside the cached flow. If the flow starts at
    * mContentOffset but this frame is empty, logically it might be before the
    * start of the cached flow.
    */
-  if (flowLength && 
+  if (flowLength && !StyleText()->NewlineIsSignificant(this) &&
       (flowLength->mStartOffset < mContentOffset ||
        (flowLength->mStartOffset == mContentOffset && GetContentEnd() > mContentOffset)) &&
       flowLength->mEndFlowOffset > mContentOffset) {
 #ifdef DEBUG
     NS_ASSERTION(flowLength->mEndFlowOffset >= GetContentEnd(),
 		 "frame crosses fixed continuation boundary");
 #endif
     return flowLength->mEndFlowOffset - mContentOffset;