Mostly just threading the TextDrawTarget deeper into the code to use a boolean.
A lot of places are trying to optimize away invisible text!
MozReview-Commit-ID: 89sDAwUv0HA
--HG--
extra : rebase_source : 8d800702232aec6626a33f2d6be893708d0bbfee
Selections in gecko are used to hack in style changes to subsets of text frames.
Mostly this works fine because decorations don't care where they are, and
textRunFragments already exist to do style changes midFrame. However we mishandled
shadows because we were assuming they applied to the entire run, which isn't
the case when shadows are involved.
Applying shadows to everything was desirable because the way nsTextFrame is written,
it's difficult for us to associate the glyphs and decorations with a "range".
However the selections iterator provides a natural grouping, so we use that.
The result is that TextDrawTarget effectively becomes an array of what TextDrawTarget
used to be (now called SelectedTextRunFragment). Everything else is just fallout
of this change.
MozReview-Commit-ID: 5GWPruo6daW
--HG--
extra : rebase_source : 8e1c1d61e43151ee6651f8c6cfbcb0912262df56
Multi-color shadow is not allowed in spec. We could use the same color
of the text as the color of the decoration line when we paint the
shadow.
MozReview-Commit-ID: AK9NoseSE0h
--HG--
extra : rebase_source : 48a84e73a7ee76b615c255a440cbe119fa8f56f0
do_QueryFrame from one frame type to another frame type
can compare mClass first, and if successful just downcast
the pointer to the target frame type. If unsuccessful,
or for do_QueryFrame calls involving other types, we must
still call QueryFrame.
MozReview-Commit-ID: 5MVfmuOYwdE
Multi-color shadow is not allowed in spec. We could use the same color
of the text as the color of the decoration line when we paint the
shadow.
MozReview-Commit-ID: AK9NoseSE0h
--HG--
extra : rebase_source : 12b0aa45f5dbb938a35271dcadaa664ae4a82c1e
We use nsFlexContainerFrame (our modern flexbox implementation) to emulate
-webkit-box, and we use a frame state bit to tell us whether to use
modern-flexbox properties vs. legacy properties. Up until this patch, we
neglected to check that state bit when determining whether to use the modern
"flex-basis" property for sizing. This patch makes us *not* use that property
(and just use the axis-appropriate width/height property instead) for legacy
-webkit-box containers.
MozReview-Commit-ID: 14bzOCPCtUY
--HG--
extra : rebase_source : 0091761ba3aff64030a3301d9b60fb9401aa77b3
* HasAnyStateBits is slightly more foolproof and readable -- in particular, you
can put the logical "!" directly alongside the expression, rather than
needing to separate it with a layer of logical-grouping-parens.
* The deindentation here isn't super-important, but it conforms better to our
coding style, and it'll make this code consistent with a new chunk that I'm
adding in the next patch (and that chunk will *have* to be deindented like
this, to avoid going over 80 characters).
MozReview-Commit-ID: FWfqrKjHedP
--HG--
extra : rebase_source : e556f9789e9e153d57df07a38b10c21963e50978
This was never even meant to apply to the out-of-flow, just to the placeholder
itself. So it's been effectively dead since placeholders stopped inheriting
from another style context.
GetIndexFromSelectionType() in nsFrameSelection.cpp or
nsFrameSelection::GetSelection() appears in profile of attachment 8848015. So,
it should not use switch statement due to really hot path.
With the previous patch, we can make it use array to retrieve the index from
SelectionType with static_cast<int8_t>.
MozReview-Commit-ID: 8jvIF5buTyT
--HG--
extra : rebase_source : ccb9c855caa6688e45097f67de3160860339d281
nsISelectionController::SELECTION_* are declared as bit-mask. However, no
methods of nsISelectionController treat them as bit-mask and these
values need a switch statement in nsFrameSelection to convert SelectionType to
array index of nsFrameSelection::mDOMSelections because it's too big to create
an array to do it. Additionally, this conversion appears profile of
attachment 8848015.
So, now, we should declare these values as sequential integer values.
However, only nsTextFrame uses these values as bit-mask. Therefore, this patch
adds new type, SelectionTypeMask and creates new inline method,
ToSelectionTypeMask(SelectionType), to retrieve mask value for a SelectionType.
MozReview-Commit-ID: 5Za8mA6iu4
--HG--
extra : rebase_source : 86617c1f5fa23166458f4353cb834f9e7c5b131b
The failure mode in the attached crashtest is an inconsistency in the flattened
tree. Specifically, we null out mVideoControls in an nsVideoFrame, but defer
the UnbindFromTree call on that NAC element, which measn that its mParent still
points to the nsVideoFrame's mContent. Because all this stuff runs off of script
runners, and the anonymous content destroyer is not guaranteed to run before
other potential script runners, we end up running arbitrary script while the
tree mismatch exists. This script calls back into ProcessPendingRestyles, which
causes trouble.
We could build a separate deferral mechanism, but it's not clear that we actually
need to defer the unbind anymore. The deferred unbind was added in bug 489008,
which predated a lot of simplifications in layout/dom interaction.
MozReview-Commit-ID: 1JYAhiXKVJC
Another plumbing-only change, which is a precursor for the next patch.
ComputedValues are a Servo-only thing, so in order to use nsStyleSizes for both
Gecko and Servo, the ComputedValues sizes must be moved out.
MozReview-Commit-ID: BOnQSzzV0vC
--HG--
extra : rebase_source : 025c6161e509401a36525349083dd98bfda35621
This is a purely non-functional plumbing change. Instead of passing a
SizeOfState and an nsStyleSizes a bunch of places, we pass an nsWindowSizes,
which contains both of them.
This is a necessary precursor for the next patch.
MozReview-Commit-ID: Ek03wDM50rB
--HG--
extra : rebase_source : 7b05708bd21dc4e3812ea041647fa74bb413d0b9
We should not be declaring forward declarations for nsString classes directly,
instead we should use nsStringFwd.h. This will make changing the underlying
types easier.
--HG--
extra : rebase_source : b2c7554e8632f078167ff2f609392e63a136c299
For the Obama wikipedia page, this covers about 85% of the unmeasured
ComputedValues structs. The about:memory output looks like this:
> +---2,443,648 B (02.41%) -- computed-values
> | +--1,088,272 B (01.07%) -- dom
> | +----945,744 B (00.93%) -- non-dom
> | +----409,632 B (00.40%) -- visited
I'm not sure why some CVs are still being missed.
MozReview-Commit-ID: 1bYWwSi4ihn
--HG--
extra : rebase_source : 14e4bd36a54bbbd8fd265f559704bec5a5e3b154