Commit Graph

226 Commits

Author SHA1 Message Date
Kirk Steuber
8f7a03110f Bug 1365092 - Moves side effects of HTMLImageElement's SetAttr function to the corresponding BeforeSetAttr and AfterSetAttr functions r=bz
This is necessary to facilitate the transition to cloning attributes instead of reparsing them.

HTMLImageElement's side effects proved to be a bit trickier than those of many other classes because HTMLImageElement::SetAttr intentionally forces an image reload, even if the attribute value has not been changed. Element::SetAttr, on the other hand, usually ignores attribute changes that do not change the attribute value, exiting before BeforeSetAttr is even called. In order to preserve this behavior, another virtual function |OnAttrSetButNotChanged| was added to the Element class. This function will be called in the case that Element::SetAttr exits early, allowing a forced reload to take place at that time.

MozReview-Commit-ID: 4CrH30bo5GT
2017-06-01 15:38:45 -07:00
Kirk Steuber
fe43804c94 Bug 1365092 - Moves side effects of nsGenericHTMLElement and Element's SetAttr, UnsetAttr, and ParseAttribute functions to the corresponding BeforeSetAttr and AfterSetAttr functions r=bz
This is necessary to facilitate the transition to cloning attributes instead of reparsing them.

MozReview-Commit-ID: HzB3f1sr9y9
2017-05-31 11:01:47 -07:00
Boris Zbarsky
de0ea97288 Bug 1370072. Don't hold on to a frame pointer across a frame flush. r=ehsan 2017-06-06 21:21:45 -04:00
Ryan VanderMeulen
3665b7f0f2 Merge inbound to m-c. a=merge 2017-05-31 20:25:52 -04:00
Brad Werth
9b0738b4c3 Bug 1355675 Part 3: Add some Chrome-only getTransformTo... methods to Element. r=mattwoodrow,smaug
MozReview-Commit-ID: 5H2DXKJzE8H
2017-05-30 09:42:25 -07:00
Tobias Schneider
5ef2fcffa2 Bug 1335644 - (intersection-observer) Always send an initial notification after .observe() is called. r=mstange 2017-05-24 17:20:57 -07:00
Boris Zbarsky
b66f95ba90 Bug 1364360 part 3. Don't flush layout when setting scrollTop to 0. r=ehsan 2017-05-25 13:39:44 -04:00
Boris Zbarsky
9eb1270871 Bug 1364360 part 2. Make Element::GetScrollFrame take a flush type, not a "should I flush?" boolean. r=ehsan 2017-05-25 13:39:44 -04:00
Boris Zbarsky
f364d500c6 Bug 1364360 part 1. Make Element::GetScrollFrame follow the spec more closely in the quirks mode case. r=ehsan 2017-05-25 13:39:44 -04:00
Wes Kocher
9bc3922e5c Merge m-c to inbound a=merge
a=release IGNORE BAD COMMIT MESSAGES
2017-05-19 15:18:51 -07:00
Olli Pettay
92e7031a10 Bug 1366250, don't flush layout when calling element.focus() on already focused element. Ensure layout is flushed after changing input.type, r=ehsan 2017-05-19 23:20:48 +03:00
Kirk Steuber
e2ea33731f Bug 1363481 - Add the old attribute value as a parameter to Element::AfterSetAttr r=bz
In order to facilitate the movement of code with side-effects called by Element::SetAttr to Element::BeforeSetAttr and Element::AfterSetAttr, Element::AfterSetAttr should have access to the old value of the attribute. This includes information about whether there was previously a value set or not.

Accomplishing this involved passing an additional argument through functions that find and change the old attribute value in order to ensure that we can differentiate between an empty old value and an absent old value (attribute was not set).

Note that while I tried to ensure that accurate values (and their absence) are reported to Element::AfterSetAttr, I largely ignored SVG. While the old value reported for SVG values should be however accurate the value already being reported to SetAttrAndNotify was, SVG elements do not currently report unset values properly because they will never pass a null pointer to SetAttrAndNotify.

MozReview-Commit-ID: K1mha8CNFZP
2017-05-18 14:09:01 -07:00
Christian Holler
cca4fe4d89 Bug 1365954 - Fix check for EXTRA_DOM_ELEMENT_BYTES. r=bholley
MozReview-Commit-ID: CNG7XR4ZjIi
2017-05-18 17:03:39 +02:00
Brian Birtles
2ea43d17c9 Bug 1355348 - Drop extra eRestyle_StyleAttribute hint from Element::SetSMILOverrideStyleDeclaration; r=dbaron
This was originally added in bug 1133439 but it's not clear that it is needed.
It may be that we thought that new SMIL animations should trigger transitions
but that's not the case.

We want to remove this as part of this bug since Servo_NoteExplicitHints is
currently not capable of handling animation restyle hints and non-animation
restyle hints at the same time.
2017-05-16 12:46:51 +09:00
Daniel Holbert
5066835c91 Bug 1344398 part 2: React to some CSS 'overflow' changes on body/html by simply calling UpdateViewportScrollbarStylesOverride() instead of reframing. r=bz,tnikkel
MozReview-Commit-ID: Lpr9aNv9hAB
2017-05-10 13:53:27 -07:00
Bobby Holley
45926d6eb7 Bug 1363375 - Pack nsINode better on 64-bit and stop conditionally compiling mServoData. r=smaug 2017-05-11 13:51:28 +02:00
Bobby Holley
5b757ce07c Bug 1363375 - Add static assert for element sizes on 64-bit. r=smaug 2017-05-11 13:51:28 +02:00
Wes Kocher
1be726284d Backed out 3 changesets (bug 1344398) for assertion failures at Element.cpp a=backout
Backed out changeset d0e5a5ba01b5 (bug 1344398)
Backed out changeset d70f9de401d1 (bug 1344398)
Backed out changeset 647d0bb3714d (bug 1344398)

MozReview-Commit-ID: DTVWf28NcNb
2017-05-10 17:43:50 -07:00
Daniel Holbert
4fdbcddca9 Bug 1344398 part 2: React to some CSS 'overflow' changes on body/html by simply calling UpdateViewportScrollbarStylesOverride() instead of reframing. r=bz,tnikkel
MozReview-Commit-ID: Lpr9aNv9hAB
2017-05-10 13:53:27 -07:00
Boris Zbarsky
50c4dcff23 Bug 1361274. There's no need to update link :visited state when doing querySelectorAll, since querySelectorAll ignores that state anyway. r=smaug
In our current setup, in which links with an href attribute always match either
:link or :visited, no matter whether that attribute's value is a valid URI,
changes to the attribute always put the element into either the "match nothing"
state or the "match :link" state, via calls to Link::ResetLinkState.

The only thing FlushPendingLinkUpdates is needed for is (lazily, in case it
turns out to not be needed because the element got removed from the DOM anyway)
registering a history observer to switch the link state to :visited as needed.

This means that selector matching consumers that would never expose :visited
state to start with don't need to worry about calling FlushPendingLinkUpdates.
2017-05-03 16:54:25 -04:00
Swapnesh Kumar Sahoo
ce131543e8 Bug 1354331 - Remove network.http.enablePerElementReferrer usages. r=valentin r=baku 2017-05-01 00:12:34 +05:30
Nicholas Hurley
82b2692d01 Bug 1348278 - Speculatively connect when mousedown happens on a link r=bz
Try to speed up perceived pageload by opening a connection as soon as the
user mouses down on a link, instead of waiting for the full click/AsyncOpen
process to get there.

MozReview-Commit-ID: 4g6mZXWt9H5
2017-04-27 14:35:09 -07:00
Emilio Cobos Álvarez
643f3f8618 Bug 1361051: rename mozilla::FrameType to mozilla::LayoutFrameType. r=xidorn
This avoids conflicts with mozilla::dom::FrameType.

MozReview-Commit-ID: 7aEMbHRaTFk
2017-05-01 19:32:52 +02:00
Emilio Cobos Álvarez
3731858edf Bug 1360241: Devirtualize nsIFrame::GetType. r=heycam
MozReview-Commit-ID: 5Nzhyta5Hle
2017-04-30 17:30:08 +02:00
Olli Pettay
7705130cb4 Bug 1352898, add a cache for nsMappedAttributes to reduce malloc/free and bind nsMappedAttributes always to nsHTMLStyleSheet if owner document has such, r=bz 2017-04-07 19:21:48 +03:00
Brian Birtles
4de61d72aa Bug 1315874 - Drop 'ForElement' from GetStyleContextForElementXXX methods; r=heycam
In the next patch we want to add a method called
GetUnanimatedStyleContextForElementNoFlush but that's much too long. Instead it
seems better to just drop 'ForElement' from all these methods since it should be
fairly obvious we are getting the style context for an element given that the
first argument is an element.

MozReview-Commit-ID: JQKaEuCKV2F
2017-04-05 14:39:23 +09:00
bechen
f8984de0c4 Bug 1318542 - Label NODE_IS_NATIVE_ANONYMOUS on the elements from ::cue up to nsVideoFrame. r=bz,heycam
Since the ::cue div created by JS, it doesn't have the NODE_IS_NATIVE_ANONYMOUS flag.
We set the NODE_IS_NATIVE_ANONYMOUS when binding to domtree from the ::cue up to the RootOfAnonymousSubtree
so that GetClosestNonNativeAnonymousAncestor will return video element as style parent.

MozReview-Commit-ID: 3EiYOqnbY15
2017-04-05 10:48:52 +08:00
Olli Pettay
afc3412e08 Bug 1351303, add main thread only cache for nsIAtoms to speed up atomization, r=froydnj 2017-04-03 23:13:18 +03:00
Xidorn Quan
95cf226194 Bug 1351957 - Create URLExtraData for holding base uri, referrer, and principal. r=heycam
MozReview-Commit-ID: 1wqTb3kvvWh
2017-03-30 18:54:48 +11:00
Olli Pettay
1ea6ce17c0 Bug 1352389, don't push extra script blocker on stack when setting attributes, r=bz 2017-03-31 22:54:41 -04:00
Olli Pettay
36866509cd backout Bug 1352389, r=backout 2017-03-31 16:59:06 -04:00
Olli Pettay
b9520e8c63 Bug 1352389, don't push extra script blocker on stack when setting attributes, r=bz 2017-03-31 13:13:52 -04:00
Manish Goregaokar
cbde7ac997 Bug 1330051; Reparse style attribute when adopting across style backends; r=bz
MozReview-Commit-ID: LWN57KApiMu
2017-03-24 15:28:19 -07:00
Olli Pettay
f82b7f2bd5 Bug 1339758, click() and similar can return 0 from various coordinate properties, r=masayuki 2017-03-23 12:57:44 +02:00
Edgar Chen
c0bad72da1 Bug 1347634 - GetCustomElementData and SetCustomElementData don't need to be virtual; r=smaug 2017-03-16 12:21:12 +08:00
Boris Zbarsky
80d44b7e3f Bug 656197 part 4. Move calls to AfterSetAttr to before UpdateState when manipulating attributes. r=smaug
In particular, this lets us remove UpdateState() calls from AfterSetAttr.  That
change is next.

MozReview-Commit-ID: CFeft0E9o8m
2017-03-16 14:50:42 -04:00
Boris Zbarsky
3221c64e0a Bug 656197 part 2. Move calls to BeforeSetAttr to after AttributeWillChange. r=smaug
This means that implementations of BeforeSetAttr no longer need to UpdateState.
Those UpdateState calls will be removed in a bit.

MozReview-Commit-ID: 1yEg5D4garD
2017-03-16 14:50:41 -04:00
Boris Zbarsky
d40e452ea9 Bug 656197 part 1. Remove the generic attr preparsing mechanism from BeforeSetAttr and just preparse class attributes directly in the one place that needs to do it. r=smaug
This removes the requirement that BeforeSetAttr comes before AttributeWillChange
(which needs the preparsed new value).

MozReview-Commit-ID: 87C6Mjc7ARh
2017-03-16 14:50:41 -04:00
Cameron McCormack
9cfc1f4068 Bug 1341230 - Part 1: Rename ESM_MANAGED_STATES to EXTERNALLY_MANAGED_STATES. r=smaug
Since it's not just the EventStateManager that has access to modify
these EventStates bits.

MozReview-Commit-ID: 17EpfQT5M40
2017-03-06 10:44:13 +08:00
Iris Hsiao
fe774f3435 Backed out changeset 41bd2eefc823 (bug 1341230) 2017-03-06 11:48:58 +08:00
Cameron McCormack
22026a5583 Bug 1341230 - Part 1: Rename ESM_MANAGED_STATES to EXTERNALLY_MANAGED_STATES. r=smaug
Since it's not just the EventStateManager that has access to modify
these EventStates bits.

MozReview-Commit-ID: 17EpfQT5M40
2017-03-06 10:44:13 +08:00
Mats Palmgren
7c43dcf986 Bug 1340771 part 1 - Rename nsWeakFrame to AutoWeakFrame (automated change). r=tn
MozReview-Commit-ID: 8pl4nyeGEkr
2017-03-01 18:03:14 +01:00
Tobias Schneider
18718b4035 Bug 1337936 - (intersection-observer) Revise lifetime management. r=smaug
MozReview-Commit-ID: 4pzm00igBLR
2017-02-22 10:45:13 -08:00
Sebastian Hengst
71f8399713 Backed out changeset 5f93d62d9229 (bug 1337936) for asserting in crashtest 869038.html. r=backout 2017-02-22 14:06:26 +01:00
Tobias Schneider
6c083f71b2 Bug 1337936 - (intersection-observer) Revise lifetime management. r=smaug
MozReview-Commit-ID: AvdDJaRELXm
2017-02-21 03:13:39 -08:00
Tom Tromey
48da5b7de4 Bug 1060419 - remove unneeded includes of prprf.h, r=froydnj
MozReview-Commit-ID: JifhpA3oOeH
2016-12-09 10:00:01 -10:00
Bobby Holley
3f43a691db Bug 1331322 - Move MAY_HAVE_CLASS to mBoolFlags. r=bholley
This fits a bit better with the other stuff, and allows us to add our new NAC
bit with the other NAC related bits, which also happens to be a field that
Servo already has easy access to.
2017-01-20 18:24:41 -08:00
Phil Ringnalda
a6b8226a11 Backed out 4 changesets (bug 1331322) for Android reftest failures in 1169331-1.html and forced-bg-color-outside-visible-region.html
Backed out changeset 96c6b5a11284 (bug 1331322)
Backed out changeset 15877d32de7d (bug 1331322)
Backed out changeset 841d608704d7 (bug 1331322)
Backed out changeset 02096c5eb029 (bug 1331322)
2017-02-15 21:24:00 -08:00
Bobby Holley
eee1ffbb7b Bug 1331322 - Move MAY_HAVE_CLASS to mBoolFlags. r=bholley
This fits a bit better with the other stuff, and allows us to add our new NAC
bit with the other NAC related bits, which also happens to be a field that
Servo already has easy access to.
2017-01-20 18:24:41 -08:00
Boris Zbarsky
04a6827ac6 Bug 1338725 part 2. Move GetClasses/DoGetClasses from nsIContent to Element. r=baku 2017-02-13 16:06:45 -05:00