This fixes an inconsistency in part 2 (32faa7c639ff), which wrote the
constant for uninitialized in two different ways.
The constructor uses nscoord_MIN for uninitialized, and that's also what
GetFloatEdges tests for, so this should use nscoord_MIN as well.
I believe this is because the review comment in comment 29 was only
partially addressed.
I noticed the difference because it caused broken behavior in a tree
with my patch for bug 1227493, which defines NS_INTRINSIC_WIDTH_UNKNOWN
differently. Some text was disappearing on github (email and website
on user pages), slack (usernames of private chats in the sidebar), and
twitter (username of user who tweeted a quoted tweet).
MozReview-Commit-ID: Ah9FUPf2dw4
--HG--
extra : rebase_source : 2d947e017647bc6d6029169ef57cddca5aa4f3a9
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
With this change, we could export BreakTypeToString() to other files that desire
to print break type for debugging.
MozReview-Commit-ID: 34m1BWAmZTB
--HG--
extra : rebase_source : 2d613e7caffb36ec23b684dab538a9f5d6e34f65
This should've been covered in Bug 956447. The declaration is already behind
DEBUG_FRAME_DUMP in nsLineBox.h. Just move the implementation to agreee with that.
MozReview-Commit-ID: 9N0WxKkajF1
--HG--
extra : rebase_source : b79b068b8a84c66f289d40deb5b5b9347fb7c4a4
NS_STYLE_CLEAR_NONE has been defined to 0 for like forever, so this code should
never be run. Remove it.
MozReview-Commit-ID: IQ73H6QGsPX
--HG--
extra : rebase_source : 4a32e0e7cd4325b0741f542a796fd1da4de10075
Structs in our style system use an arena-style allocation system,
managed by the presshell to which they belong. All of the relevant
overloads that forward allocation requests to the presshell declare
themselves as CPP_THROW_NEW, which indicates that they do not throw
exceptions. The C++ specification states that operator new overloads
that declare themselves to not throw exceptions require a null check on
their return value. However, the relevant presshell allocation method,
AllocateByObjectID, is infallible and will never return a null pointer.
The callers of all of these methods are therefore doing useless
(compiler-generated) null checks. Let's get rid of those useless checks
by removing the CPP_THROW_NEW annotations. This change declares these
methods will return non-null pointers and throw exceptions in case of
errors--but as we don't use exceptions, and AllocateByObjectID will
abort on OOM, everything works out OK.
Structs in our style system use an arena-style allocation system,
managed by the presshell to which they belong. All of the relevant
overloads that forward allocation requests to the presshell declare
themselves as CPP_THROW_NEW, which indicates that they do not throw
exceptions. The C++ specification states that operator new overloads
that declare themselves to not throw exceptions require a null check on
their return value. However, the relevant presshell allocation method,
AllocateByObjectID, is infallible and will never return a null pointer.
The callers of all of these methods are therefore doing useless
(compiler-generated) null checks. Let's get rid of those useless checks
by removing the CPP_THROW_NEW annotations. This change declares these
methods will return non-null pointers and throw exceptions in case of
errors--but as we don't use exceptions, and AllocateByObjectID will
abort on OOM, everything works out OK.
AllocateByObjectID() is infallible. Therefore the |operator new| of nsFrameList,
nsLineBox and nsRuleNode are too, as is nsRuleNode::CreateRootNode().
The patch also removes a couple of comments duplicated in both .h and .cpp
files.
--HG--
extra : rebase_source : 0b9e195fd547fdd53ddad7bb461ff5f5c2016fce
Rename NS_STYLE_CLEAR_LEFT_AND_RIGHT to NS_STYLE_CLEAR_BOTH. Also fix whitespace and remove unnecessary parens in a few places and enumerate the possible break types in an assertion so that it doesn't make assumptions on the actual property values.
Specifically:
* move all the frame dump methods to nsIFrame. Especially nsFrame::ListTag
was annoying, often requiring a cast to nsFrame*.
* print common values in the same order for all types of frames
* print fluid continuations as "next-in-flow=%p" and non-fluid as
"next-continuation=%p" (as before)
* print the style-context more compactly, e.g.
"[sc=0x7faa6b60e0a0] pst=:first-line" becomes
"[sc=0x7faa6b60e0a0:first-line]"
* suppress printing visual/scroll-overflow rects when they are identical
to mRect and do the same for nsLineBox::List where it was especially
hard to see which lines actually had real overflow
* fix a bug that printed the child list name at the far right when the
principal list was empty (making it hard to see)
* print the address of child lists (other than the principal list) to
help debug frame list property bugs
* s/NS_IMETHODIMP/void/