Граф коммитов

1630 Коммитов

Автор SHA1 Сообщение Дата
Ting-Yu Lin cd607fcae6 Bug 775624 Part 24 - Implement operator<< for nsReflowStatus to use mozilla::ToString. r=dholbert
To print log in nsBlockFrame, run "GECKO_BLOCK_DEBUG_FLAGS=reflow ./mach run".

Here is a sample nsReflowStatus string:
[Complete=Y,NIF=N,Truncated=N,Break=N,FirstLetter=Y].

MozReview-Commit-ID: 4voGcXfJlN7

--HG--
extra : rebase_source : f84ba1ef47e30513674e578fab37b66a8b2a1ab3
2017-02-14 18:41:41 +08:00
Ting-Yu Lin 8f840dc923 Bug 775624 Part 22 - Remove NS_FRAME_COMPLETE. r=dholbert
This patch is written by the following script with some manual adjustment to
the comment in nsRubyTextContainerFrame.cpp and nsRubyFrame.cpp, and
nsColumnSetFrame's constructor.

function rename() {
find layout\
     -type f\
     \( -name "*.cpp" -or\
        -name "*.h" \)\
        -exec sed -i -r "s/$1/$2/g" "{}" \;
}

rename "nsReflowStatus *([a-zA-Z0-9]*) = NS_FRAME_COMPLETE" "nsReflowStatus \1"
rename "([a-zA-Z0-9.*]*) *= NS_FRAME_COMPLETE;" "\1.Reset();"
rename "([a-zA-Z0-9.*]*) == NS_FRAME_COMPLETE" "\1.IsEmpty()"

MozReview-Commit-ID: 9tqQAHvdQex

--HG--
extra : rebase_source : 3119776946dc2c8350098b7bf9f3ceff29bdffb5
2017-02-14 17:55:48 +08:00
Ting-Yu Lin 37d27159af Bug 775624 Part 19 - Convert NS_INLINE_BREAK_FIRST_LETTER_COMPLETE to use bit-field and methods. r=dholbert
MozReview-Commit-ID: k1CSWJNMns

--HG--
extra : rebase_source : 1aa775a1e835f3d001f8b2093d0c4fb9f6651630
2017-02-14 17:09:37 +08:00
Ting-Yu Lin 65116ee49c Bug 775624 Part 18 - Convert NS_INLINE_IS_BREAK to a method. r=dholbert
MozReview-Commit-ID: 7Tw1BUjOYgg

--HG--
extra : rebase_source : 907596f5a59dea709063d1f329a2155a430f41fc
2017-02-14 16:33:37 +08:00
Ting-Yu Lin 8f66d2167b Bug 775624 Part 17 - Convert NS_INLINE_IS_BREAK_AFTER to a method. r=dholbert
MozReview-Commit-ID: CD9uuOC3CzP

--HG--
extra : rebase_source : e7a12a1b37f591ba33e4ed8e73502f7cddf5d619
2017-02-14 16:22:04 +08:00
Ting-Yu Lin d5c6d28836 Bug 775624 Part 16 - Convert NS_INLINE_IS_BREAK_BEFORE to a method. r=dholbert
MozReview-Commit-ID: 8vxRpqbZNnk

--HG--
extra : rebase_source : 195e2da23d64da9e9a888968a45eaae2e6539585
2017-02-14 16:05:24 +08:00
Ting-Yu Lin 1c0431a402 Bug 775624 Part 14 - Convert NS_INLINE_GET_BREAK_TYPE to a method. r=dholbert
MozReview-Commit-ID: CAYlv21gPpR

--HG--
extra : rebase_source : f1d44d9ccac983f2051f09f17bf662b5bfad76e3
2017-02-14 15:58:03 +08:00
Ting-Yu Lin 56ebb62910 Bug 775624 Part 12 - Add bit-fields for inline break status, and convert NS_INLINE_LINE_BREAK_BEFORE. r=dholbert
NS_INLINE_LINE_BREAK_BEFORE() was replaced by the help of the following script.

function rename() {
find layout\
     -type f\
     \( -name "*.cpp" -or\
        -name "*.h" \)\
        -exec sed -i -r "s/$1/$2/g" "{}" \;
}

rename " = NS_INLINE_LINE_BREAK_BEFORE\(\);" ".SetInlineLineBreakBeforeAndReset();"

MozReview-Commit-ID: mz6L8zay7q

--HG--
extra : rebase_source : fddffa1288c7a52c7245aec0839a65f8d1d3f008
2017-02-14 11:52:53 +08:00
Ting-Yu Lin 19a2af3275 Bug 775624 Part 11 - Convert NS_MergeReflowStatusInto() to a method. r=dholbert
Also, remove NS_FRAME_TRUNCATED and NS_FRAME_REFLOW_NEXTINFLOW because both
are used only by NS_MergeReflowStatusInto().

MozReview-Commit-ID: LsPOji9j2e

--HG--
extra : rebase_source : 7cf1421c066f0f8df3e8402b84ae0f584cad2d11
2017-02-13 17:15:01 +08:00
Ting-Yu Lin 11579e0ce5 Bug 775624 Part 9 - Convert NS_FRAME_REFLOW_NEXTINFLOW to use bit-field and methods. r=dholbert
MozReview-Commit-ID: 1TXOShK62X8

--HG--
extra : rebase_source : df0b26da3aefc239f11c28ccc746062e88ab86a3
2017-02-13 14:56:45 +08:00
Ting-Yu Lin b7c479e1c2 Bug 775624 Part 8 - Remove NS_FRAME_SET_OVERFLOW_INCOMPLETE. r=dholbert
This patch is written by the help of the following script.

function rename() {
find layout\
     -type f\
     \( -name "*.cpp" -or\
        -name "*.h" \)\
        -exec sed -i -r "s/$1/$2/g" "{}" \;
}

rename "NS_FRAME_SET_OVERFLOW_INCOMPLETE\(\*([a-zA-Z0-9.*]*)\)" "\1->SetOverflowIncomplete()"
rename "NS_FRAME_SET_OVERFLOW_INCOMPLETE\(([a-zA-Z0-9.*]*)\)" "\1.SetOverflowIncomplete()"

MozReview-Commit-ID: EJOIs84vwev

--HG--
extra : rebase_source : 59a5ac827f57e7a0e50910f5a813c44560baeb00
2017-02-11 23:18:04 +08:00
Ting-Yu Lin 14b6536193 Bug 775624 Part 7 - Remove NS_FRAME_SET_INCOMPLETE. r=dholbert
This patch is written by the help of the following script.

function rename() {
find layout\
     -type f\
     \( -name "*.cpp" -or\
        -name "*.h" \)\
        -exec sed -i -r "s/$1/$2/g" "{}" \;
}

rename "NS_FRAME_SET_INCOMPLETE\(\*([a-zA-Z0-9.*]*)\)" "\1->SetIncomplete()"
rename "NS_FRAME_SET_INCOMPLETE\(([a-zA-Z0-9.*]*)\)" "\1.SetIncomplete()"

MozReview-Commit-ID: GOd4y2N6dcz

--HG--
extra : rebase_source : 185f5d6f5a3c8306761860c579eff10d931f3b35
2017-02-11 23:06:17 +08:00
Ting-Yu Lin ba8d9f3b05 Bug 775624 Part 6 - Remove NS_FRAME_OVERFLOW_IS_INCOMPLETE. r=dholbert
This patch is written by the help of the following script.

function rename() {
find layout\
     -type f\
     \( -name "*.cpp" -or\
        -name "*.h" \)\
        -exec sed -i -r "s/$1/$2/g" "{}" \;
}

rename "NS_FRAME_OVERFLOW_IS_INCOMPLETE\(([a-zA-Z0-9.*]*)\)" "\1.IsOverflowIncomplete()"

MozReview-Commit-ID: GOd4y2N6dcz

--HG--
extra : rebase_source : 2945ff0274d91137249eb2b5a053eeec08864a25
2017-02-11 22:54:26 +08:00
Ting-Yu Lin f7a393e947 Bug 775624 Part 5 - Remove NS_FRAME_IS_COMPLETE. r=dholbert
This patch is written by the help of the following script.

function rename() {
find layout\
     -type f\
     \( -name "*.cpp" -or\
        -name "*.h" \)\
        -exec sed -i -r "s/$1/$2/g" "{}" \;
}

rename "NS_FRAME_IS_COMPLETE\(([a-zA-Z0-9.*]*)\)" "\1.IsComplete()"

MozReview-Commit-ID: GOd4y2N6dcz

--HG--
extra : rebase_source : aa8b11d3a756c9e7c521e6ffd70713af0174bd98
2017-02-11 22:45:07 +08:00
Ting-Yu Lin 99ebdf6cf3 Bug 775624 Part 4 - Remove NS_FRAME_IS_FULLY_COMPLETE. r=dholbert
This patch is written by the help of the following script.

function rename() {
find layout\
     -type f\
     \( -name "*.cpp" -or\
        -name "*.h" \)\
        -exec sed -i -r "s/$1/$2/g" "{}" \;
}

rename "NS_FRAME_IS_FULLY_COMPLETE\(([a-zA-Z0-9.*]*)\)" "\1.IsFullyComplete()"

MozReview-Commit-ID: GOd4y2N6dcz

--HG--
extra : rebase_source : 200639e836cebe26fd77cde21f478fd027e1725f
2017-02-11 22:38:48 +08:00
Ting-Yu Lin b31150930a Bug 775624 Part 3 - Remove NS_FRAME_IS_NOT_COMPLETE. r=dholbert
This patch is written by the help of the following script.

function rename() {
find layout\
     -type f\
     \( -name "*.cpp" -or\
        -name "*.h" \)\
        -exec sed -i -r "s/$1/$2/g" "{}" \;
}

rename "NS_FRAME_IS_NOT_COMPLETE\(([a-zA-Z0-9.*]*)\)" "\1.IsIncomplete()"

MozReview-Commit-ID: GOd4y2N6dcz

--HG--
extra : rebase_source : 412b60e7954118d8443ebf2a786046d7cd38c516
2017-02-11 22:17:26 +08:00
Mats Palmgren be996e2f31 Bug 410857 part 2 - DrainOverflowLines before ResolveBidi for slightly improved performance. r=jfkthame 2017-02-20 17:43:08 +01:00
Ting-Yu Lin 90c689bf56 Bug 1338443 Part 1 - Use ReflowInput's float manager in BlockReflowInput. r=dholbert
From the "NS_ASSERTION(mFloatManager)" statement in BlockReflowInput's
constructor, we know that BlockReflowInput's mFloatManager is always valid
and equals to aReflowInput.mFloatManager. Therefore, we could just use
ReflowInput's float manager in BlockReflowInput.

Due to the removal of BlockReflowInput's mFloatManager, the logic which
resets mFloatManager near the end of nsBlockFrame::Reflow() is removed as
well. It's safe because beyond that point, no other logic involves floats,
and |state| (i.e. BlockReflowInput) lives only on the stack.

MozReview-Commit-ID: 3dwXMnWkEI6

--HG--
extra : rebase_source : 7f9af1af10fd54456450b23bc0004dd5f15db4e4
2017-02-09 16:59:07 +08:00
Mats Palmgren 10150aa1b7 Bug 1232194 part 1 - [writing-mode] Drop "Get" from GetConsumedBSize() and add a WritingMode param. r=dholbert 2017-01-04 00:56:19 +01:00
Phil Ringnalda 3f025b28e0 Merge m-c to m-i
MozReview-Commit-ID: 6JjpxZR3ese
2016-12-31 11:32:38 -08:00
Mats Palmgren dfeed3a85d Bug 1325355 part 2 - Rename nsIFrame::GetWritingMode to WritingModeForLine to make its purpose clearer. r=jfkthame 2016-12-31 18:16:32 +01:00
Mats Palmgren ea21a73fc7 Bug 1325355 part 1 - Make nsIFrame::GetWritingMode take a WritingMode param instead of calling this->GetWritingMode(). r=jfkthame 2016-12-31 18:16:32 +01:00
Xidorn Quan 0fe4f86e06 Bug 1322843 part 2 - Conditionally keep some floats in InlinePrefISizeData::ForceBreak. r=dbaron
This patch makes ForceBreak() partially clear floats according to the
break type of the coming block.

MozReview-Commit-ID: 71Gl9lBoTJ5

--HG--
extra : rebase_source : 5ca01565f607241df0c63a7cd64c35ac7ff7648f
2016-12-22 18:30:38 +11:00
Mats Palmgren 6aead680d1 Bug 1322191 part 2b - Replace "NS_BLOCK_FLOAT_MGR | NS_BLOCK_MARGIN_ROOT" with NS_BLOCK_FORMATTING_CONTEXT_STATE_BITS. r=dholbert 2016-12-23 19:11:04 +01:00
Mats Palmgren 46f54ec32b Bug 1322191 part 2 - [css-display] Implement layout for display:flow-root. r=dholbert 2016-12-23 19:11:03 +01:00
Mats Palmgren 99856fc256 Bug 1312379 part 4 - Rename GetBaseline() to BaselineBOffset(). r=me 2016-12-20 23:56:35 +01:00
Mats Palmgren ed15c70d6d Bug 1312379 part 1 - [css-align][css-flexbox][css-grid] Introduce nsIFrame methods for calculating baselines per CSS Alignment and CSS2 'vertical-align'. r=dholbert 2016-12-20 23:56:35 +01:00
Ting-Yu Lin 0bb55f9970 Bug 1309467 Part 4 - Implement <shape-box> values for shape-outside. r=dbaron
Per spec, float positioning and stacking is not affected by defining a float
area with a shape.
https://drafts.csswg.org/css-shapes/#relation-to-box-model-and-float-behavior

So all the call sites of GetFloatAvailableSpace() related to adding a
float are replaced by GetFloatAvailableSpaceForPlacingFloat().

<shape-box> with border-radius will be implemented in next part.

MozReview-Commit-ID: 1RXEeXDhdWo

--HG--
extra : rebase_source : 42cdb0c81b16168e4e30ee2261ceccb562e278cf
2016-10-12 16:06:25 +08:00
Ting-Yu Lin 384e9e119b Bug 1291110 Part 4 - Use line BSize to query available space when updating nsLineLayout. r=dbaron
In nsBlockFrame::PlaceLine(), we query the float available space by
using the line's BSize(), which may cause the line to reflow again due
to available space shrunk.

The first issue lies in the second reflow. That is, we do not leverage
the line's BSize() computed in the first reflow to query the float
available space when updating the inline reflow engine in
BlockReflowInput::AddFloat(). So some tall inline elements could still
overlap the floats as in the first reflow.

To solve this, we cache current line's BSize so that it could be
used to update the inline reflow engine when redo the line.

Another issue is in nsBlockFrame::PlaceLine(). When determined whether
the available space is shrunk, we use the float manager's state *before*
placing the line. So if current line has floats, they're not considered.

To solve this, we use the current set of floats to get the float available
space for comparison, and leave the original aFloatAvailableSpace to provide
the information when redoing the line.

MozReview-Commit-ID: GqqNlphgxYS

--HG--
extra : rebase_source : e2c64ab1ac363c7a08e532dc043bee69d6455049
2016-08-22 19:42:37 +08:00
Ting-Yu Lin 8fa65e4f5d Bug 1291110 Part 3 - Enforce float available space never grow on either side. r=dbaron
This patch is based on bug 1291110 comment 29, but |aCanGrow| is preserved,
since the set of float available spaces we'll be testing in Part 4 are
difference from the one we enforced here.

MozReview-Commit-ID: LswbIaRukVR

--HG--
extra : rebase_source : 007d55fd867d052163ea5bb4222baf201fe30bcf
2016-11-08 15:20:58 +08:00
Ting-Yu Lin 76dba9d5d5 Bug 1291110 Part 2 - Rename availableSpaceHeight to availableSpaceBSize. r=dbaron
Rename to make the variable name consistent with the writing-mode
terminology used in PlaceLine().

MozReview-Commit-ID: AvhwHyHz7hV

--HG--
extra : rebase_source : bcec67d9959c1b881b4d287dbbab47dd0d6e0de9
2016-11-08 13:42:14 +08:00
Mats Palmgren a0c5be1ac8 Bug 1300369 part 6 - Make nsBlockFrame::ComputeFinalSize handle margin-box min-size clamping. r=dholbert 2016-11-05 02:57:06 +01:00
Jeremy Chen aee90be343 Bug 1286468 followup - Fix naming issues.
MozReview-Commit-ID: C2PDA4R5k5F
2016-10-24 15:01:25 +08:00
Jeremy Chen d11d8fe851 Bug 1286468 - Trim trailing whitspaces in nsBlockFrame.h and nsBlockFrame.cpp. r=TYLin
MozReview-Commit-ID: JDgfzmGcb1J

--HG--
extra : rebase_source : 1f4f6dd8a49cfe8ba7829bf09bf20fd06abbc0f5
2016-10-22 19:41:05 +08:00
Jeremy Chen 349eabf2f7 Bug 1286468 - Rename line related functions in nsBlockFrame. r=TYLin
1. Rename these functions to agree with Mozilla coding style.
2. Use singular naming instead of plural naming since each of these functions
returns an iterator pointing to a singular line.
3. Rename line() and rline() to BeginLineFrom() and RBeginLineFrom(), which
shall improve the readability.

MozReview-Commit-ID: txZjVnv9Yb

--HG--
extra : rebase_source : b4dae99ab7bf751bd9974616f8f8e6dfe6248fc2
2016-10-22 19:41:05 +08:00
Jeremy Chen a670e3349a Bug 1286468 - Rename line related typedefs in nsBlockFrame. r=TYLin
MozReview-Commit-ID: Cz9R3D4NzMc

--HG--
extra : rebase_source : 19da1e2a58abedf61fddd9c8e314830cf81a4602
2016-10-22 19:41:04 +08:00
Xidorn Quan 93217168b7 Bug 1304556 part 1 - Add AutoLineCursorSetup RAII class for local line cursor setup. r=dbaron
MozReview-Commit-ID: G5xeCkxsm8N

--HG--
extra : rebase_source : 2da555d2ae07336bedfcc79944b77931748bcc7a
2016-10-21 12:41:52 +11:00
Jeremy Chen 75a2c5a6bf Bug 1307728 - convert LineReflowStatus to an enum class. r=mats
Since we're converting LineReflowStatus to an enum class, the "default:" branch
of LineReflowStatusToString() could be removed as well. In this way, we can add
protection at compile time (warning) instead of runtime (assertion).

MozReview-Commit-ID: 8Ul0eCxqSTR

--HG--
extra : rebase_source : 81cc36bf1ae566d7114466661b7d0db6d63e364f
2016-10-07 00:36:07 +08:00
Jeremy Chen f210ff2e08 Bug 1307728 - use LineReflowStatusToString to support debugging. r=mats
This is a pre-patch that uses LineReflowStatusToString() function instead of
LineReflowStatusNames array to support debugging. With this patch, we could
easily regain debugging support from LineReflowStatusToString() while converting
LineReflowStatus to an enum class.

MozReview-Commit-ID: K2AzZ2zI69p

--HG--
extra : rebase_source : bfbb1221ffb59cd4c27c3fb147a3a3b64e86cf68
2016-10-07 00:36:07 +08:00
Ting-Yu Lin 2884834832 Bug 1301630 - Remove nsBlockFrame::SetFlags(). r=bz
Per bug 1299753 comment 20, SetFlags() is designed for flag propagation
to continuations during block reflow. To avoid misuse, I expand
SetFlags() directly in the only reasonable caller nsBlackFrame::Init(),
and replace other usages by AddStateBits().

MozReview-Commit-ID: GsbE2Z0Rps1

--HG--
extra : rebase_source : 72a64e9218870d638f67d1b586f533cd7d16c491
2016-09-09 15:26:57 +08:00
Manish Goregaokar aad318e17a Bug 1300337 - Replace None_ variants from nsStyleConsts.h with None; r=heycam,TYLin
MozReview-Commit-ID: CxHzbEzjLxT

--HG--
extra : rebase_source : 232f90b8b107f7fb49f47a29a4e493660b8a7d87
2016-09-04 00:16:58 +05:30
Ting-Yu Lin 13f0d4632f Bug 1299753 Part 2 - Create block formatting context for DetailsFrame if needed. r=bz
nsCSSFrameConstructor::ConstructNonScrollableBlock() has logic to
determine whether to create a block formatting context for a block
frame. I refactor the function to make it reusable by
nsCSSFrameConstructor::ConstructDetailsFrame().

Also, make NS_NewBlockFrame() accept two arguments as other frame
factory functions so that it could be pointed by BlockFrameCreationFunc.
NS_NewBlockFormattingContext is changed accordingly.

The construction for a scrollable DetailsFrame will be further revised
in Part 3.

MozReview-Commit-ID: 8TwG9YMyGva

--HG--
extra : rebase_source : fffdd974df81a809a607491d2534aa8dd2d13ab1
2016-09-07 14:45:42 +08:00
Jeremy Chen ff6fbed7e1 Bug 1297306 - part7:replace StyleClear related NS_ASSERTION with MOZ_ASSERT. r=xidorn
MozReview-Commit-ID: Dzd3uOoQCI

--HG--
extra : rebase_source : 821b1b69be94796c1bf7d28142c8653498fb1930
2016-09-07 10:20:17 +08:00
Jeremy Chen c6d0429830 Bug 1297306 - part6:replace NS_STYLE_CLEAR_* with StyleClear enum class. r=xidorn
After using enum class, a switch-case warning in CombineBreakType is caught.
This is one of such kind safty checks that we would like to gain.
Fix it by adding default case for switch-case in CombineBreakType.

MozReview-Commit-ID: BdS3LPN6qzX

--HG--
extra : rebase_source : 17f24a0d482ed6eb51b23e6942d0ac1c87375e0b
2016-09-07 10:20:17 +08:00
Xidorn Quan 57e31c7faa Bug 1260031 followup - Remove unused parameter of BlockReflowInput::ComputeBlockAvailSpace. r=dbaron
MozReview-Commit-ID: 7ZZ0xw9l4YZ

--HG--
extra : rebase_source : 7b0c0138cf1af76608db4fb997c313a590ef054e
2016-08-22 21:39:54 +10:00
Xidorn Quan 4e5bd79656 Bug 1260031 - Not force break before a block when calculating intrinsic width if the current line is empty and the block cannot intersect floats. r=dbaron
MozReview-Commit-ID: 9rNUDK5t5jg

--HG--
extra : rebase_source : 2a852efe3f9801884e558f22ae7d9550fae87836
2016-08-23 09:29:45 +10:00
Emilio Cobos Álvarez 619cb14d87 Bug 1299066: Make NS_STYLE_DISPLAY_* an enum class. Prefer indexing instead of linear search in the frame constructor r=heycam,bz
The main renaming was generated with the following python script:

```

import sys
import re

CAMEL_CASE_REGEX = re.compile(r"(^|_|-)([A-Z])([A-Z]+)")
DISPLAY_REGEX = re.compile(r"\bNS_STYLE_DISPLAY_([^M][A-Z_]+)\b")

def to_camel_case(ident):
  return re.sub(CAMEL_CASE_REGEX,
                lambda m: m.group(2) + m.group(3).lower(), ident)

def constant_to_enum(constant):
  return "StyleDisplay::" + to_camel_case(constant) + ("_" if constant == "NONE" else "")

def process_line(line):
  return re.sub(DISPLAY_REGEX,
                lambda m: constant_to_enum(m.group(1)), line)

lines = []
with open(sys.argv[1], "r") as f:
  for line in f:
    lines.append(process_line(line))

with open(sys.argv[1], "w") as f:
  for line in lines:
    f.write(line)
```

And the following shell commands:

```
find . -name '*.cpp' -exec python display.py {} \;
find . -name '*.h' -exec python display.py {} \;
```

MozReview-Commit-ID: 91xYCbLC2Vf
2016-09-01 20:41:17 -07:00
Mats Palmgren 70a3ff3851 Bug 1171419 part 10 - Rename RenumberLists() to RenumberList(). r=xidorn 2016-09-01 17:36:23 +02:00
Mats Palmgren fa28266c00 Bug 1171419 part 7 - Make nsBlockFrame::AttributeChanged look for flex/grid ancestors too, not just blocks. r=xidorn 2016-09-01 17:36:22 +02:00
Mats Palmgren 0d83513904 Bug 1171419 part 6 - Move nsBlockFrame::AttributeChanged <ol> handling to nsContainerFrame so that it works not just for blocks. r=xidorn 2016-09-01 17:36:22 +02:00