Commit Graph

231 Commits

Author SHA1 Message Date
Masayuki Nakano
9f1aec970a Bug 1374207 - part4: Element classes should use TextEditor class instead of nIEditor r=smaug
Unfortunately, nsGenericHTMLElement::GetAssociatedEditor() cannot use concrete classes because it may return nsIEditor which is set via nsIDocShell.editor.  The editor set to nsIDocShell may be implemented by JS since nsIEditor isn't marked as builtinclass.

MozReview-Commit-ID: 6GY9LOYp4hM

--HG--
extra : rebase_source : 3e0464067b30daf8254805458c5358d7ea644be8
2017-06-22 15:21:31 +09:00
Emilio Cobos Álvarez
f6dc661b5b Bug 1370802: Parse lang attributes as atoms. r=heycam
MozReview-Commit-ID: Cnq3wB7aVB1

--HG--
extra : rebase_source : fa0252b78381bf023ab08bf2d9fd13d4c0ed57a1
2017-06-15 21:48:26 +02:00
Mats Palmgren
5b7c81e34b Bug 1372317 part 2 - Replace LookupRemoveIf() calls with Lookup() + entry.Remove() where needed. r=froydnj
MozReview-Commit-ID: AoRNdbzh66c
2017-06-18 17:07:54 +02:00
Mats Palmgren
fb94159369 Bug 1372007 - Replace calls to Contains+Put with LookupForAdd and Contains+Get+Put with LookupRemoveIf to avoid unnecessary hashtable lookups. r=froydnj
MozReview-Commit-ID: 5Y1rVCglpzu
2017-06-14 01:54:26 +02:00
Kirk Steuber
0312c4f54a Bug 1370705 - Move attribute change effects from HTMLImageElement::BeforeMaybeChangeAttr to HTMLImageElement::AfterMaybeChangeAttr r=bz
It logically makes more sense for these effects to happen after the attribute has actually been changed and moving them allows us to get rid of the member variable HTMLImageElement::mForceReload.

MozReview-Commit-ID: IJBF3AHVb0U

--HG--
extra : rebase_source : fe3ae2a0cc55ded9702fb7654261ffee83a52057
2017-06-09 09:46:54 -07:00
Kirk Steuber
2feb07c8c6 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

--HG--
extra : rebase_source : 94245dde2710abd439671d05e99f145caca3e189
2017-06-01 15:38:45 -07:00
Kirk Steuber
a02a78b5c7 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

--HG--
extra : rebase_source : 8c343c60b5dca18fb04a4cb548907a2e4b9df1d2
2017-05-31 11:01:47 -07:00
Boris Zbarsky
237aa3d58c 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
b2f44e5181 Merge inbound to m-c. a=merge 2017-05-31 20:25:52 -04:00
Brad Werth
b4e5c552de Bug 1355675 Part 3: Add some Chrome-only getTransformTo... methods to Element. r=mattwoodrow,smaug
MozReview-Commit-ID: 5H2DXKJzE8H

--HG--
extra : rebase_source : a5089158676586e94ac1c8528dd052d52973c869
2017-05-30 09:42:25 -07:00
Tobias Schneider
ca72a8397e Bug 1335644 - (intersection-observer) Always send an initial notification after .observe() is called. r=mstange
--HG--
extra : rebase_source : 022d43ae4351831e625660ebab023b4ca632939e
2017-05-24 17:20:57 -07:00
Boris Zbarsky
d50c80150f 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
42c1cf9ea3 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
3119ff4e5e 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
8b07ba2a07 Merge m-c to inbound a=merge
a=release IGNORE BAD COMMIT MESSAGES
2017-05-19 15:18:51 -07:00
Olli Pettay
2d735273d9 Bug 1366250, don't flush layout when calling element.focus() on already focused element. Ensure layout is flushed after changing input.type, r=ehsan
--HG--
extra : rebase_source : 294d0220cc3c2b6be38566ff28722c5e9acc87a9
2017-05-19 23:20:48 +03:00
Kirk Steuber
e74f1cd513 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

--HG--
extra : rebase_source : 42776eb01451d371e4aebcc17fe3dd112c8d268b
2017-05-18 14:09:01 -07:00
Christian Holler
7d5c35b559 Bug 1365954 - Fix check for EXTRA_DOM_ELEMENT_BYTES. r=bholley
MozReview-Commit-ID: CNG7XR4ZjIi

--HG--
extra : rebase_source : 23276dc9a6952294a98c87ab09de6caf35a9c9c3
2017-05-18 17:03:39 +02:00
Brian Birtles
56a6846b66 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.

--HG--
extra : rebase_source : 729947c29efc51864333397cf772079646c1f197
2017-05-16 12:46:51 +09:00
Daniel Holbert
ad52211150 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

--HG--
extra : rebase_source : c8cccf8e6495ab1d57f9680c07b3e43a488e8691
2017-05-10 13:53:27 -07:00
Bobby Holley
de6dd624ed 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
4c9431ce8a Bug 1363375 - Add static assert for element sizes on 64-bit. r=smaug 2017-05-11 13:51:28 +02:00
Wes Kocher
8f6058b583 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
b216b7b0e8 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

--HG--
extra : rebase_source : c8cccf8e6495ab1d57f9680c07b3e43a488e8691
2017-05-10 13:53:27 -07:00
Boris Zbarsky
f11ddd537b 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
c11cf34901 Bug 1354331 - Remove network.http.enablePerElementReferrer usages. r=valentin r=baku 2017-05-01 00:12:34 +05:30
Nicholas Hurley
4608c1dbd5 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

--HG--
extra : rebase_source : cf7b5628058c1a1bcadc8531f2da44d259c6fdaa
2017-04-27 14:35:09 -07:00
Emilio Cobos Álvarez
23bce99ae1 Bug 1361051: rename mozilla::FrameType to mozilla::LayoutFrameType. r=xidorn
This avoids conflicts with mozilla::dom::FrameType.

MozReview-Commit-ID: 7aEMbHRaTFk

--HG--
extra : rebase_source : 2d01321f5ce0ec8c0e3f70984674f82678034b3c
2017-05-01 19:32:52 +02:00
Emilio Cobos Álvarez
e44543aad4 Bug 1360241: Devirtualize nsIFrame::GetType. r=heycam
MozReview-Commit-ID: 5Nzhyta5Hle

--HG--
extra : rebase_source : c2e9d4bfb9239f5e851d110cd7dff98c1e1a8d8b
2017-04-30 17:30:08 +02:00
Olli Pettay
d401b45a1f Bug 1352898, add a cache for nsMappedAttributes to reduce malloc/free and bind nsMappedAttributes always to nsHTMLStyleSheet if owner document has such, r=bz
--HG--
extra : rebase_source : f5d0d17a7c4eb5244ebb993b6ed34ea048921366
2017-04-07 19:21:48 +03:00
Brian Birtles
33041d1214 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

--HG--
extra : rebase_source : 3ba51f3b00d1ec7bc91102629d9c0abb88992fef
2017-04-05 14:39:23 +09:00
bechen
268a2f5b7a 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

--HG--
extra : rebase_source : eedcd5948852c3405a719b9f3c3396ee009f7273
2017-04-05 10:48:52 +08:00
Olli Pettay
98fff73826 Bug 1351303, add main thread only cache for nsIAtoms to speed up atomization, r=froydnj
--HG--
extra : rebase_source : 9c67cd71c0721329eaeaaa96a295e90abc480042
2017-04-03 23:13:18 +03:00
Xidorn Quan
e3e4554871 Bug 1351957 - Create URLExtraData for holding base uri, referrer, and principal. r=heycam
MozReview-Commit-ID: 1wqTb3kvvWh

--HG--
extra : rebase_source : cae3dba21c916ab0f52056bd9db215249b650cd3
2017-03-30 18:54:48 +11:00
Olli Pettay
12316106ee Bug 1352389, don't push extra script blocker on stack when setting attributes, r=bz
--HG--
extra : rebase_source : 2571f3d502114b84f8b95bbb50c5a0707eb14298
2017-03-31 22:54:41 -04:00
Olli Pettay
5706cc683b backout Bug 1352389, r=backout 2017-03-31 16:59:06 -04:00
Olli Pettay
b86d26e216 Bug 1352389, don't push extra script blocker on stack when setting attributes, r=bz
--HG--
extra : rebase_source : 55820b78425fe7a64e77eaeb31f5093309f2d06c
2017-03-31 13:13:52 -04:00
Manish Goregaokar
b8c378e1a5 Bug 1330051; Reparse style attribute when adopting across style backends; r=bz
MozReview-Commit-ID: LWN57KApiMu

--HG--
extra : rebase_source : 20cfb66a8d6d5f88aa3db9cc6876f986d71290b4
2017-03-24 15:28:19 -07:00
Olli Pettay
92bb395acd Bug 1339758, click() and similar can return 0 from various coordinate properties, r=masayuki
--HG--
extra : rebase_source : 71547cc6655c39ffeba89676d315bdb9bacc5ff4
2017-03-23 12:57:44 +02:00
Edgar Chen
00f084fb1b Bug 1347634 - GetCustomElementData and SetCustomElementData don't need to be virtual; r=smaug 2017-03-16 12:21:12 +08:00
Boris Zbarsky
55cdc32c73 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
33a3057732 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
f890715ffc 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
6e93d609a7 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

--HG--
extra : rebase_source : 6d5f7ecff2d41d66cbc23ea12e08dc6295e29875
2017-03-06 10:44:13 +08:00
Iris Hsiao
ddd2318db2 Backed out changeset 41bd2eefc823 (bug 1341230) 2017-03-06 11:48:58 +08:00
Cameron McCormack
fd0d68c179 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

--HG--
extra : rebase_source : 6d5f7ecff2d41d66cbc23ea12e08dc6295e29875
2017-03-06 10:44:13 +08:00
Mats Palmgren
d13aaf9ce0 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
5167bc2af8 Bug 1337936 - (intersection-observer) Revise lifetime management. r=smaug
MozReview-Commit-ID: 4pzm00igBLR

--HG--
extra : rebase_source : ad9c5581f991c392f431793fde289b8ca8245bd0
2017-02-22 10:45:13 -08:00
Sebastian Hengst
ae051c91a0 Backed out changeset 5f93d62d9229 (bug 1337936) for asserting in crashtest 869038.html. r=backout 2017-02-22 14:06:26 +01:00
Tobias Schneider
0da735fe74 Bug 1337936 - (intersection-observer) Revise lifetime management. r=smaug
MozReview-Commit-ID: AvdDJaRELXm

--HG--
extra : rebase_source : a3e8705822545fd4c1cee688939c617a419d3936
2017-02-21 03:13:39 -08:00