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

68 Коммитов

Автор SHA1 Сообщение Дата
Tiberius Oros aff5d4ad5d Merge inbound to mozilla-central. a=merge 2018-08-09 13:02:05 +03:00
Emilio Cobos Álvarez 1fbd784d00 Bug 1481601 - Remove now-useless aPreallocateChildren from nsINode::Clone() and friends. r=bzbarsky
Since sed on multiple lines ended up being such a pain and I didn't end up
writing a script for this because I didn't think it'd end up being so boring, I
may have made a couple cleanups here and there as well...

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

--HG--
extra : moz-landing-system : lando
2018-08-08 23:58:44 +00:00
Andrew Osmond 51d273388c Bug 1416328 - Part 2. Expose decoding attribute for img elements. r=bz,tnikkel
This adds support for HTMLImageElement's decoding attribute, as
described by:

https://github.com/whatwg/html/pull/3221
https://whatpr.org/html/3221/images.html#decoding-images

It also exposes the same attribute on SVGImageElement, just as Blink has
chosen to do so.
2018-08-08 07:56:01 -04:00
Emilio Cobos Álvarez 8f34c12e14 Bug 1479860: Remove unused aCompileEventHandlers argument from BindToTree. r=bz
Mostly automatic via sed. Only parts which I touched manually (apart from a
couple ones where I fixed indentation or which had mispelled arguments) are the
callers. I may have removed a couple redundant `virtual` keywords as well when
I started to do it manually, I can revert those if wanted.

Most of them are just removing the argument, but in Element.cpp I also added an
assertion for GetBindingParent when binding the ShadowRoot's kids (the binding
parent is set from the ShadowRoot constructor, and I don't think we bind a
shadow tree during unlink or what not which could cause a behavior difference).

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

MozReview-Commit-ID: 2oIgatty2HU
2018-08-01 10:42:54 +02:00
Emilio Cobos Álvarez 47ebd819b3 Bug 1449806: Merge {Servo,Generic}SpecifiedValues into MappedDeclarations. r=xidorn
The idea would be that this header is only included in cpp files, thus it's ok
to include ServoBindings, etc.

MozReview-Commit-ID: EgQEsR0cZd4
2018-06-25 11:14:39 +02:00
Emilio Cobos Álvarez f09824aad6 Bug 1149357: Properly update responsive images for density changes. r=dholbert
Before that we were not notifying the image frame in any way if we ended up not
doing a load, and we were instead relying on the reflow the viewport resize
caused to get the new density in ComputeSize from the content node (but nowhere
else, since that's the bug part 1 fixes).

This was generally unsound, since you can stash random media in a sizes=
attribute, which don't necessarily needs to cause a reflow.

Now we need to notify necessarily because nsImageFrame stores the adjusted
intrinsic size.

mCurrentDensity could also get out of sync as well, when the selected image
density changed, but we ended up returning early because our source hadn't
change in the first early exit.

This patch moves us to a model where we don't re-trigger loads for density
changes if the source doesn't change (unless we pass aAlwaysLoad when we need
to, per spec).

This matches our previous behavior (without the bugginess of not updating the
intrinsic size), and also Chromium, at least.

This changes behavior in one case, which is when we don't load the same source
node, but we have the same source URL, and the density does change. This could
happen with <picture> and two <source>s with same source and different media and
sizes. This makes our behavior consistent with the behavior we have when both
the source and the density doesn't change.

Blink and WebKit do trigger a second image load both when the source changes
without changing density and when density changes. I'll file a spec issue, since
per:

  https://html.spec.whatwg.org/#reacting-to-environment-changes

We should be triggering the load when the density changes but the source
doesn't as well, but no UA does that.

I filed https://github.com/whatwg/html/issues/3709 with a little summary of the
situation and what I think the behavior should be (which is what this patch
implements). That being said, I'll update the impl if the spec people think
otherwise :).

MozReview-Commit-ID: Eqy16ygHRLo
2018-05-25 12:09:30 +02:00
Emilio Cobos Álvarez 5d4df42dc7 Bug 1149357: Make nsImageFrame::mIntrinsicSize account for density. r=dholbert
Only doing it in ComputeSize (via GetNaturalSize) is unsound, and the rest of
the users of mIntrinsicSize definitely do need scaling accounted for.

Move the adjustment to nsImageFrame for two reasons:

 * Prevents adding more dependencies from nsIImageLoadingContent, which
   otherwise would need to go away anyway in bug 215083.

 * Avoids having to duplicate the image orientation logic, since mImage is
   already an OrientedImage if needed.

MozReview-Commit-ID: EA0n0TctZhN
2018-05-25 12:09:23 +02:00
Boris Zbarsky 14f26fccf6 Bug 1449631 part 8. Remove nsIDOMEventTarget::GetEventTargetParent. r=smaug
MozReview-Commit-ID: 5wQ2LYrjUxf
2018-04-05 13:42:41 -04:00
Boris Zbarsky 258352c8a8 Bug 1447098 part 2. Rename the NS_IMPL_FROMCONTENT macros to NS_IMPL_FROMNODE. r=mystor 2018-03-21 17:39:04 -04:00
Adrian Wielgosik 43a3ada8a9 Bug 1418077 - Remove nsIDOMHTMLFormElement. r=bz
MozReview-Commit-ID: 9eQxvfIMB22

--HG--
extra : rebase_source : f75e043da542b567e31d15db25791c738b275a09
2018-03-14 21:42:25 +01:00
Emilio Cobos Álvarez c8eb630ebe Bug 1423990: Move the last few attribute-related methods outside of nsIContent. r=bz
MozReview-Commit-ID: 8JZuS6O8f8W
2017-12-25 17:50:10 +01:00
Emilio Cobos Álvarez ffdf5d2cb5 Backout changeset e43f568b3e9a (bug 1423990) because some OSX-only code still doesn't build. r=me 2017-12-25 12:55:45 +01:00
Emilio Cobos Álvarez c0959b2955 Bug 1423990: Move the last few attribute-related methods outside of nsIContent. r=bz
MozReview-Commit-ID: 8JZuS6O8f8W

--HG--
extra : rebase_source : 09b82acb4f3d69e8a4345457ab217443bc28d6e2
2017-12-07 19:13:50 +01:00
Boris Zbarsky 04324f18ad Bug 1424474 part 3. Make sure that we only pass non-system subject principals to setters/methods that later use that principal for loading security checks. r=kmag
MozReview-Commit-ID: IjUEG5xwn5
2017-12-20 17:43:18 -05:00
Narcis Beleuzu edb8ba34eb Backed out 2 changesets (bug 1424474) for mochitest failures on test_bug494328.html r=backout on a CLOSED TREE
Backed out changeset 39d5991f02ba (bug 1424474)
Backed out changeset da3dec2fce06 (bug 1424474)
2017-12-21 02:55:27 +02:00
Boris Zbarsky a2696c3c8a Bug 1424474 part 2. Make sure that we only pass non-system subject principals to setters/methods that later use that principal for loading security checks. r=kmag 2017-12-20 17:43:18 -05:00
Boris Zbarsky 887ce3941a Bug 1419270 part 2. Use getter or setter specific NeedsSubjectPrincipal annotations more. r=qdot
MozReview-Commit-ID: KBwjFh3TMUg
2017-12-05 16:03:18 -05:00
Boris Zbarsky 77d6a0dd53 Bug 1418558 part 4. Add MOZ_CAN_RUN_SCRIPT annotations to nsGenericHTMLElement methods that can call GetPrimaryFrame. r=mystor
MozReview-Commit-ID: HxFFC85qgOD
2017-12-05 11:18:16 -05:00
Boris Zbarsky eefe007914 Bug 1418558 part 2. Add MOZ_CAN_RUN_SCRIPT annotations to HTMLImageElement methods that call GetPrimaryFrame. r=mystor
MozReview-Commit-ID: GxcrOxjTYDm
2017-12-05 11:18:16 -05:00
Kris Maglione 1c66345e09 Bug 1415352: Part 1a - Pass subject principal through to ParseAttribute. r=bz
This is necessary in order to parse style attributes using the subject
principal of the caller, rather than defaulting to the page principal.

MozReview-Commit-ID: GIshajQ28la

--HG--
extra : rebase_source : 5dba46f61d70ec647cae16383b62961ac72d2f47
2017-11-01 20:35:52 -07:00
Andrew Osmond 95ee2e55dc Bug 1404422 - Part 4. Remove imgIOnloadBlocker and related from tree as redundant. r=tnikkel 2017-11-01 06:59:10 -04:00
Kyle Machulis 1cc8b01353 Bug 1406224 - Remove nsIDOMHTMLImageElement; r=bz
MozReview-Commit-ID: GCATWRt6qMo

--HG--
extra : rebase_source : 29854f1374c6ad318da0b5b68be23507667c3be4
2017-10-06 13:27:23 -07:00
Boris Zbarsky 01a7f72b91 Bug 1407334. Add some overloads for src/href getters that don't need a principal, for Thunderbird to use. r=kmag
MozReview-Commit-ID: 23iOeNDMXNk
2017-10-10 15:04:19 -04:00
Kris Maglione d038453393 Bug 1406278: Part 2c - Use subject principal as triggering principal in <img> "srcset" attribute. r=bz
MozReview-Commit-ID: 784EsgwBcS1

--HG--
extra : rebase_source : 01b701f84c425786b66cd9787d4e570dd9341ae5
2017-10-02 21:30:34 -07:00
Kris Maglione d72aa193c4 Bug 1406278: Part 2b - Use subject principal as triggering principal in <img> "src" attribute. r=bz
MozReview-Commit-ID: DrblTjP99WJ

--HG--
extra : rebase_source : 649cf6757266c9e08a3f5a621c3e9451a7ccef67
2017-10-02 20:28:32 -07:00
Kris Maglione 4275cd1039 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

--HG--
extra : rebase_source : 25e438c243700a9368c393e40e3a6002d968d6c8
2017-10-09 14:33:38 -07:00
Nicholas Nethercote d225f7151b 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

--HG--
rename : xpcom/ds/nsIAtom.h => xpcom/ds/nsAtom.h
extra : rebase_source : ac3e904a21b8b48e74534fff964f1623ee937c67
2017-10-03 09:05:19 +11:00
Boris Zbarsky 4da062bf6f Bug 1380413 part 1. Remove unused nsIDOMHTMLImageElement bits. r=mccr8 2017-07-13 23:45:56 -04: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
Edgar Chen 77428c0a83 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
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
Kirk Steuber 7fdb378650 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

--HG--
extra : rebase_source : 9c3deec6d7aafd6411044d623d4863637b45fd58
2017-04-20 12:57:48 -07:00
Boris Zbarsky 2c3a8eee0b Bug 1347639. Add nsImageLoadingContent::AsContent to make getting the relevant nsIContent* faster. r=qdot
MozReview-Commit-ID: 9sE3pbHwYbV
2017-03-16 17:43:34 -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
Manish Goregaokar 7a6a00898d 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 48bc1c741c Bug 1334330 - Part 1: stylo: Abstractify nsMappedAttributes to work on arbitrary containers of specified value data; r=bz,emilio
MozReview-Commit-ID: BSM4TC9RKot

--HG--
extra : rebase_source : 5f2c5d998b9e2bc10a2c9ce8d0b3ce90817a0d39
2017-01-26 13:39:13 -08:00
Edgar Chen e0c91d38b6 Bug 1317901 - Ensure image loads don't short-circuit if element's adopting steps are run; r=jdm
MozReview-Commit-ID: Cbg3EHtyL8f

--HG--
rename : dom/html/reftests/image-load-shortcircuit.html => dom/html/reftests/image-load-shortcircuit-1.html
extra : rebase_source : 1c11f394ca4dd8f354eb38b1ff5c6eb165b9d899
2016-11-18 15:54:21 +08:00
Stone Shih 1ed10ff082 Bug 1305458 Part1: Rename nsIDOMEventTarget::PreHandleEvent to nsIDOMEventTarget::GetEventTargetParent. r=smaug
MozReview-Commit-ID: FM3vDUyLOCb

--HG--
extra : rebase_source : 5a513af84718a6d591f77437a0704984c8fc2b67
2016-10-21 10:11:07 +08:00
Edgar Chen 64cc70e197 Bug 1308069 - Clear pending error event fired by src="" case if src changed before it fired. r=bz
MozReview-Commit-ID: B8f975mZNN9

--HG--
extra : rebase_source : b44b969c733160a9e96139b6b55ac60fb140e478
2016-10-06 12:30:35 +08:00
Edgar Chen 2f25a9bdd5 Bug 1306007 - Part 2: Drop the unused arguments of TryCreateResponsiveSelector(); r=jdm
MozReview-Commit-ID: ALvLYaBhP7W

--HG--
extra : rebase_source : 39ab7b977393fb8a0238fbdba31f056f48de24ea
2016-04-16 16:50:02 -04:00
Edgar Chen cf7304c3c6 Bug 1306007 - Part 1: Remove srcset/picture feature control preference; r=jdm,smaug
MozReview-Commit-ID: BsyTHeqiGZL

--HG--
extra : rebase_source : 2add2510dbe16c641fe997a8349c1a36009bec20
2016-04-16 18:07:56 -04:00
Josh Matthews 746c91d87a Bug 1268182 - Allow image loads to short-circuit after selecting a source if the new source URL matches the previous one URL. r=echen
--HG--
extra : rebase_source : 0549f97a654bb1d4983aac0e93e30f1a1fc5864e
2016-09-26 14:17:38 -04:00
Boris Zbarsky 2b85094faf 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
Aryeh Gregor 9aba692542 Bug 1270499 - Setting reflected unsigned long to out-of-range value should set to default; r=bz
This changes to match the spec, which also aligns the behavior of get
and set (get already maps out-of-range values to the default value).
There is currently no interoperable behavior here, but this aligns us
with IE -- tested in 11, hopefully true for Edge too.

On the way, I also fixed the fact that video's height and width were
being treated as signed.
2016-05-05 21:29:54 +03:00
Thomas Nguyen 3f10b1a2de Bug 1260664 - W3C Reflect referrerPolicy as a limited enumerated attribute. r=franziskuskiefer . r=smaug
MozReview-Commit-ID: Dppj4iuZnFp
2016-04-18 18:35:47 +08:00
Josh Matthews d43f85cd2a Bug 1259482 - Ensure that image loads are never dropped on the floor when queued for later. r=johns 2016-03-30 12:39:59 -04:00
Franziskus Kiefer 6bf24410e1 Bug 1187357 - rename referrer attribute to referrerpolicy. r=hsivonen 2015-11-30 16:13:03 -08:00
Michael Layzell a6ede50962 Bug 1166138 - Make img srcset react to resize/viewport changes, r=jdm 2015-11-12 09:39:23 -05:00
Nathan Froyd 01583602a9 Bug 1207245 - part 6 - rename nsRefPtr<T> to RefPtr<T>; r=ehsan; a=Tomcat
The bulk of this commit was generated with a script, executed at the top
level of a typical source code checkout.  The only non-machine-generated
part was modifying MFBT's moz.build to reflect the new naming.

CLOSED TREE makes big refactorings like this a piece of cake.

 # The main substitution.
find . -name '*.cpp' -o -name '*.cc' -o -name '*.h' -o -name '*.mm' -o -name '*.idl'| \
    xargs perl -p -i -e '
 s/nsRefPtr\.h/RefPtr\.h/g; # handle includes
 s/nsRefPtr ?</RefPtr</g;   # handle declarations and variables
'

 # Handle a special friend declaration in gfx/layers/AtomicRefCountedWithFinalize.h.
perl -p -i -e 's/::nsRefPtr;/::RefPtr;/' gfx/layers/AtomicRefCountedWithFinalize.h

 # Handle nsRefPtr.h itself, a couple places that define constructors
 # from nsRefPtr, and code generators specially.  We do this here, rather
 # than indiscriminantly s/nsRefPtr/RefPtr/, because that would rename
 # things like nsRefPtrHashtable.
perl -p -i -e 's/nsRefPtr/RefPtr/g' \
     mfbt/nsRefPtr.h \
     xpcom/glue/nsCOMPtr.h \
     xpcom/base/OwningNonNull.h \
     ipc/ipdl/ipdl/lower.py \
     ipc/ipdl/ipdl/builtin.py \
     dom/bindings/Codegen.py \
     python/lldbutils/lldbutils/utils.py

 # In our indiscriminate substitution above, we renamed
 # nsRefPtrGetterAddRefs, the class behind getter_AddRefs.  Fix that up.
find . -name '*.cpp' -o -name '*.h' -o -name '*.idl' | \
    xargs perl -p -i -e 's/nsRefPtrGetterAddRefs/RefPtrGetterAddRefs/g'

if [ -d .git ]; then
    git mv mfbt/nsRefPtr.h mfbt/RefPtr.h
else
    hg mv mfbt/nsRefPtr.h mfbt/RefPtr.h
fi

--HG--
rename : mfbt/nsRefPtr.h => mfbt/RefPtr.h
2015-10-18 01:24:48 -04:00