In the printing preview, we create continuous table frame if table is too
long to containing in a page. But the default value of
NeedToCalcHasBCBorders is false which means we don't calculate
HasBCBorders for continuous table frame. Thus, the border collapse is
not shown when printing preview.
MozReview-Commit-ID: IqhLSYuWj30
Before this change, we used eColGroupContent for both colgroups created by table-column-group elements and anonymous colgroups wrapping table-column elements. eColGroupAnonymousCell was used for colgroups created to handle cells that are not in any other colgroup already. eColGroupAnonymousCol was unused.
In our UA sheet the only style we apply to ::-moz-table-column is "display: table-column".
Per spec, the only styles that apply to table columns are border props,
background props, 'width', and 'visibility'.
The only one of those that inherits is 'visibility'. And the only relevant
value per spec is "collapse". But an anonymous column can only be "visibility:
collapse" in Gecko right now if its colgroup is, and then the colgroup will get
collapsed away as a whole. So it doesn't matter whether the column inherits the
visibility style.
In practice, we do something special for "hidden" on a table-column as well,
during display list building, which affects hit-testing. Per
https://github.com/w3c/csswg-drafts/issues/1763 it's not clear that we should be
doing this at all, but for now we just keep our existing behavior and ensure
that the parent colgroup's visibility style is taken into account for anonymous
columns when building display lists.
There's no real reason to restrict this to LayerSize, since we use
use Layer and LayoutDevice coordinate spaces interchangeably for
webrender. With the templating of the function the compiler doesn't know
what type to use for {0, 0} so I added a new function to deal with that.
MozReview-Commit-ID: BA83Sy9UjYH
--HG--
extra : rebase_source : 15e5b31d0275628713c5eb584d622d22485dfda9
There's no real reason to restrict this to LayerSize, since we use
use Layer and LayoutDevice coordinate spaces interchangeably for
webrender. With the templating of the function the compiler doesn't know
what type to use for {0, 0} so I added a new function to deal with that.
MozReview-Commit-ID: KyabB6P6LiA
--HG--
extra : rebase_source : d5fff8f21a17c433d3c8c580fdd3153140d61545
Before bug 929484, border-radius on row groups, rows, column groups,
or columns don't apply to the background of each cell, yet the
border-radius on the cell itself does. After bug 929484, the behaviors
changed. In this patch, I tried to revert the behaviors of border-radius
on table row groups, rows, column groups, or columns back to
what happened before bug 929484.
MozReview-Commit-ID: 1Xg1qHde3lk
--HG--
extra : rebase_source : ff08f8390ff910fe8c141a75275134f77a1cec3e
Previously, in paginated mode, all reflows were dirty reflows, since
tables do not split outside of printing, and prior to the primary patch
in bug 1308876, all reflows during printing are dirty reflows. (The
isPaginated test here is actually for real pages, not fragmentation in
general. However, the use here is appropriate for the meaning of
whether it's possible for the table to fragment.)
The fact that all reflows were dirty reflows meant that the
NS_FRAME_CONTAINS_RELATIVE_BSIZE flag was always cleared immediately
before reflow in ReflowInput::InitResizeFlags (which might also have set
the flag on *ancestors*). This meant that, prior to the primary patch
in bug 1308876, the initial value of needToInitiateSpecialReflow that
was initialized from the presence of the
NS_FRAME_CONTAINS_RELATIVE_BSIZE flag was always false. This patch
preserves that initialization in the presence of the change in the
primary patch in bug 1308876.
This caused a failure in a single test in our test suite, and in a
rather complicated way. The test was
layout/base/crashtests/470851-1.xhtml, in which there was both a
difference in assertion count (due to the bogus assertion "data loss -
incomplete row needed more height than available, on top of page" in
nsTableRowGroupFrame::SplitRowGroup, whose companion assertion "data
loss - complete row needed more height than available, on top of page"
is already just an NS_WARNING) that caused a test failure, and a
difference in layout (the test split across 3 pages rather than 2) that
did not cause a test failure.
This patch fixes the difference in layout. The immediate cause of the
layout difference was that a cell (the second outermost) on the second
page had a height, computed in CalcUnpaginatedBSize, that was large
enough to cause it to need to continue onto the third page. This height
came (via nsTableRowFrame::GetUnpaginatedBSize) from the
UnpaginatedHeightProperty stored on the first-in-flow of its row, on the
first page, stored by CacheRowBSizesForPrinting called in
nsTableRowGroupFrame::ReflowChildren during the reflow of its row group
on the first page, in a special height reflow initiated during the
second-pass constrained-height reflow of the table (still,
second-outermost) on the first page, due to the change being fixed in
this patch.
MozReview-Commit-ID: 3E84VwdXuPs
I noticed this while debugging the assertion count failure of
layout/base/crashtests/470851-1.xhtml . It doesn't help that failure,
but it still seems like the safe thing to do.
MozReview-Commit-ID: 6xHxUJCjUHh
No functional changes intended in this patch. It merely simplifies the
additional patch that we'll need to update gecko past WR cset 0bf6655,
and saves some potential manual rebasing work.
MozReview-Commit-ID: Km8dBotP3NQ
--HG--
extra : rebase_source : 77c34ec1cbbc1c0fe4d1971feb131d30c97f0d66
No functional changes intended in this patch. It merely simplifies the
additional patch that we'll need to update gecko past WR cset 0bf6655,
and saves some potential manual rebasing work.
MozReview-Commit-ID: AgMyNapY2Og
--HG--
extra : rebase_source : d8522d8e806522a4a0e8b2cd1669db0374bd5e63
For the most part, I tried to make less *manual* table invalidations
for non-border-collapse tables and relied the table invalidations on
the comparison of the display items. By doing so, we can avoid the
over-painting issue.
MozReview-Commit-ID: 4w1DUKHXIFO
--HG--
extra : rebase_source : ac5e6de35a2b20318c70f8eed4375a5673ef6c31
nsIFrame::mClass is of type enum class nsQueryFrame::ClassID which is
a strict subset of the nsQueryFrame::FrameIID values. For a concrete
frame class, its FrameIID is the same numeric value as its ClassID.
MozReview-Commit-ID: 1N0AkCGo1ol
Gecko only draw one line for each collapsed border. In order to draw
only one line border in webrender, I create normal border webrender
command but only show top side of border for inline direction and left
side for block direction.
MozReview-Commit-ID: 7QChXuzVbg7
This patch do following things:
1. Create nsDisplayTableBorderCollapse that draws all collapse border of
table.
2. Don't use nsDisplayTableBorderBackground.
3. Let column and column group frame generate display items.
4. When traversing the table, also traverse the column and column group
frames.
5. For each type of table frame (col group, col, row group, row and
cell), draw their own background.
MozReview-Commit-ID: 1s2VLv6G8xi
This patch do following things:
1. Create nsDisplayTableBorderCollapse that draws all collapse border of
table.
2. Don't use nsDisplayTableBorderBackground.
3. Let column and column group frame generate display items.
4. When traversing the table, also traverse the column and column group
frames.
5. For each type of table frame (col group, col, row group, row and
cell), draw their own background.
MozReview-Commit-ID: 1s2VLv6G8xi
This avoids conflicts with mozilla::dom::FrameType.
MozReview-Commit-ID: 7aEMbHRaTFk
--HG--
extra : rebase_source : 2d01321f5ce0ec8c0e3f70984674f82678034b3c
This makes it so that, given a |const nsIFrame*|, a caller can retrieve
properties but not set or remove them, but with an |nsIFrame*| all
operations are allowed. I believe this is sensible since properties act
as extended member variables for things that are needed rarely, and
these are the const-ness semantics of member variables.
This also avoids the need for const_cast<nsIFrame*> to cast away const
in the following patch, which guards property access with a frame state
bit.
MozReview-Commit-ID: IJ9JnGzdH51
--HG--
extra : transplant_source : %D4%DF%04%91_q%E6%CF%B3N%82%2C%A5%CB0%3A%B6%810%ED
This makes it so that, given a |const nsIFrame*|, a caller can retrieve
properties but not set or remove them, but with an |nsIFrame*| all
operations are allowed. I believe this is sensible since properties act
as extended member variables for things that are needed rarely, and
these are the const-ness semantics of member variables.
This also avoids the need for const_cast<nsIFrame*> to cast away const
in the following patch, which guards property access with a frame state
bit.
MozReview-Commit-ID: IJ9JnGzdH51
--HG--
extra : transplant_source : %91%D6%C7%01hC%B3z%90%B6%93%93qcAK%CB%09%D6z
Per bug 1322570 comment 27, the debug code is only useful in Gecko-backed
style system. To prevent the assertion in nsStyleContext::GetParent() when
running stylo, run them only in gecko.
MozReview-Commit-ID: DOcJ3T7vS1J
--HG--
extra : rebase_source : 33fd6caaa4ada9530fe8d874b827d91ac355e0c1
nsStyleContext::CalcDifference had an optimization where, when we knew
that the old and new style context have the same rule node, we knew that
the only change hints that would need to be handled are those in the
"not handled for descendants" category, generated due to explicit
'inherit' values on reset properties. This was because any changes due
to differences in inherited properties should only have generated
"handled for descendants" change hints (and thus would already have been
handled on an ancestor).
Before bug 931668, this let us avoid calling CalcDifference on structs
that only would have generated hints that we knew we already would have
handled. However, after bug 931668, we compare all structs anyway so
that we can set the aEqualStructs outparam, so we don't gain anything
from this optimization. We can still return these change hints we know
will not need to be handled, and rely on ElementRestyler::CaptureChange
to filter them out.
MozReview-Commit-ID: Ld1s2Js0i6r
This is the only runnable that we need to label in layout/tables/ folder.
MozReview-Commit-ID: FbWztSLzIOy
--HG--
extra : rebase_source : 58102bfc2ec405669fd739cd0b066ffef9e0506c
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
To preserve the semantics, Reset() is called to clear other bits in the
status prior to set the incomplete bit. Though some of them might not be
necessary.
MozReview-Commit-ID: InNDwcpp28A
--HG--
extra : rebase_source : 833e44a5dbb447d82c67f715cd5b0b2e97a5c62d
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
NS_FRAME_TRUNCATED will be removed when NS_MergeReflowStatusInto() is
removed.
MozReview-Commit-ID: 21lit9xSAE1
--HG--
extra : rebase_source : 7933575a2f4d3c8ccff5d717fca1ddd8c7c9e482
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
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
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
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
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
Lay down the foundation for this refactor work so that nsReflowStatus could
be converted to bit-fields piece by piece, and each patch can be built (but
may not pass tests).
This change causes some build warnings, due to some debug logs printing
nsReflowStatus as an integer, but that will be fixed by Part 24 later.
All the operators related to uint32_t will be removed at the end of this
patch series by Part 23.
The yoda conditions are swapped in order to build successfully.
DisplayReflowExit() incorrectly declares aStatus as uint32_t. Change it to
const reference because nsReflowStatus is now a class.
MozReview-Commit-ID: 5DOpaP85ywJ
--HG--
extra : rebase_source : 53ca0750b5f764fcbf7ba2d00c9ec606aed704c2
For a table, the primary frame is the table wrapper anonymous box. That
anonymous box inherits style from its _child_ table frame, which is the frame that
has the actual style for the element. So we want to use the stylo-computed
style for the table frame, and then compute an updated style for the table
wrapper too, because some things (like absolute positioning) are done for the
table wrapper anonymous box, not the table frame.
Delete the "or 0 for no movement in that direction" from the CanAdjustEdges
document in nsMenuPopupFrame.h because the only caller in nsResizerFrame.cpp
never passes 0 to it.
MozReview-Commit-ID: 3A5A8O4MDn1
--HG--
extra : rebase_source : 3a961f9195d7887f8abb5c31ae9ec088f78a2626
To avoid confusion with the mozilla::css::corner, rename ::Corner to
mozilla::LogicalCorner, and move it to nsStyleCoord.h. Also, append
LogicalCorner prefix to all the enum values to match the coding style.
It also fixed the build error preemptively in a later patch that removing
::css namespace from mozilla::css::corner.
MozReview-Commit-ID: BbRYFuT3v4W
--HG--
extra : rebase_source : b8891eaa475c803de9a2137cb5e9a5a4bde37b9f
I think there are three advantages of this change:
1. removes some dependencies from layout / painting code to pre-computed
value stuff in the style system;
2. makes it easier to audit usage of specific fields in style structs
(which is probably a side effect of the first one);
3. potentially improves performance since it doesn't go through the
unnecessary general logic in ExtractComputedValue.
Also, combined with the part before, we get a unified list for visited-
dependent properties so that we can ensure the assertion here and the
style difference calc code are consistent.
MozReview-Commit-ID: 5B9aN7CfRgI
--HG--
extra : rebase_source : ac80eaea2474b9ec4b47b1cc9a5bdd2e61f6ec4d
The new name makes the sense of the condition much clearer. E.g. compare:
NS_WARN_IF_FALSE(!rv.Failed());
with:
NS_WARNING_ASSERTION(!rv.Failed());
The new name also makes it clearer that it only has effect in debug builds,
because that's standard for assertions.
--HG--
extra : rebase_source : 886e57a9e433e0cb6ed635cc075b34b7ebf81853
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
This removes the unnecessary setting of c-basic-offset from all
python-mode files.
This was automatically generated using
perl -pi -e 's/; *c-basic-offset: *[0-9]+//'
... on the affected files.
The bulk of these files are moz.build files but there a few others as
well.
MozReview-Commit-ID: 2pPf3DEiZqx
--HG--
extra : rebase_source : 0a7dcac80b924174a2c429b093791148ea6ac204