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

19553 Коммитов

Автор SHA1 Сообщение Дата
Masayuki Nakano 00e1cae15d Bug 1466208 - part 21: Clean up PresShell::EventHandler::EventTargetData::MaybeRetargetToActiveDocument() with early-return style r=smaug
Differential Revision: https://phabricator.services.mozilla.com/D19319

--HG--
extra : moz-landing-system : lando
2019-02-15 02:08:37 +00:00
Brian Birtles 78671d57b6 Bug 1524480 - Set NS_FRAME_MAY_BE_TRANSFORMED bit when we have nsChangeHint_UpdateTransformLayer; r=hiro
Typically we set the NS_FRAME_MAY_BE_TRANSFORMED bit on a frame when one of the
following situations arises:

a. We update the keyframes of a KeyframeEffect to include transforms or we
   create a new KeyframeEffect that animates transforms (in
   KeyframeEffect::SetKeyframes), or
b. We retarget a KeyframeEffect with transforms at a new element (in
   KeyframeEffect::SetTarget), or
c. We create an nsFrame with transform animations applied to it (in
   nsFrame::Init), or
d. We get a nsChangeHint_AddOrRemoveTransform hint in
   RestyleManager::ProcessRestyledFrames and decide to update the frame bit on
   the frame and its continuations accordingly.

However, there are some situations where we can have a transform animation on
a frame where none of the above are triggered.

For example, if the style frame is not unavailable (e.g.  a display:none
element) when the KeyframeEffect is initialized we will fail to the frame bit in
(a) and if we never retarget the effect we will never set reach (b).

Furthermore, if we have an animation that is "not relevant" (e.g.  idle) and
hence not registered with the EffectSet when the frame is initialized we will
fail to set the frame bit in (c).

Finally, if the the animation does not produce a style change that causes the
nsChangeHint_AddOrRemoveTransform bit to be set (e.g. the transform animation
begins at 'none') we will not set the frame bit in (d).

As a result, we can end up failing to set the NS_FRAME_MAY_BE_TRANSFORMED bit
for some content.

The crashtest included in this patch produces such a case and, without the code
changes in this patch, will fail the assertion in ApplyRenderingChangeToTree[1]:

  NS_ASSERTION(!(aChange & nsChangeHint_UpdateTransformLayer) ||
                   aFrame->IsTransformed() ||
                   aFrame->StyleDisplay()->HasTransformStyle(),
               "Unexpected UpdateTransformLayer hint");

That is because although the nsChangeHint_UpdateTransformLayer bit will be set,
aFrame->IsTransformed() will return false because the frame bit has not been
set, and aFrame->StyleDisplay()->HasTransformStyle() will return false because
the animation sets the transform to 'none'.

Not only will this assertion fail, but once we cease flushing style as part of
triggering an animation later in this patch, the reftest
layout/reftests/web-animations/stacking-context-transform-changing-effect.html
will begin to fail. That reftest produces a similar situation to the crashtest
but it currently does not fail because the style flush that happens as part of
creating an animation ensures the style frame is available at the point when the
animation is triggered and hence case (a) from above is hit.

This patch addresses this by detecting the case where we have this change hint
set but not the corresponding frame bit, and setting the frame bit.

[1] https://searchfox.org/mozilla-central/rev/9eb30227b21e0aa40d51d9f9b08bb0b113c5fadb/layout/base/RestyleManager.cpp#1191-1199

Differential Revision: https://phabricator.services.mozilla.com/D18911

--HG--
extra : moz-landing-system : lando
2019-02-15 06:35:55 +00:00
Sylvestre Ledru 41d1d79094 Bug 1519636 - Reformat recent changes to the Google coding style r=Ehsan
# ignore-this-changeset

Differential Revision: https://phabricator.services.mozilla.com/D19663

--HG--
extra : moz-landing-system : lando
2019-02-15 08:15:57 +00:00
Masayuki Nakano cdf451cbdd Bug 1466208 - part 20: Create PresShell::EventHandler::EventTargetData::MaybeRetargetToActiveDocument() r=smaug
Now, we can create methods to update event target into EventTargetData().
This moves a block in PresShell::EventHandler::HandleEvent() to retarget
to active document into the new method.

Differential Revision: https://phabricator.services.mozilla.com/D19318

--HG--
extra : moz-landing-system : lando
2019-02-15 02:06:31 +00:00
Emilio Cobos Álvarez f30b7747dd Bug 1528098 - Remove content-select code. r=dholbert
Differential Revision: https://phabricator.services.mozilla.com/D19869

--HG--
extra : moz-landing-system : lando
2019-02-15 01:51:33 +00:00
Ting-Yu Lin 8c62035164 Bug 1527519 Part 3 - Replace remaining nsLayoutUtils::GetAsBlock() with do_QueryFrame(), and delete nsLayoutUtils::GetAsBlock(). r=mats
Depends on D19861

Differential Revision: https://phabricator.services.mozilla.com/D19863

--HG--
extra : moz-landing-system : lando
2019-02-15 01:38:05 +00:00
Ting-Yu Lin 6694012956 Bug 1527519 Part 2 - Replace some nsLayoutUtils::GetAsBlock() with nsIFrame::IsBlockFrameOrSubclass(). r=mats
Depends on D19860

Differential Revision: https://phabricator.services.mozilla.com/D19861

--HG--
extra : moz-landing-system : lando
2019-02-15 01:38:04 +00:00
Ryan Hunt fc7e92ad83 Bug 1520363 - Rename nsIScrollableFrame::GetAnchor() to Anchor(). r=dholbert
Differential Revision: https://phabricator.services.mozilla.com/D19872

--HG--
extra : moz-landing-system : lando
2019-02-15 01:25:55 +00:00
Mike Hommey ef3ad686ee Bug 1512504 - Remove support for MSVC. r=froydnj
Consequently, this removes:
- MOZ_LIBPRIO, which is now always enabled.
- non_msvc_compiler, which is now always true.
- The cl.py wrapper, since it's not used anymore.
- CL_INCLUDES_PREFIX, which was only used for the cl.py wrapper.
- NONASCII, which was only there to ensure CL_INCLUDES_PREFIX still
  worked in non-ASCII cases.

This however keeps a large part of detecting and configuring for MSVC,
because we still do need it for at least headers, libraries, and midl.

Depends on D19614

Differential Revision: https://phabricator.services.mozilla.com/D19615

--HG--
extra : moz-landing-system : lando
2019-02-14 21:45:27 +00:00
Razvan Maries dcc3ecb682 Merge mozilla-central to autoland. a=merge on a CLOSED TREE 2019-02-13 07:23:59 +02:00
Masayuki Nakano 43ddca81c8 Bug 1466208 - part 19: Group PresShell, nsIFrame and nsIContent with a struct r=smaug
PresShell::EventHandler::HandleEvent() looks for PresShell, nsIFrame and
nsIContent a lot for aGUIEvent.  Sometimes part of them are modified,
otherwise, all of them are modified by some reasons.  Therefore, for
splitting each of the modifiers into separated methods, we need a struct
for making them as a group and usable for in/out parameter.

(If you have some ideas of better name, let me know.)

Differential Revision: https://phabricator.services.mozilla.com/D19317

--HG--
extra : moz-landing-system : lando
2019-02-12 23:23:27 +00:00
Markus Stange f3d9f254c8 Bug 1506976 - Make FirstContentfulPaint timing measure until the composite end of the paint. r=bas
Differential Revision: https://phabricator.services.mozilla.com/D18880

--HG--
extra : moz-landing-system : lando
2019-02-12 19:09:06 +00:00
Olli Pettay 7f7c5ac04f Bug 1527360 - Add a profiler marker for the case when RefreshDriver is still waiting for paint , r=mstange
--HG--
extra : rebase_source : c1b2cc4e0351bc79865388a7b26a56652997d6c0
2019-02-12 18:52:43 +02:00
Masayuki Nakano ac6fccbe32 Bug 1466208 - part 18: Create PresShell::EventHandler::MaybeDiscardOrDelayMouseEvent() r=smaug
This patch moves the block, which discard or put the event into the delayed event
queue if handling event is a mouse event, to new method.

Differential Revision: https://phabricator.services.mozilla.com/D19301

--HG--
extra : moz-landing-system : lando
2019-02-12 04:12:20 +00:00
Masayuki Nakano 46b802fc11 Bug 1466208 - part 17: Make PresShell::EventHandler::HandleEventWithPointerCapturingContentWithoutItsFrame() to handle event when there is pointer capturing content but it does not have primary frame r=smaug
This patch splits the part handling event when there is pointer capturing
content but it does not have frame.

Differential Revision: https://phabricator.services.mozilla.com/D19300

--HG--
extra : moz-landing-system : lando
2019-02-12 04:10:33 +00:00
Masayuki Nakano 0c300040e9 Bug 1506508 - Make PresShell::EventHandler::HandleEvent() flush any dirty region before deciding to event target of eMouseDown and eMouseUp r=smaug
When preceding mouse event is handled, that may cause changing style of the
target.  Therefore, when an eMouseDown or eMouseUp event is handled, handlers
require the latest layout.  Currently, nsViewManager::DispatchEvent() tries
to guarantee that with calling nsIPresShell::FlushPendingNotifications()
with FlushType::Layout.  However, this just flushes the pending layout in
the PresShell associated with the nsViewManager instance.  I.e., if the
target is in a child PresShell, its layout hasn't been flushed.

This patch makes PresShell::EventHandler::HandleEvent() flush pending
notifications at first of handling events using coordinates (only when
eMouseDown or eMouseUp, though).  Then, when it realizes that the event
should be handled in a child PresShell, makes it flush its pending
notifications and then, recompute event target with the latest layout if
the layout is actually changed.

Differential Revision: https://phabricator.services.mozilla.com/D13720

--HG--
extra : moz-landing-system : lando
2019-02-11 23:25:45 +00:00
Razvan Maries b434b6e870 Merge mozilla-central to mozilla-inbound. a=merge on a CLOSED TREE 2019-02-10 11:50:49 +02:00
Emilio Cobos Álvarez 8101ae2ea8 Bug 1523071 - Use Rust lengths for margin / padding / inset. r=jwatt
Also for the intersection observer root margin, since it was easier to fix it
up and clean it up than not doing it.

This is the first big step to get rid of nscoord. It duplicates a bit of logic
in nsLayoutUtils since for now max/min-width/height are still represented with
nsStyleCoord, but I think I prefer to land this incrementally.

I didn't add helpers for the physical accessors of the style rect sides that
nsStyleSides has (top/bottom/left/right) since I think we generally should
encourage the logical versions, but let me know if you want me to do that.

Differential Revision: https://phabricator.services.mozilla.com/D17739
2019-02-10 04:11:58 +01:00
Emilio Cobos Álvarez ca19235faa Bug 1523071 - Use the style system's LengthPercentage for shape-margin. r=jwatt
This also makes us pass a few WPTs because we stop losing precision when
serializing the computed value.

Differential Revision: https://phabricator.services.mozilla.com/D17738
2019-02-10 04:11:00 +01:00
Masayuki Nakano d9b3993fcc Bug 1466208 - part 16: Clean up PresShell::EventHandler::ComputeRootFrameToHandleEvent() and its helper methods with early-return style r=smaug
Differential Revision: https://phabricator.services.mozilla.com/D18526

--HG--
extra : moz-landing-system : lando
2019-02-08 23:12:18 +00:00
Masayuki Nakano 9e085b54d8 Bug 1466208 - part 15: Split PresShell::EventHandler::ComputeRootFrameToHandleEvent() r=smaug
PresShell::EventHandler::ComputeRootFrameToHandleEvent() computes root frame
to handle event with popup frame and/or capturing content.  The former result
can be rewritten with the latter.  So, for cleaning it up with early return
style, we need to split it to 2 methods.

Differential Revision: https://phabricator.services.mozilla.com/D18525

--HG--
extra : moz-landing-system : lando
2019-02-08 23:10:13 +00:00
Masayuki Nakano 33f04c5177 Bug 1466208 - part 14: Create PresShell::EventHandler::ComputeRootFrameToHandleEvent() r=smaug
In some reasons, handling event should be handled in specific frame even if
the coordinates are out of the frame.  PresShell::EventHandler::HandleEvent()
computes it with popups, capturing content, etc.  This patch moves the blocks
into new method for making HandleEvent() simpler.

Note that most of the code is just moved.  The following patch will clean it
up.

Differential Revision: https://phabricator.services.mozilla.com/D18523

--HG--
extra : moz-landing-system : lando
2019-02-08 07:11:01 +00:00
Masayuki Nakano 2719af4bb6 Bug 1466208 - part 13: Create PresShell::EventHandler::MaybeFlushThrottledStyles() r=smaug
PresShell::EventHandler::HandleEvent() tries to flush pending animation first
when it decides frame to handle events using coordinates.  This patch moves
the code into the new method.

Differential Revision: https://phabricator.services.mozilla.com/D18522

--HG--
extra : moz-landing-system : lando
2019-02-08 05:05:45 +00:00
Makoto Kato 03c4d17822 Bug 1496118 - Clean up caret when destroying editor. r=masayuki
Summary:
Editor changes caret visibility during drag and drop.  But when destroying
editor, we don't restore caret state.  So we should restore it when destroying
editor.

Tags: #secure-revision

Bug #: 1496118

Differential Revision: https://phabricator.services.mozilla.com/D18923

--HG--
extra : rebase_source : 157f2c9e69857c7f7adb916af2a319392c4d125a
2019-02-06 19:26:35 +09:00
Emilio Cobos Álvarez 598a098826 Bug 1525371 - Remove ArenaRefPtr. r=jwatt
Differential Revision: https://phabricator.services.mozilla.com/D18735
2019-02-07 11:15:39 +01:00
Emilio Cobos Álvarez 12867b1a3f Bug 1525371 - Kill ComputedStyle::mPresContext, move the pointer to the frame instead. r=jwatt
Differential Revision: https://phabricator.services.mozilla.com/D18734
2019-02-07 11:15:36 +01:00
Masayuki Nakano 9e00d7caae Bug 1466208 - part 12: Get rid of `frame` variable from PresShell::EventHandler::HandleEvent() r=smaug
There is an unclear variable `frame` in PresShell::EventHandler::HandleEvent().
It's overwritten with different frame and its meanings is changed sometimes.
Finally, it's necessary only in the `if (aGUIEvent->IsUsingCoordinates())`
block.  Therefore, we can move it into the block and rename it when them for
each purpose.

Differential Revision: https://phabricator.services.mozilla.com/D18521

--HG--
extra : moz-landing-system : lando
2019-02-07 01:53:38 +00:00
Hiroyuki Ikezoe 9fe047bfb3 Bug 1516377 - Use the layout viewport for position:fixed elements if the viewport is larger than. r=botond
Both of reftests in this commit are based on an exmaple [1] in the Viewports
Explainer written by David Bokan.

position-fixed-out-of-view.html fails without the fix because the position:fixed
element is rendered at the right edge of the visual viewport so that it's
visible in the first place.

position-fixed-on-minimum-scale-size.html does NOT fail without the fix either
because the position:fixed element sticks at the right edge of the visual
viewport so that it still be there even after the visual viewport offset has
been changed.

[1] https://github.com/bokand/bokand.github.io/blob/master/web_viewports_explainer.md#chrome-2

Differential Revision: https://phabricator.services.mozilla.com/D18797

--HG--
extra : moz-landing-system : lando
2019-02-07 05:39:33 +00:00
Brendan Dahl ed6a76c718 Bug 1524640 - Fix font loading during mozPrintCallback. r=smaug
Copy fonts loaded during a mozPrintCallback into the cloned document,
so they are available during printing.

Differential Revision: https://phabricator.services.mozilla.com/D18613

--HG--
extra : moz-landing-system : lando
2019-02-06 23:46:58 +00:00
Masayuki Nakano 3ebe8914da Bug 1466208 - part 11: Create PresShell::EventHandler::MaybeDiscardOrDelayKeyboardEvent() r=smaug
PresShell::EventHandler::HandleEvent() discards or puts off to dispatch
the handling event if it's a keyboard event and event dispatching is
suppressed by the document.

This patch moves the block into the new method for making HandleEvent() simpler.

Differential Revision: https://phabricator.services.mozilla.com/D18520

--HG--
extra : moz-landing-system : lando
2019-02-07 01:49:31 +00:00
Liang-Heng Chen bd2504a471 Bug 1485266 - Use stand-ins for native colors when RFP is enabled r=heycam
Differential Revision: https://phabricator.services.mozilla.com/D17755

--HG--
extra : moz-landing-system : lando
2019-02-06 08:45:44 +00:00
Emilio Cobos Álvarez e38aff2db7 Bug 1525134 - Move image loads out of the style struct accessors. r=heycam
After this I can pass the document from the caller to ResolveSameStructsAs, and
get rid of the pres context pointer.

Differential Revision: https://phabricator.services.mozilla.com/D18600

--HG--
extra : moz-landing-system : lando
2019-02-05 19:47:29 +00:00
Razvan Maries de782903b2 Backed out changeset 919de32d4905 (bug 1525134) for build bustages. CLOSED TREE 2019-02-05 19:36:46 +02:00
Emilio Cobos Álvarez 3fe47839c0 Bug 1525134 - Move image loads out of the style struct accessors. r=heycam
After this I can pass the document from the caller to ResolveSameStructsAs, and
get rid of the pres context pointer.

Differential Revision: https://phabricator.services.mozilla.com/D18600
2019-02-05 18:07:18 +01:00
Razvan Maries f86459d5dc Merge mozilla-central to autoland. a=merge on a CLOSED TREE 2019-02-05 18:59:13 +02:00
Razvan Maries 0b09448bc6 Backed out changeset 992f27cfecac (bug 1525134) for build bustages. CLOSED TREE 2019-02-05 18:54:14 +02:00
Emilio Cobos Álvarez 0ebf739646 Bug 1523181 - Don't implicitly flush the user font set.
Summary:
Flushing it at a bad time can cancel loads whose timer / completion
handler is in progress, which makes no sense.

Reviewers: jfkthame, jwatt, heycam

Tags: #secure-revision

Bug #: 1523181

Differential Revision: https://phabricator.services.mozilla.com/D17856
2019-02-05 13:30:13 +01:00
Bastien Abadie 758e52fd5a Bug 1524585 - Remove unused width/height updated values. r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D18349

--HG--
extra : moz-landing-system : lando
2019-02-01 16:29:15 +00:00
Emilio Cobos Álvarez 073adf9499 Bug 1524266 - Should be able to delete non-selectable and non-editable content in a contenteditable subtree. r=mats
This makes our behavior a bit closer to Blink / WebKit.

This patch fixes multiple issues:

First, fixes the caret movement getting stuck on a <select> element inside an
editor. This is because of the IsRootOfAnonymousSubtree() check that I'm
removing. Instead of that, consider NAC unselectable in UsedUserSelect, just
like generated content. This makes us jump across it correctly, and doesn't
regress the test-case that was added in bug 989012.

Second, it allows to select nodes with user-select: none as long as you're on an
editor. This matches WebKit and Blink. It's something you could do earlier
regardless with user-select: all on the parent, which is why the reporter's
test-case worked before my patch. I think being able to jump across these and
delete them on an editor is the right thing to do.

It adds tests for all this plus the same thing working for non-editable contents
(there was no pre-existing test for that).

Differential Revision: https://phabricator.services.mozilla.com/D18494
2019-02-04 12:03:32 +01:00
Narcis Beleuzu ea68bce62d Backed out changeset 4d5cbdd05859 (bug 1524266) for clipboard failures on test_browserElement_oop_CopyPaste.html
--HG--
extra : rebase_source : 04a0c7ba826ade9ed71752c7e388236fb3214666
2019-02-04 04:06:37 +02:00
Emilio Cobos Álvarez 03963da9ad Bug 1524266 - Should be able to delete non-selectable and non-editable content in a contenteditable subtree. r=mats
This makes our behavior a bit closer to Blink / WebKit.

This patch fixes multiple issues:

First, fixes the caret movement getting stuck on a <select> element inside an
editor. This is because of the IsRootOfAnonymousSubtree() check that I'm
removing. Instead of that, consider NAC unselectable in UsedUserSelect, just
like generated content. This makes us jump across it correctly, and doesn't
regress the test-case that was added in bug 989012.

Second, it allows to select nodes with user-select: none as long as you're on an
editor. This matches WebKit and Blink. It's something you could do earlier
regardless with user-select: all on the parent, which is why the reporter's
test-case worked before my patch. I think being able to jump across these and
delete them on an editor is the right thing to do.

It adds tests for all this plus the same thing working for non-editable contents
(there was no pre-existing test for that).

Differential Revision: https://phabricator.services.mozilla.com/D18494

--HG--
extra : moz-landing-system : lando
2019-02-03 23:13:09 +00:00
Masayuki Nakano 1ff659133d Bug 1466208 - part 10: Create PresShell::EventHandler::MaybeDiscardEvent() to check whether it's safe to handle the event r=smaug
It may not be safe to handle events even when
PresShell::EventHandler::HandleEvent().  In such case, we need to discard
received events with notifying somebody.  This patch move this rare case
jobs into the new method, MaybeDiscardEvent().  Then, the caller, HandleEvnet(),
becomes easier to read.

Differential Revision: https://phabricator.services.mozilla.com/D16960

--HG--
extra : moz-landing-system : lando
2019-02-02 02:20:28 +00:00
arthur.iakab 60c4067b1c Merge inbound to mozilla-central a=merge 2019-02-03 11:51:35 +02:00
Olli Pettay 5543345a37 Bug 1524806 - Start RefreshDriver timer very early, r=emilio
--HG--
extra : rebase_source : 4d15f88f2e2a530c7e8aee4bbae3855755d7bbdf
2019-02-03 04:11:55 +02:00
Emilio Cobos Álvarez a80ffc72ff Bug 1524328 - Don't resolve counter styles in the style system. r=xidorn
Doing it during layout instead. This also has the nice side-effect of
no longer needing to do a full restyle when counter-style rules are inserted.

Differential Revision: https://phabricator.services.mozilla.com/D18343
2019-02-03 03:00:12 +01:00
Masayuki Nakano 1cd52b1c57 Bug 1466208 - part 9: Create PresShell::EventHandler::MaybeHandleEventWithAnotherPresShell() to handle event with another PresShell if necessary r=smaug
Let's move the redirection of coming event in
PresShell::EventHandler::HandleEvent() into a method.  This makes the caller
easier to read.

Differential Revision: https://phabricator.services.mozilla.com/D16959

--HG--
extra : moz-landing-system : lando
2019-02-02 02:20:25 +00:00
Masayuki Nakano f61ec19082 Bug 1524214 - Grab caching capturing content with local variable r=smaug
Differential Revision: https://phabricator.services.mozilla.com/D18209

--HG--
extra : moz-landing-system : lando
2019-02-01 20:44:28 +00:00
Botond Ballo 2206990a93 Bug 1521644 - Trigger a full display list rebuild when transition to or from using an async zoom container. r=mattwoodrow
Differential Revision: https://phabricator.services.mozilla.com/D17168

--HG--
extra : moz-landing-system : lando
2019-02-01 18:30:28 +00:00
Masayuki Nakano b64bb949e0 Bug 1466208 - part 8: Clean up PresShell::EventHandler::GetFrameForHandlingEventWith() r=smaug
Differential Revision: https://phabricator.services.mozilla.com/D16958

--HG--
extra : moz-landing-system : lando
2019-02-01 02:18:55 +00:00
Emilio Cobos Álvarez 0996652d1a Bug 1525134 - Move image loads out of the style struct accessors. r=heycam
After this I can pass the document from the caller to
ResolveSameStructsAs, and get rid of the pres context pointer.

Differential Revision: https://phabricator.services.mozilla.com/D18600

--HG--
extra : moz-landing-system : lando
2019-02-05 13:45:04 +00:00