Commit Graph

147 Commits

Author SHA1 Message Date
Kris Maglione
5f00cf0c65 Bug 1406278: Part 1 - Pass subject principal to SetAttribute and friends. r=bz
In order to tailor certain security checks to the caller that is attempting to
load a particular piece of content, we need to be able to attach an
appropriate triggering principal to the corresponding requests. Since most
HTML content is loaded based on attribute values, that means capturing the
subject principal of the caller who sets those attributes, which means making
it available to AfterSetAttr hooks.

MozReview-Commit-ID: BMDL2Uepg0X
2017-10-09 14:33:38 -07:00
Nicholas Nethercote
7dbfdaf890 Bug 1400460 - Rename nsIAtom as nsAtom. r=hiro.
(Path is actually r=froydnj.)

Bug 1400459 devirtualized nsIAtom so that it is no longer a subclass of
nsISupports. This means that nsAtom is now a better name for it than nsIAtom.

MozReview-Commit-ID: 91U22X2NydP
2017-10-03 09:05:19 +11:00
Nicholas Nethercote
e8236888ee Bug 1401813 - Rename Null[C]String() as Void[C]String(). r=erahm.
XPCOM's string API doesn't have the notion of a "null string". But it does have
the notion of a "void string" (or "voided string"), and that's what these
functions are returning. So the names should reflect that.
2017-09-22 14:35:46 +10:00
Andrew McCreight
4805814a1a Bug 1395636 - Convert code to use NS_IMPL_ISUPPORTS_CYCLE_COLLECTION_INHERITED. r=peterv
MozReview-Commit-ID: DivJPerL5SF
2017-08-31 16:29:22 -07:00
Sebastian Hengst
623e977a9e Backed out changeset 9306866e8df0 (bug 1395636) for build bustage. r=backout on a CLOSED TREE 2017-09-06 19:18:06 +02:00
Andrew McCreight
b8a46fdbcd Bug 1395636 - Convert code to use NS_IMPL_ISUPPORTS_CYCLE_COLLECTION_INHERITED. r=peterv
MozReview-Commit-ID: DivJPerL5SF
2017-08-31 16:29:22 -07:00
Masatoshi Kimura
b87d3e615b Bug 1390209 - Remove unused nsIDOMHTML*Element interfaces. r=qdot
MozReview-Commit-ID: DagD3IHhRZy
2017-08-15 01:31:47 +09:00
Boris Zbarsky
79a6db1efa Bug 1380413 part 2. Remove nsIDOMHTMLImageElement.width/height. r=mccr8 2017-07-13 23:46:12 -04:00
Boris Zbarsky
58e4289282 Bug 1380413 part 1. Remove unused nsIDOMHTMLImageElement bits. r=mccr8 2017-07-13 23:45:56 -04:00
Bill McCloskey
ce42826bdf Bug 1372405 - Provide names for all runnables in the tree (r=froydnj)
MozReview-Commit-ID: DKR6ROiHRS7
2017-06-26 14:19:58 -07:00
Carsten "Tomcat" Book
238bf154d5 Backed out changeset 4f6302a98ae4 (bug 1372405) 2017-06-21 13:59:26 +02:00
Bill McCloskey
67e8af4720 Bug 1372405 - Provide names for all runnables in the tree (r=froydnj)
MozReview-Commit-ID: DKR6ROiHRS7
2017-06-20 21:44:11 -07:00
Carsten "Tomcat" Book
bbe9441993 Backed out changeset 9846de3bd954 (bug 1372405) 2017-06-20 08:27:02 +02:00
Bill McCloskey
f69608368b Bug 1372405 - Provide names for all runnables in the tree (r=froydnj)
MozReview-Commit-ID: DKR6ROiHRS7
2017-06-19 22:25:47 -07:00
Kirk Steuber
0d58d58169 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
2017-06-09 09:46:54 -07:00
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
Edgar Chen
076736a8b0 Bug 1264529 - If an adoption of <img> is happening with the different source and destination document, we need to force it to reload; r=jdm
Do force update image when adoption happens, then we could remove the workaroud added in bug 1307185 and bug 1317901.

MozReview-Commit-ID: Cbg3EHtyL8f
2016-10-13 18:03:10 +08:00
Ryan VanderMeulen
711977f23c Merge inbound to m-c. a=merge 2017-05-19 11:46:56 -04: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
Tom Tung
dc2648e8f2 Bug 1348050 - Part 3: Mark channel as urgent-start for loading image. r=baku,mayhemer
This part is mainly to mark the channel as urgent-start if src related
attributes in HTMLImageElement and HTMLInputElement is set and the channel is
open due to user interaction. Unfortunately, we cannot just check the event
state just after creating channel since some loading image tasks will be queue
and execute in stable state. Thus, I store the event state in elements and
pass it to the place where create the channel.

MozReview-Commit-ID: GBdAkPfVzsn
2017-04-25 09:17:38 +08:00
Edgar Chen
27b625763a Bug 1318624 - Should not perform a load of a image if it's document is not active document; r=jdm
MozReview-Commit-ID: CjclOenaBdv
2016-11-19 00:35:18 +08:00
Kirk Steuber
9386a2f3e1 Bug 1359556 - Optimize cloneNode by preinitializing attribute and child arrays r=bz
Currently, attribute and child arrays (implemented in dom/base/nsAttrAndChildArray.h) start out empty. When cloning, the array ends up being resized multiple times in order to add the attributes and children that are being cloned from the original node. This would be quicker if the array was initialized to the correct size in the first place so that resizes are not necessary.

However, preallocating space for children is only necessary when performing a deep clone. Therefore, an additional parameter is being added to the Clone, CopyInnerTo, and CloneDocHelper methods to indicate whether preallocation of children should happen. Attributes are copied either way, so that part of the array is preallocated in both cases.

MozReview-Commit-ID: 3iVezeAKXnI
2017-04-20 12:57:48 -07: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
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
Manish Goregaokar
be24bd2d60 Bug 1329093 - Part 4: stylo: Delay SVG mapped attr resolution till later; r=bz
MozReview-Commit-ID: 2GvHPg1egjS
2017-03-09 17:46:26 -08:00
Manish Goregaokar
a08e03025a Bug 1334330 - Part 11: stylo: Use ServoUtils abstraction for GenericSpecifiedValues to remove virtual dispatch overhead in nostylo mode; r=bz,emilio
MozReview-Commit-ID: 8yGWs2uOjES
2017-01-26 16:51:01 -08:00
Manish Goregaokar
2d1e54b302 Bug 1334330 - Part 3: stylo: Use GenericSpecifiedValue abstraction in elements using only common mappers; r=bz,emilio
MozReview-Commit-ID: B8vg4ZiqRGK
2017-01-26 16:51:01 -08:00
Manish Goregaokar
7e8e84c24b Bug 1334330 - Part 1: stylo: Abstractify nsMappedAttributes to work on arbitrary containers of specified value data; r=bz,emilio
MozReview-Commit-ID: BSM4TC9RKot
2017-01-26 13:39:13 -08:00
Sylvestre Ledru
500cc2a74a Bug 1336994 - Fix two -Wmax-unsigned-zero warnings (std::max(unsigned int, 0u) r=bz
MozReview-Commit-ID: LX663JqH3lM
2017-02-06 16:06:55 +01:00
Cameron McCormack
5f9911da79 Bug 1328832 - Part 2: Rename mozFlushType to mozilla::FlushType and make it an enum class. r=bzbarsky
MozReview-Commit-ID: D3fIngSHSsl
2017-01-05 15:31:56 +08:00
Edgar Chen
0a3392a555 Bug 1317901 - Ensure image loads don't short-circuit if element's adopting steps are run; r=jdm
MozReview-Commit-ID: Cbg3EHtyL8f
2016-11-18 15:54:21 +08:00
Boris Zbarsky
ab063f5422 Bug 1318576. Remove entries from a form's past names map when an element is removed from the form, even if that element doesn't have a name or id anymore. r=baku 2016-11-21 12:34:02 -05:00
Stone Shih
b921261b1b Bug 1305458 Part1: Rename nsIDOMEventTarget::PreHandleEvent to nsIDOMEventTarget::GetEventTargetParent. r=smaug
MozReview-Commit-ID: FM3vDUyLOCb
2016-10-21 10:11:07 +08:00
Edgar Chen
f1406505a9 Bug 1308069 - Clear pending error event fired by src="" case if src changed before it fired. r=bz
MozReview-Commit-ID: B8f975mZNN9
2016-10-06 12:30:35 +08:00
Josh Matthews
98f135d622 Bug 1307185 - Ensure image loads don't short-circuit if the element changed trees since the last load. r=echen 2016-10-04 13:50:33 -04:00
Edgar Chen
109b9de59f Bug 1306007 - Part 2: Drop the unused arguments of TryCreateResponsiveSelector(); r=jdm
MozReview-Commit-ID: ALvLYaBhP7W
2016-04-16 16:50:02 -04:00
Edgar Chen
eaabbe4dea Bug 1306007 - Part 1: Remove srcset/picture feature control preference; r=jdm,smaug
MozReview-Commit-ID: BsyTHeqiGZL
2016-04-16 18:07:56 -04:00
Josh Matthews
6c12d8cdb2 Bug 1268182 - Allow image loads to short-circuit after selecting a source if the new source URL matches the previous one URL. r=echen 2016-09-26 14:17:38 -04:00
Nicholas Nethercote
1f65390cc9 Bug 1293603 (part 2) - Make Run() declarations consistent. r=erahm.
This patch makes most Run() declarations in subclasses of nsIRunnable have the
same form: |NS_IMETHOD Run() override|.

As a result of these changes, I had to add |override| to a couple of other
functions to satisfy clang's -Winconsistent-missing-override warning.
2016-08-08 12:18:10 +10:00
Jeremy Chen
7f7e952b2b Bug 906116 - part3.3: Replace NS_STYLE_HINT_FRAMECHANGE with nsChangeHint_ReconstructFrame. r=dbaron
Use ReconstructFrame to replace NS_STYLE_HINT_FRAMECHANGE in many places, such
as HTML*Element::GetAttributeChangeHint and HTMLFrameSetElement::SetAttr.

MozReview-Commit-ID: EHbc4RMeuu0
2016-07-06 13:06:14 +08:00
Carsten "Tomcat" Book
de5949e087 Backed out changeset 8c1f9996a7d6 (bug 906116) 2016-07-06 05:40:06 +02:00
Jeremy Chen
7d67fc920f Bug 906116 - part3.3: Replace NS_STYLE_HINT_FRAMECHANGE with nsChangeHint_ReconstructFrame. r=dbaron
Use ReconstructFrame to replace NS_STYLE_HINT_FRAMECHANGE in many places, such
as HTML*Element::GetAttributeChangeHint and HTMLFrameSetElement::SetAttr.

MozReview-Commit-ID: EHbc4RMeuu0
2016-07-06 09:59:56 +08:00
Stone Shih
9d8370d252 Bug 1260704 - Instead of handling mouse up event, we handle mouse click event to trigger links. r=smaug 2016-05-16 15:45:43 +08:00
Thomas Nguyen
95d5e9b396 Bug 1223838 - Fix wrong policy associated with empty string. r=fkiefer,hsivonen
MozReview-Commit-ID: 7kFH39cegmH
2016-05-30 15:17:45 +08:00
Jeremy Chen
e18b390d40 Bug 1273766 - part3: purge NS_UpdateHint inline. r=heycam
MozReview-Commit-ID: IIOT9jq8hOl
2016-05-23 11:26:03 +08:00
Boris Zbarsky
da1b7b9d44 Bug 909633. Remove the HTML Microdata API, since no one else ended up implementing it and now it's been removed from the spec. r=bkelly,jgraham 2016-05-20 23:13:17 -04:00
Thomas Nguyen
4ed2def6a9 Bug 1261298 - W3C referrer policy attribute is not passed to image. r=jdm
MozReview-Commit-ID: 3S642wheFu1
2016-05-11 09:38:05 +08:00
Edgar Chen
8cf4fa9947 Bug 1264467 - Force a reload only when crossOrigin's state is really changed. r=jdm
MozReview-Commit-ID: F0wvy4TkPiQ
2016-04-14 18:53:44 -04:00
Aryeh Gregor
065ff1dee3 Bug 881000 - Reflect img.lowsrc as a URL, not string; r=bz 2016-05-05 21:29:54 +03:00
Kyle Huey
b972c94d0f Bug 1268313: Part 7 - Move NS_NewRunnableMethod and friends to mozilla::NewRunnableMethod. r=froydnj 2016-05-05 01:45:00 -07:00