PresShell::PageMove() climbs up to parent document when there is no scrollable
parent in current document. However, if aExtend is true, it should expand
Selection in the document itself. Therefore, it needs different rules to
look for container of expanding Selection from scrollable element to scroll.
Additionally, old rules (i.e., before the fix of bug 1369072 which caused
this regression) were also buggy. It used parent scrollable element or
root scrollable element simply. Therefore, if found scrollable element is
ancestor of selection limiter, it didn't work as expected.
This patch creates nsFrameSelection::GetFrameToPageSelect() to retrieve
per-page selection container element with the following rules:
- look for a scrollable element in selection limiter.
- if there is no scrollable element, use selection limiter.
- if there is no selection limiter, use the root frame.
So, nsFrameSelection::CommonPageMove() should take nsIFrame rather than
nsIScrollableFrame since container of per-page selection may be used in
non-scrollable contenteditable element. If it's called with non-scrollable
frame, it needs to compute the expanding range with the frame size.
Differential Revision: https://phabricator.services.mozilla.com/D8954
--HG--
extra : moz-landing-system : lando
In order to get the correct computed value of these keywords, we have to
make sure we store the correct computed values in sizing properties in
both inline axis and block axis.
-moz-max-content and -moz-min-content should behave as the property's
initial value in block axis. -moz-fit-content and -moz-available are not
supported in block axis, so we also treat them as initial values.
Differential Revision: https://phabricator.services.mozilla.com/D8290
--HG--
extra : moz-landing-system : lando
nsRefreshDriver::ObserverArray is a nsTObserverArray which is
infallible, so no need to check the return value from AppendElement
(which a later patch in this series will remove).
This field appears to be only ever used as a local variable, and can be removed.
Differential Revision: https://phabricator.services.mozilla.com/D7126
--HG--
extra : rebase_source : 310057f703f4734ba9aef807100c5b5ff888da41
extra : histedit_source : 735d3f09bdb56d6eb386e2b5faffea1d769d97a1
It's not really invalidated anywhere, and the float manager code only checks for
float region changes. Extend it so that it knows about shapes as well, and avoid
reframing due to a bogus nsChangeHint_ScrollbarChange which really meant to be
UpdateOverflow, which really is useless in this situation..
Differential Revision: https://phabricator.services.mozilla.com/D7583
The CSSWG has recently resolved that layout containment
suppress baseline alignment, while size containment does not:
https://github.com/w3c/csswg-drafts/issues/2995
Spec text (https://drafts.csswg.org/css-contain/#containment-layout):
"7. For the purpose of the vertical-align property,
or any other property whose effects need to relate
the position of the containing element's baseline
to something other than its descendants,
the containing element is treated as having no baseline."
And a note in (https://drafts.csswg.org/css-contain/#containment-size):
"Note: size containment does not suppress baseline alignment.
See layout containment for that."
This patch does this change just switching IsContainSize()
by IsLayoutSize() in several places related to baseline alignment
in the source code.
With the patch several WPT tests start to pass. Apart from that,
some of the tests under vendor-imports are updated to follow
the new behavior.
--HG--
extra : amend_source : 05dc9a320afeb1d58981e2bd8bc47b435999f2f9
Before this patch, TextOverflow had an explicitly-*defaulted* default
constructor. But in fact, this constructor was *implicitly* deleted because one
of the member variables (of type LogicalRect) couldn't be default-constructed
due to having its own default constructor explicitly deleted.
clang trunk highlights this inconsistency with a build warning
(-Wdefaulted-function-deleted) which this patch addresses.
Differential Revision: https://phabricator.services.mozilla.com/D8028
--HG--
extra : moz-landing-system : lando
If we're waiting on an interrupt, then our child items haven't been totally
reflowed and our measures would be bogus.
This will probably regress performance in the cases bug 1209697 fixed, so we
should probably add an interrupt check somewhere in nsFlexContainerFrame to
avoid keeping reflowing flex containers indefinitely.
We could probably just bail out from our reflow if any kid reflow was
interrupted.
Filed bug 1495532 to consider that.
Differential Revision: https://phabricator.services.mozilla.com/D7288
--HG--
extra : moz-landing-system : lando
Once again, calculating the amount of font size inflation isn't as expensive as
it used to be, but there's still no need to do it unnecessarily. The current
code does this unconditionally as part of computing a frame's margins
Additionally, calculating the font size inflation for frames that we don't
actually want to inflate also messes with the planned writing mode assertions
from bug 1428670. In some special cases (e.g. the scroll bars), a frame might
use a different writing mode (horizontal/vertical) than its parent without
creating a new font inflation flow root at the boundary. As long as we never
want to apply font size inflation for that frame this is okay, but if the margin
computation then runs the font inflation calculation regardless, we have a
problem.
Differential Revision: https://phabricator.services.mozilla.com/D7329
--HG--
extra : moz-landing-system : lando
When one of the two factors governing the effective container width for font
inflation changes, we need to mark all affected frames as dirty.
While the visible area commonly changes because of viewport changes and we can
catch those through the check for ISize resizes of the top-level frame
("!mFrame->GetParent() && isIResize"), it still seems nicer to move calculation
of the effective container width into the FontInflationData itself, especially
since the effective container width calculation in nsLayoutUtils is the only
consumer of the NCAISize currently stored by the FontInflationData.
That way
- we can be sure that really all changes of the visible width will correctly
mark all affected frames as dirty
- can avoid repeatedly recalculating the effective container width
- can also detect the cases where the effective container width actually remains
the same after a change in one of its input factors and skip forcing a full
dirty reflow for all descendants just because of font inflation.
While the code in nsLayoutUtils was technically always using the writing
mode (horizontal/vertical) of each individual frame for determining which
dimension of the visible size should be used for clamping, just using the
writing mode of the respective flow root should be enough, since each change in
the writing mode should create a new flow root.
This assumption should already hold today because
1. as per the Writing Modes CSS spec, a change in writing mode compared to its
parent means that the affected block cannot be purely "inline", but at most
"inline-block".
2. Generally, any non-inline frame will be marked as a font inflation container.
3. Any block frame whose writing direction doesn't match its parent will be a
block formatting context, which implies NS_BLOCK_FLOAT_MGR.
4. Any block frame that has both NS_BLOCK_FLOAT_MGR set and is a font inflation
container will also become a font inflation flow root.
but because this chain of reasoning is not the most direct, we also add a
corresponding assertion to better catch any potential bugs here.
Differential Revision: https://phabricator.services.mozilla.com/D5578
--HG--
extra : moz-landing-system : lando
Before bug 1308876, child frames marked themselves as dirty during reflow if
their parent was dirty, too. After bug 1308876, the point where dirtiness is
being propagated to a frame's descendants has been shifted: Now, dirty parents
are responsible for marking all their children as dirty, too, when the parent
starts reflowing.
This means that if a frame wants to mark a whole subtree as dirty *during its
own* reflow, it's no longer sufficient to just mark the root of the subtree as
dirty and then rely on all further children marking themselves as dirty as well
when reflow reaches them.
The font inflation code is one such case. When the font inflation data on a font
inflation flow root has become dirty, or we're resizing the top-level frame
(which because of the effective container width clamping from bug 707855 can
affect the font inflation font size as well), we now need to explicitly mark all
affected children as dirty.
Differential Revision: https://phabricator.services.mozilla.com/D5577
--HG--
extra : moz-landing-system : lando
In bug 1488300 xidorn make us kick off loading of masks/filters/clipPaths in
resource documents when the style context is set so that the 'load' event
will be blocked until they load. I missed that in 5177bb8cb2ce (bug 1494355)
where we stopped creating the SVGFilterObserverList in
SVGObserverUtils::GetEffectProperties since I missed that creating that object
looks up the target element (without observing it), which triggers loading of
external resources as necessary.
Differential Revision: https://phabricator.services.mozilla.com/D7188
--HG--
extra : rebase_source : 698fe4b437660761e457ecf54d8d604a098229db
extra : amend_source : 3ae9f25761372ee6a33bd4043c7bf6183361ca58
This patch make nsCSSFrameConstructor::CreateGeneratedContentItem() early
returns if the originating element contains an UA Widget shadow root.
Differential Revision: https://phabricator.services.mozilla.com/D6828
--HG--
extra : moz-landing-system : lando
nsCSSFrameConstructor::FindDisplayData() guarantees a block with "display:
list-item" will be constructed by ConstructBlock() (either through
ConstructScrollableBlock() or ConstructNonScrollableBlock()).
This is also a preparation to fix bug 1491915 since we want to control
bullet frame creation under column hierarchy.
Depends on D6840
Differential Revision: https://phabricator.services.mozilla.com/D6841
--HG--
extra : moz-landing-system : lando
Those arguments were added in bug 591737 to create a triangle for the
summary frame, but <summary> has been re-implemented by using "list-item"
since then. Now the only caller is nsBlockFrame itself, so there's no need
to expose those arguments.
Differential Revision: https://phabricator.services.mozilla.com/D6839
--HG--
extra : moz-landing-system : lando
It's queried during layer building, for the RCD-RSF only. If we set it for
a subframe RSF, that overwrites the value for the RCD-RSF, and we end up
querying the incorrect value.
Differential Revision: https://phabricator.services.mozilla.com/D6536
--HG--
extra : moz-landing-system : lando
This patch isn't expected to change behavior; it's just some simplification.
Depends on D6976
Differential Revision: https://phabricator.services.mozilla.com/D6978
--HG--
extra : moz-landing-system : lando
This patch isn't expected to change behavior; it's just some simplification.
Differential Revision: https://phabricator.services.mozilla.com/D6976
--HG--
extra : moz-landing-system : lando
A flex item's available inline size would be relevant (i.e. would have an
impact on layout) if we were fragmenting the flex item in its inline direction
(e.g. if it were an inline-level box, in an inline-layout context).
But we're not doing that, so its available isize doesn't make a difference. To
the extent that it's been useful at all in this flex-item-caching code up to
this point, we'll now be caching something more-specific (the item's *computed*
inline size) which should serve roughly the same purpose.
Depends on D6991
Differential Revision: https://phabricator.services.mozilla.com/D6992
--HG--
extra : moz-landing-system : lando
We're traversing primary frames, which are first continuations, so we can't
start from a continuation and expect to get to it. Add an assertion that would
catch further fishyness.
Differential Revision: https://phabricator.services.mozilla.com/D6672
--HG--
extra : moz-landing-system : lando
Various places in dom/ use the pattern:
already_AddRefed<NodeInfo> ni = ...;
which is supposed to be disallowed by our static analysis code, but
isn't, for whatever reason. To fix our static analysis code, we need to
eliminate instances of the above pattern.
Unfortunately, eliminating this pattern requires restructuring how Nodes
are created. Most Node subclasses take `already_AddRefed<NodeInfo>&` in
their constructors, and a few accept `already_AddRefed<NodeInfo>&&`. We
need to enforce the latter pattern consistently, which requires changing
dozens of source files.
In the button case we have a ::-moz-button-content pseudo-element, but this is
also an issue for tables and such.
These are supposed to be implementation details, so avoid looking at them for
preserve-3d.
I don't know how I didn't think of this on the regressing bug.
Differential Revision: https://phabricator.services.mozilla.com/D6131
In the button case we have a ::-moz-button-content pseudo-element, but this is
also an issue for tables and such.
These are supposed to be implementation details, so avoid looking at them for
preserve-3d.
I don't know how I didn't think of this on the regressing bug.
Differential Revision: https://phabricator.services.mozilla.com/D6131
In the button case we have a ::-moz-button-content pseudo-element, but this is
also an issue for tables and such.
These are supposed to be implementation details, so avoid looking at them for
preserve-3d.
I don't know how I didn't think of this on the regressing bug.
Differential Revision: https://phabricator.services.mozilla.com/D6131
--HG--
extra : moz-landing-system : lando
Remove Unused aParentContext Parameter in ServoStyleSet::ResolveStyleFor Function
Differential Revision: https://phabricator.services.mozilla.com/D5979
--HG--
extra : moz-landing-system : lando
Right now, when a flex item's intrinsic size is invalidated, we clear cached
flex measurements on all of its sibling flex items (indirectly, by virtue of
invalidating the flex container's intrinsic sizes, which does the dirty work of
clearing the measurements).
This is excessive. We do need to clear the measurements on any flex item
whose intrinsic sizes are invalidated, but we don't need to clear them on other
flex items whose intrinsic sizes are still valid. So: this patch changes our
implementation accordingly.
This patch isn't expected to change behavior - it should just be an
optimization.
Differential Revision: https://phabricator.services.mozilla.com/D5917
--HG--
extra : moz-landing-system : lando
When generating display lists for WebRender, we were not caching the
draw result via nsDisplayItemGenericImageGeometry::UpdateDrawResult (or
similar) after completing CreateWebRenderCommands. This is important
because reftests use this to force sync decoding for images; it may be a
reason for image-related intermittent failures on *-qr builds.
Additionally, we may have been requesting fallback in cases where fallback
could not do anything more than WebRender could. For example, if we can't
get an image container yet, there is no point in requesting fallback
because it might just be we haven't started decoding yet. We should just
return the actual draw result in such cases.
When the current image for an nsImageFrame/nsDisplayImage is not yet
ready, we display the previous image, if any available, to avoid
flickering while we wait for decoding to finish. On the WebRender path,
this functionality was lost since we did not have the draw result
information with image containers. With the API updated in part 1, we
can now do this to avoid flickering.
In addition to the image container, the draw result can also be useful
for callers to know whether or not the surface(s) in the container are
fully decoded or not. This is used in subsequent parts to avoid
flickering in some cases.
For browser.xhtml, we have extra whitespace text nodes that appear inside of
mBoundElement, which was causing XBL content to be incorrectly dropped.
Differential Revision: https://phabricator.services.mozilla.com/D5546
--HG--
extra : moz-landing-system : lando
Verified locally by s/UNIFIED_SOURCES/SOURCES/ in layout/generic/moz.build.
Differential Revision: https://phabricator.services.mozilla.com/D5636
--HG--
extra : moz-landing-system : lando
Since bug 775624, nsReflowStatus has become a class, not an integer. We need
to expose operator<<() for nsReflowStatus to non-debug build to dump
nsReflowStatus's content in MOZ_LOG.
Differential Revision: https://phabricator.services.mozilla.com/D5635
--HG--
extra : moz-landing-system : lando
This does Bug 1464967 Part 2 in a different way by using mozilla::ToString()
to dump nsReflowStatus.
Differential Revision: https://phabricator.services.mozilla.com/D5634
--HG--
extra : moz-landing-system : lando
There are a few mentions of nsRuleNode left but they are mostly
historical references so it makes sense to keep them.
Differential Revision: https://phabricator.services.mozilla.com/D5505
- We need nsIContentInlines.h to provide the (inline) nsIContent::GetShadowRoot definition.
- We need ShadowRoot.h to allow dereferencing of the pointer that GetShadowRoot() returns.
Differential Revision: https://phabricator.services.mozilla.com/D5564
--HG--
extra : moz-landing-system : lando
To avoid its deferred reflow potentially killing continuations that are parented
to the parent of the letter frame.
This rolls back to the behavior previous to bug 488725 just for this case, until
we fix it properly in bug 1490281. This also fixes bug 1489863.
Differential Revision: https://phabricator.services.mozilla.com/D5521
Bug 895096 comment 0 recommends using the name `d2a` instead of `p2t`.
Depends on D5368
Differential Revision: https://phabricator.services.mozilla.com/D5369
--HG--
extra : moz-landing-system : lando
When contain:size is set for a grid container, ignore sizes from children when
computing own size during layout.
Differential Revision: https://phabricator.services.mozilla.com/D4429
--HG--
rename : layout/reftests/w3c-css/submitted/contain/contain-size-flex-001-ref.html => layout/reftests/w3c-css/submitted/contain/contain-size-grid-001-ref.html
rename : layout/reftests/w3c-css/submitted/contain/contain-size-flex-001.html => layout/reftests/w3c-css/submitted/contain/contain-size-grid-001.html
extra : moz-landing-system : lando
I'd claim that we don't need it because, in order to enqueue the event, we
already need to have overflowed the event in a normal reflow.
For now this should not break anything (or anything that wasn't already racy
depending on when we paint).
The only reason the flush is there is according to roc is to decide whether to
fire the event, and because it needs the layout information:
https://bugzilla.mozilla.org/show_bug.cgi?id=771822#c4
In practice, however, all the layout information we need we have already
computed by the time we post the event.
We don't expose the rects via the event details, which is what could get
out-of-date, so this patch could only mean that we fire the event slightly more
often in cases where people remove stuff from the DOM, right after we do layout
and the content has overflowed. But that's actually pretty unlikely.
This event in general is pretty problematic because it exposes when we do
layout and when we paint, which is not great. Its test coverage is also pretty
low (test_overflow_event.html, which of course still passes without this).
I still want to do this change first since it's trivial to back out if needed.
Then I'd want to change how it fires to match the scrolled area change event
(which would allow us to remove the WillPaintObserver stuff), after verifying
that chrome consumers are still fine with that, and then put behind a pref and
hide it from content, while we leave time for chrome consumers to migrate away
from it, and allow us to revert if something breaks.
Differential Revision: https://phabricator.services.mozilla.com/D5082
ColumnSetWrapperFrame is needed to implement column-span. Patches in bug
1421105 will utilize this frame.
Co-authored-by: Neerja Pancholi <npancholi@mozilla.com>
Differential Revision: https://phabricator.services.mozilla.com/D5092
--HG--
extra : moz-landing-system : lando
All classes deriving from nsIFrame that did not have any subclasses themselves
(at the time of writing this patch) have been marked with `final`.
Some other Layout classes have also been made final, but this was opportunistic
while working on nsIFrame subclasses, and is definitely not exhaustive, further
patches welcome; refer to bug 1332680.
Advantages of marking a class final include:
- Allowing the compiler to devirtualize some method calls (i.e., calling
virtual functions directly instead of going through the vtable),
- Indicating that the class is not currently subclassed,
- Preventing subclassing without being aware that this would remove the
finalization benefits of the parent class.
`final` does not signify that these classes should *never* be subclassed, this
is left for developers to decide.
Differential Revision: https://phabricator.services.mozilla.com/D5020
--HG--
extra : moz-landing-system : lando
I'd claim that we don't need it because, in order to enqueue the event, we
already need to have overflowed the event in a normal reflow.
For now this should not break anything (or anything that wasn't already racy
depending on when we paint).
The only reason the flush is there is according to roc is to decide whether to
fire the event, and because it needs the layout information:
https://bugzilla.mozilla.org/show_bug.cgi?id=771822#c4
In practice, however, all the layout information we need we have already
computed by the time we post the event.
We don't expose the rects via the event details, which is what could get
out-of-date, so this patch could only mean that we fire the event slightly more
often in cases where people remove stuff from the DOM, right after we do layout
and the content has overflowed. But that's actually pretty unlikely.
This event in general is pretty problematic because it exposes when we do
layout and when we paint, which is not great. Its test coverage is also pretty
low (test_overflow_event.html, which of course still passes without this).
I still want to do this change first since it's trivial to back out if needed.
Then I'd want to change how it fires to match the scrolled area change event
(which would allow us to remove the WillPaintObserver stuff), after verifying
that chrome consumers are still fine with that, and then put behind a pref and
hide it from content, while we leave time for chrome consumers to migrate away
from it, and allow us to revert if something breaks.
Differential Revision: https://phabricator.services.mozilla.com/D5082
--HG--
extra : moz-landing-system : lando
Some methods were not overrides and were never overridden, so they could simply
be non-virtual.
Others were overrides but were not overridden, so they could benefit from being
final to hopefully lead to devirtualized calls.
Though some of these are not strictly necessary because they are inside 'final'
classes, I think they're worth adding anyway, because:
- The 'final' keyword becomes more obvious when looking at methods without the
wider context in sight (e.g., in reviews or searchfox).
- If one day any of these classes becomes non-final, it would keep the final
attribute on these methods by default, and force the programmer to explicitly
reflect before removing 'final' from the methods that need to be overridden.
Depends on D5020
Differential Revision: https://phabricator.services.mozilla.com/D5021
--HG--
extra : moz-landing-system : lando
SelectionChangeListener is too generic name but it just dispatches
selectionchange event when it's necessary. So, it should be renamed to
SelectionChangeEventDispatcher. Additionally, it's in mozilla::dom namespace
but it does not represent any DOM object. So, it should be in mozilla namespace
instead.
Differential Revision: https://phabricator.services.mozilla.com/D4913
--HG--
rename : dom/base/SelectionChangeListener.cpp => dom/base/SelectionChangeEventDispatcher.cpp
rename : dom/base/SelectionChangeListener.h => dom/base/SelectionChangeEventDispatcher.h
extra : moz-landing-system : lando
nsDateTimeControlFrame should be a leaf like all the other <input> frames
like nsTextControlFrame, nsCheckboxRadioFrame, etc.
Differential Revision: https://phabricator.services.mozilla.com/D4985
--HG--
extra : moz-landing-system : lando
SelectionChangeListener is an nsISelectionListener class. This is added only
to Selection for "normal" and added by nsFrameSelection::Init() after
AccessibleCaretEventHub. So, we can make Selection directly treat
SelectionChangeListener.
Differential Revision: https://phabricator.services.mozilla.com/D4757
--HG--
extra : moz-landing-system : lando
AccessibleCaretEventHub is an nsISelectionListener of Selection whose type is
"normal". This is added only when nsFrameSelection::Init() is called and
accessible caret is enabled. Additionally, nsFrameSelection::Init() is
always called immediately after creating nsFrameSelection.
Therefore, when AccessibleCaretEventHub is installed to Selection, this is
always second selection listener and won't be installed multiple times. So,
Selection can store pointer of AccessibleCaretEventHub directly only when
it's enabled and the Selection needs to notify it of selection change.
This patch makes Selection stores AccessibleCaretEventHub with RefPtr, then,
makes Selection::NotifySelectionListeners() call its OnSelectionChange()
immediately after AutoCopyListener.
Unfortunately, this patch includes making of MOZ_CAN_RUN_SCRIPT_BOUNDARY and
MOZ_CAN_RUN_SCRIPT a lot since some methods of AccessibleCaretEventHub are
marked as MOZ_CAN_RUN_SCRIPT and including AccessibleCaretEventHub.h into
Selection.h causes compile the compile errors.
Differential Revision: https://phabricator.services.mozilla.com/D4733
--HG--
extra : moz-landing-system : lando
Use the ImageRendering needed for Bug 1488555 to provide the correct ImageRendering argument for the PushImage call at the end of CreateWebRenderCommandsForImage instead of always using Auto filtering.
Introduce an ImageRendering argument for CreateImageKey which is then used at the CreateAsyncImageWebRenderCommands call to provide the proper filtering instead of using always Auto filtering. Update all calls to CreateImageKey to use the new interface.
This reuses the same code path that was added in bug 1461299 for NAC, but for
generated content as well. DestroyAnonymousContent notifies to the ESM.
Also, remove the NativeAnonymousContentRemoved bit about <svg:use> since it's no
longer NAC.
Differential Revision: https://phabricator.services.mozilla.com/D5575
When the frame updates for an animated image, it will trigger
nsImageBoxFrame::OnFrameUpdate to be called. We did not change this for
WebRender, and thus it was missing similar checks added to
nsImageFrame::InvalidateSelf as originally added in bug 1382985. This
caused us to ignore the frame update, and thus the animation never
appeared to progress.
nsAutoCopyListener is a singleton class but refcountable and a selection
listener. nsFrameSelection adds it to only normal Selection when it's on
macOS or it's enabled by the pref. Additionally, it's always first selection
listener since it's added immediately after Selection instance is created.
So, we can make it a static class, and normal Selection instance should have
a bool to decide whether it should notify nsAutoCopyListener of its changes.
Then, we can save the cost of grabbing it with local RefPtr and the virtual
call.
Additionally, this patch renames nsAutoCopyListener to mozilla::AutoCopyListener
and optimizes constructor of nsFrameSelection (using bool var cache to retrieve
the pref, avoid retrieving the pref on macOS).
Differential Revision: https://phabricator.services.mozilla.com/D4504
--HG--
rename : layout/generic/nsAutoCopyListener.h => layout/generic/AutoCopyListener.h
extra : moz-landing-system : lando
We'll re-do the line anyway, and we'll forget about all the already-positioned
floats in the line DoReflowInlineFrames anyway.
Differential Revision: https://phabricator.services.mozilla.com/D4457
--HG--
extra : moz-landing-system : lando
This flag and function name are used for both basic shapes and path function,
so rename it. For now, we treat path() and other basic-shapes as the
different object (i.e. StyleSVGPath and StyleBasicShape), so I rename
these functions and mask flag.
Differential Revision: https://phabricator.services.mozilla.com/D3636
Bug 1478178 regressed this case because bullet frame is the last frame
added to line layout, rather than the first, so when we try to apply
justification, we end up giving it the accumulated offset of the whole
line.
Bullet frame has to be added after other frames in the line have been
placed, because its presence may depend on whether the line is empty.
However, bullet frame is logically the first frame in a line and
appending it to the end is somewhat counter-intuitive.
Thus, this patch tries to fix the issue via prepending bullet frame in
line layout, so that the order of frames there can be more reliable.
Differential Revision: https://phabricator.services.mozilla.com/D3760
--HG--
extra : moz-landing-system : lando
If we do not pass the high quality scaling flag than the resulting surface will be marked as cannot substitute, which is not accurate, so we don't want.
The only place that actually tries to be smart about the size is nsImageFrame::MaybeDecodeForPredictedSize. All other cases just ask for the intrinsic size.
The two most likely cases are that there are no decoded copies of the image, or there is one decoded (or in progress) copy of the image.
In the first case we will request decode at the instrinsic size, and then if we draw at a different size that draw will request the proper size. This doesn't change with this patch.
In the second case there is a decoded copy already available, this is likely from a draw call on the image, and that is the surface size that we want. So we save a decode. If we are actually drawing the image at two different sizes the second size will be slightly delayed, but we have the wrongly sized copy of the image that we can draw until then. This seems like a good tradeoff to avoid always decoding an instrinic size copy of images.
Summary:
Once the nsDisplayList difficulties are sorted out, this
becomes rather trivial.
Depends on D5293
Reviewers: mattwoodrow
Reviewed By: mattwoodrow
Bug #: 1489588
Differential Revision: https://phabricator.services.mozilla.com/D5294
--HG--
extra : histedit_source : 9eae7ebf1455acae8a9ffaff90ce8f92e1e62566
Scrollable elements already trap all of their contents, nothing should spill
out, so there is no need for special handling of the `contain` CSS property.
Differential Revision: https://phabricator.services.mozilla.com/D3854
--HG--
extra : moz-landing-system : lando
Define OffsetPath & SVGPathData on the servo-side, and StyleMotion &
StyleSVGPath on the gecko-side. We parse the SVG Path string into a
vector of PathCommand. To build the gfx::Path, we will convert it into
gfx::Path later in a different patch.
The basic flow is:
- Parse SVG Path String into SVGPathData (in Rust).
- Use cbindgen to make sure the layout of PathCommand and StylePathCommand, and then set the Box[PathCommand] into nsTArray<StylePathCommand>.
- Try to convert nsTArray<StylePathCommand> into gfx::Path. (This part will be implemented in a different patch.)
Finally, we use the gfx::Path to create a motion path transform.
The layout implementation is in the later patch.
Depends on D2962
Differential Revision: https://phabricator.services.mozilla.com/D2963
--HG--
extra : moz-landing-system : lando
Define OffsetPath & SVGPathData on the servo-side, and StyleMotion &
StyleSVGPath on the gecko-side. We parse the SVG Path string into a
vector of PathCommand. To build the gfx::Path, we will convert it into
gfx::Path later in a different patch.
The basic flow is:
* Parse SVG Path String into SVGPathData (in Rust).
* Use cbindgen to make sure the layout of PathCommand and StylePathCommand,
and then set the Box[PathCommand] into nsTArray<StylePathCommand>.
* Try to convert nsTArray<StylePathCommand> into gfx::Path. (This part
will be implemented in a different patch.)
Finally, we use the gfx::Path to create a motion path transform.
The layout implementation is in the later patch.
Differential Revision: https://phabricator.services.mozilla.com/D2963
Since fixed position elements are now scrollable, we need to ensure that
they're drawn into the viewport that they're attached to.
MozReview-Commit-ID: ADQXkLjwIzR
--HG--
extra : rebase_source : 2a2ec4983e2ec7f69a3c18389661e00e47ac5277
Use it to implement FindFirstBlock() and FindFirstNonBlock(). This is a
demonstration on how Find() is used. The usage of them will be overhauled in
Part 2 and 3.
Differential Revision: https://phabricator.services.mozilla.com/D3642
This crash happens because nsVideoFrame didn't know what to do with two
children in the UA Widget Shadow Root.
The two children are both videocontrols, with the first one being the lingering
DOM inserted by first constructor call that throws.
The subsequent appendChild of the same element caused the videocontrols
to be initialized again, since the previous run didn't return a widget
instance to UAWidgetsChild.
The fix here removes the throw statement added in
https://hg.mozilla.org/mozilla-central/rev/dca187f7c72c#l3.15 ,
allowing the constructor to complete.
Without this statement, we will rely on assertion in the test here
https://hg.mozilla.org/mozilla-central/rev/4ddca5eb06c2#l2.18
to fail on slower platforms to ensure the stylesheet is loaded synchronously.
An alternative fix would be to wrap up the contructor in a try catch block
from UAWidgetsChild and make sure the DOM is cleaned up when the constructor
throw. That however will hide the error thrown so I decided to remove the throw
statement instead.
Differential Revision: https://phabricator.services.mozilla.com/D3560
--HG--
extra : moz-landing-system : lando
Overflow properties have two semantics nowadays:
1. controlling whether the scrollbar should be shown;
2. controlling whether the content is scrollable.
However, with the scrollbar-width property being added, scrollability
and presence of scrollbar no longer binds together.
This change attempts to draw a boundary between value of overflow and
presence of scrollbar by making it clear that for ScrollReflowInput, we
only care about whether scrollbar should be shown. This should make it
easier to reason about further changes involving presence of scrollbar.
MozReview-Commit-ID: 2E964z0SkW4
--HG--
extra : rebase_source : e59eb078127a71de5bc9b0537d4fe8d540965ba2
Gecko supports resizers of <img> elements and <table>, <td>, <th> elements and
has UI to remove existing table row or column in default. However, the other
browsers don't have such UI and web apps need to disable this feature with
calling both:
document.execCommand("enableObjectResizing", false, false);
document.execCommand("enableInlineTableEditing", false, false);
for avoiding conflicting with their own features to edit such elements.
Therefore, it doesn't make sense to keep enabling them in default only on
Gecko. If web apps want to keep using these features, they should call:
document.execCommand("enableObjectResizing", false, true);
document.execCommand("enableInlineTableEditing", false, true);
at initializing the editor.
And also this patch fixes bugs of
document.queryCommandState("enableObjectResizing") and
document.queryCommandState("enableInlineTableEditing"). They always return
false even after calling document.execCommand(..., false, true) since
nsSetDocumentStateCommand::GetCommandStateParams() sets bool value as
STATE_ATTRIBUTE. However, nsHTMLDocument::QueryCommandValue() which is the
caller referring STATE_ATTRIBUTE doesn't treat it as bool value. And also
those commands are related to state of document. Therefore, they should be
return as bool value of STATE_ALL instead. Then,
nsHTMLDocument::QueryCommandState() returns the state as expected. Note that
those commands are supported only by Gecko. So, we don't need to worry about
the compatibility.
Finally, this patch rewrites 2 existing tests to check basic behavior of
resizers and appearance of resizers.
Note that this patch does not add new tests to test inline table editor
since it's difficult to test the behavior with current API. Perhaps, we
should add an API to nsIHTMLEditor to retrieve each anonymous elements in
another bug since it requires to add wrapping API of SpecialPowers.
MozReview-Commit-ID: 1FhYo5vcV60
--HG--
rename : editor/libeditor/tests/test_objectResizing.html => editor/libeditor/tests/test_resizers_appearance.html
rename : editor/libeditor/tests/test_bug640321.html => editor/libeditor/tests/test_resizers_resizing_elements.html
extra : rebase_source : a707de5a64ef1f8ce974cdf1be093d1b4f61c7bc
Correctness improvements:
* UTF errors are handled safely per spec instead of dangerously truncating
strings.
* There are fewer converter implementations.
Performance improvements:
* The old code did exact buffer length math, which meant doing UTF math twice
on each input string (once for length calculation and another time for
conversion). Exact length math is more complicated when handling errors
properly, which the old code didn't do. The new code does UTF math on the
string content only once (when converting) but risks allocating more than
once. There are heuristics in place to lower the probability of
reallocation in cases where the double math avoidance isn't enough of a
saving to absorb an allocation and memcpy.
* Previously, in UTF-16 <-> UTF-8 conversions, an ASCII prefix was optimized
but a single non-ASCII code point pessimized the rest of the string. The
new code tries to get back on the fast ASCII path.
* UTF-16 to Latin1 conversion guarantees less about handling of out-of-range
input to eliminate an operation from the inner loop on x86/x86_64.
* When assigning to a pre-existing string, the new code tries to reuse the
old buffer instead of first releasing the old buffer and then allocating a
new one.
* When reallocating from the new code, the memcpy covers only the data that
is part of the logical length of the old string instead of memcpying the
whole capacity. (For old callers old excess memcpy behavior is preserved
due to bogus callers. See bug 1472113.)
* UTF-8 strings in XPConnect that are in the Latin1 range are passed to
SpiderMonkey as Latin1.
New features:
* Conversion between UTF-8 and Latin1 is added in order to enable faster
future interop between Rust code (or otherwise UTF-8-using code) and text
node and SpiderMonkey code that uses Latin1.
MozReview-Commit-ID: JaJuExfILM9
Avoid processing anon content in nsCanvasFrame, then getting more anon content
via AccessibleCaretEventHub::Init. Instead call Init before creating the custom
content container. We could also throw a script runner at it I guess, but this
prevents the reentrancy issue.
Avoid cloning nodes during layout, just use the same node (already cloned in
InsertAnonymousContent) instead.
The RemoveChild in GetAnonymousContent to handle the reframes instead of cloning
around is a bit hacky, but I don't think it's really worth extending
PostDestroyData for this special case.
Differential Revision: https://phabricator.services.mozilla.com/D1889
The DOM elements within the UA Widget Shadow DOM should have its reflectors in
the UA Widget Scope. This is done by calling nsINode::IsInUAWidget() which
would check its containing shadow and its UA Widget bit.
To prevent JS access of the DOM element before it is in the
UA Widget Shadom DOM tree, various DOM methods are set to inaccessible to
UA Widget script. It would need to use the two special methods in ShadowRoot
instead to insert the DOM directly into the shadow tree.
MozReview-Commit-ID: Jz9iCaVIoij
--HG--
extra : rebase_source : b7b17be68dcde00cfeb207cb39cf16b486f2ab02
This prevents XBL binding from being attached, and create the Shadow Root to
host controls to be created by the script.
Shadow Root and the JS controls are lazily constructed when the controls
attribute is set.
Set nsVideoFrame as dynamic-leaf so it will ignore content child frames when
the controls are XBL anonymous content, and handles child frames from controls
in the Shadow DOM. The content nodes are still ignored since there is no
<slot>s in our Shadow DOM.
MozReview-Commit-ID: 3hk41iMa07n
--HG--
extra : rebase_source : f6f8a3facc9d83f5626cf5f3b4e3fa27438a8a8f
This is needed for patch 4.
This is based both on the wording in the spec and the discussion in
https://github.com/w3c/csswg-drafts/issues/2987, and also doesn't
support them for nsMathMLContainerFrame, which is similar to inlines and
ruby.
Differential Revision: https://phabricator.services.mozilla.com/D2815
--HG--
extra : rebase_source : b7e23fb248fa34957ca2d539134e872f5a03f5a8
A meta viewport tag can simultaneously specify user-scalable=no, and a
layout viewport size and initial zoom level that make the visual viewport
smaller than the layout viewport.
Differential Revision: https://phabricator.services.mozilla.com/D2584
--HG--
extra : moz-landing-system : lando
This change also renames several related functions, as well as fields,
and the header is moved into EXPORTS.mozilla given it is defined under
mozilla namespace.
MozReview-Commit-ID: LqCdcW8fmUN
--HG--
rename : layout/base/ScrollbarStyles.cpp => layout/base/ScrollStyles.cpp
rename : layout/base/ScrollbarStyles.h => layout/base/ScrollStyles.h
extra : rebase_source : 8933f3bca88d5db4b9508e3947f695ecf7511b3e
This builds on bug 1428676 and introduces StyleAppearance, which replaces the
NS_THEME_* constants.
Really sorry for the size of the patch.
There's a non-trivial change in the gtk theme, which I submitted separately as
bug 1478385.
Differential Revision: https://phabricator.services.mozilla.com/D2361
MozReview-Commit-ID: DiSmMWK7Krp
It's not needed anymore, since we tag the pseudo-elements at creation time for
styling.
Differential Revision: https://phabricator.services.mozilla.com/D2330
MozReview-Commit-ID: 7j4DVEHXYIC
Using references helps to see when stuff can and cannot be null.
I removed useless aTag / aNamespaceId arguments which are useless now that XBL
can't override them (bug 1450617), so FindXULData is the only one that keeps
them alive.
Also, I took the liberty of renaming a few fooComputedStyle variables to just
fooStyle, and clarify naming in some pseudo-element-related functions to say
originating element (the spec term) and avoid confusing it with the generated
_moz_generated_content_before / _moz_generated_content_after element.
Note that this is a partial state, more stuff will come in the future.
Differential Revision: https://phabricator.services.mozilla.com/D2326
MozReview-Commit-ID: 39B30doREUH