Commit Graph

647 Commits

Author SHA1 Message Date
Emilio Cobos Álvarez
47b44daec3 Bug 1477965: Fix SVGAnimationElement::AfterSetAttr. r=heycam
It's not fine to only check if we're in a document in one of the code
paths.

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

MozReview-Commit-ID: JXLexono4kv
2018-07-26 14:47:42 +02:00
Boris Zbarsky
1914ffc8ec Bug 1450167. Stop using atom-or-string for event names in the listener manager. r=smaug
Now that we support atoms off the the main thread, we can just use atoms.
2018-07-24 18:15:19 -04:00
Emilio Cobos Álvarez
65c23592eb Bug 1477853: Don't assume that SVGAnimationElement has a parent on bind. r=heycam
We were passing aParent instead of this to the ID tracker.

This was unnecessary, since the document is definitely setup by this time, but
it was also assuming we had a parent which is not true.

Also it was claiming stuff about it only being used to get the composed doc,
which is false since bug 1163105.

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

MozReview-Commit-ID: L6Vpl44QjGG
2018-07-24 12:36:45 +02:00
Robert Longson
da1ac338dc Bug 1474284 - cope with degenerate bezier curves r=baz 2018-07-23 18:36:09 +01:00
Emilio Cobos Álvarez
68f214df2a Bug 1450250: Make svg:use use an actual shadow tree. r=heycam
Summary:
This fixes a couple fuzz bugs and prevents special-casing <svg:use> even more in
bug 1431255.

Unfortunately not as many hacks went away as I'd have hoped, since we still need
to match document rules, see the linked SVGWG issues.

But blocks_ancestor_combinators goes away, which is nice since it's on a very
hot path.

Test Plan: WPT for style invalidation, covered by existing tests otherwise.

Reviewers: heycam

Tags: #secure-revision

Bug #: 1450250

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

MozReview-Commit-ID: C4mthjoSNFh
2018-07-20 14:44:51 +02:00
Emilio Cobos Álvarez
a01c54ae7a Bug 1450250: Preserve the behavior of GetOuterSVGElement so that it works for <animate>. r=heycam
It's used by SVGAnimationElement, and otherwise it can't find the root element
if it's under a <use> element.

It also feels like the right thing to do, and didn't break any XBL+svg tests
(though we may as well get rid of those at this point).

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

MozReview-Commit-ID: Jx1JrTld8EL
2018-07-20 14:44:49 +02:00
Emilio Cobos Álvarez
8eaddfbb80 Bug 1450250: Make <animate> target the light DOM parent, not the flattened tree parent. r=heycam
This matches Chrome:

  https://cs.chromium.org/chromium/src/third_party/blink/renderer/core/svg/animation/svg_smil_element.cc?l=260&rcl=325eafc631f396944801f17675a7092b216d60ca

And we rely on that to animate <use> with SMIL, like:

<use href="#foo">
  <animate ...>
</use>

There, the flattened tree parent of the <animate> element is null, because <use>
is a shadow root without slots.

Similarly we need to skip the GetCtx check which seems unneeded, and also is not
correct since <animate> can animate when it's out of the flattened tree.

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

MozReview-Commit-ID: 13hRCOj500n
2018-07-20 14:44:48 +02:00
Emilio Cobos Álvarez
add2e33db0 Bug 1450250: SMIL document-related fixes. r=heycam
This is a prerequisite to make some SMIL-in-use tests pass.

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

MozReview-Commit-ID: 8fM0fb9dayd
2018-07-20 14:44:47 +02:00
Ting-Yu Lin
5f1b665033 Bug 1286882 - Make SVG basic shape elements unselectable. r=dholbert
Differential Revision: https://phabricator.services.mozilla.com/D2038

--HG--
extra : moz-landing-system : lando
2018-07-13 18:01:48 +00:00
Andrea Marchesini
14d462eeb3 Bug 1418246 - Return valid columnNumber value in CSP violation events, r=ckerschb 2018-07-05 08:21:04 +02:00
Robert Longson
e3d84c3b6a Bug 1456004 - Set angle unit type in setOrientToAngle and to UNKNOWN when setting orient to auto or auto-start-reverse r=heycam 2018-07-01 16:12:14 +01:00
Robert Longson
f33096f4f1 Bug 1455854 - Throw a TypeError rather than a SyntaxError for enum out of range. r=heycam 2018-06-30 18:41:37 +01:00
Jeff Gilbert
5b753da289 Bug 1470325 - s/FooBinding/Foo_Binding/g - r=qdot
MozReview-Commit-ID: JtTcLL5OPF0
2018-06-26 17:05:01 -07:00
Chris Peterson
2afd829d0f Bug 1469769 - Part 6: Replace non-failing NS_NOTREACHED with MOZ_ASSERT_UNREACHABLE. r=froydnj
This patch is an automatic replacement of s/NS_NOTREACHED/MOZ_ASSERT_UNREACHABLE/. Reindenting long lines and whitespace fixups follow in patch 6b.

MozReview-Commit-ID: 5UQVHElSpCr

--HG--
extra : rebase_source : 4c1b2fc32b269342f07639266b64941e2270e9c4
extra : source : 907543f6eae716f23a6de52b1ffb1c82908d158a
2018-06-17 22:43:11 -07:00
Emilio Cobos Álvarez
711587f9ff Bug 1469176: Load svg.css upfront. r=jwatt
Test Plan: Covered by existing tests.

Reviewers: jwatt

Reviewed By: jwatt

Bug #: 1469176

Differential Revision: https://phabricator.services.mozilla.com/D1762
2018-06-22 12:48:40 +02:00
Emilio Cobos Álvarez
bd7c1e4e8c Bug 1468133: Remove the optimization to lazily load non-SVG styles since it's not relevant anymore. r=heycam
This was a memory-saving optimization introduced as part of dependencies for bug
686875, but a more general system landed in bug 77999 for Gecko and
https://github.com/servo/servo/pull/18509 for Servo.

So now it's probably even a bit of a pessimization (though probably not huge),
and given this causes bugs like bug 1462742, bug 1157592, and bug 1468145, and
fishiness like the one pointed out in this bug, we may as well remove it.

The performance impact of having to lookup through more rules should be minimal
given the bloom filter and the rule hash optimizations.

This makes me wonder whether we could remove the whole concept of on-demand UA
sheets, since they've caused pain, for example, when the frontend people try
loading <svg>s from NAC (since that triggers sheet loading from frame
construction, which is not good). I'm not concerned about loading mathml.css and
svg.css everywhere, though xul.css may not be as doable since it adds a bunch of
attribute-dependent selectors. Though on the other hand I asserted in the
xul.css code and we don't load it in content with <video> / <input
type="date/time/etc"> and such, afaict, so maybe now that legacy addons are gone
we can remove that sheet from content processes altogether.

MozReview-Commit-ID: 9JCWNZj6BkT
2018-06-22 03:42:46 +02:00
catalin.badea392@gmail.com
9c36800bd7 Bug 1469385 - Remove InsertChildAt_Deprecated and RemoveChildAt_Deprecated, r=bz,smaug 2018-06-19 12:21:18 +03:00
Andi-Bogdan Postelnicu
09ec36a025 Bug 1453795 - SVG - Initialize member fields in classes/ structures. r=jwatt
--HG--
extra : rebase_source : 244f0513af145c53fbc0177d2652cf68e20b64af
2018-06-16 13:54:44 +03:00
Emilio Cobos Álvarez
59c5af3d20 Bug 1157592: Make InsertAnonymousContent load all the relevant stylesheets in SVG documents. r=bz
The underlying issue here is that the rule that makes the custom content
container abspos is in ua.css, and we don't load that for SVG documents.

Similarly, this fixes all the markers and such, that would be inline because of
the lack of html.css etc.

This fixes the root cause of bug 1462742, as well, so I added a few assertions
that should replace the wallpaper there. The reason we're guaranteed to be oof
is because top-layer implies that via StyleAdjuster::adjust_for_top_layer.

As an aside, the fact that AccessibleCaret calls into InsertAnonymousContent
from frame construction makes me extremely nervous, but it already does all sort
of other pretty nasty stuff... I'll file and fix.

MozReview-Commit-ID: 7ofKNGR8E20
2018-06-16 03:34:14 -07:00
Olli Pettay
5dad9cd69b Bug 1467790 - Inline nsINode::IsEditable, r=masayuki 2018-06-08 15:57:13 -04:00
Emilio Cobos Álvarez
0fbd75e65f Bug 1466963: Provide a before-mutation closure to C++. r=xidorn,smaug
MozReview-Commit-ID: H2jwIeZoiBZ
2018-06-07 11:22:31 +02:00
Emilio Cobos Álvarez
fffb25b74f Bug 1465585: Switch from mozilla::Move to std::move. r=froydnj
This was done automatically replacing:

  s/mozilla::Move/std::move/
  s/ Move(/ std::move(/
  s/(Move(/(std::move(/

Removing the 'using mozilla::Move;' lines.

And then with a few manual fixups, see the bug for the split series..

MozReview-Commit-ID: Jxze3adipUh
2018-06-01 10:45:27 +02:00
Nazım Can Altınova
361380987c Bug 1464496 - Part 1: Merge ServoDeclarationBlock and DeclarationBlock r=emilio
MozReview-Commit-ID: By9fV70Oq0K

--HG--
extra : rebase_source : 837afe9c33b21d7db41ff19d3aaf6cf3e9eedbdf
2018-05-30 18:15:25 +02:00
Andreea Pavel
38bcf897f1 Merge mozilla-inbound to mozilla-central. a=merge 2018-05-31 13:04:21 +03:00
Emilio Cobos Álvarez
fe09ffd3af Bug 1465478: Introduce Element::FromNode. r=smaug
And use it in a couple places I noticed.

MozReview-Commit-ID: 8baSMrbdEbF
2018-05-31 02:46:10 +02:00
Dan Glastonbury
68881da7dd Bug 1457353 - P1: Change nscolor to StyleComplexColor. r=xidorn
Change mStopColor, mFloodColor, and mLightingColor in nsStyleSVGReset.

MozReview-Commit-ID: KMRMtHk1jNK

--HG--
extra : rebase_source : c0c12fa811d17ab6fe0a5ceb31ff32ec585314e0
2018-04-27 12:07:20 +10:00
Boris Zbarsky
cb08b0de7d Bug 1455676 part 21. Remove nsIDOMNode. r=qdot 2018-05-29 22:58:51 -04:00
Boris Zbarsky
115f652b0b Bug 1455676 part 20. Remove now-unused AsDOMNode methods. r=qdot 2018-05-29 22:58:50 -04:00
Boris Zbarsky
bea3100e53 Bug 1455676 part 14. Remove most use of nsIDOMNode in dom/. r=qdot 2018-05-29 22:58:49 -04:00
Kris Maglione
8340513b0c Bug 1463287: Add QueryInterface helper macro for concrete class types. r=bz
Using concrete class types with static IIDs in QueryInterface methods is a
pretty common pattern which isn't supported by any existing helper macros.
That's lead to separate ad-hoc implementations, with varying degrees of
dodginess, being scattered around the tree.

This patch adds a helper macro with a canonical (and safe) implementation, and
updates existing ad-hoc users to use it.

MozReview-Commit-ID: HaTGF7MN5Cv

--HG--
extra : rebase_source : ace930129d85960d22bc3048ca3bb19bbbd4a63e
extra : histedit_source : 03a87f746d957789d41381e4e1bfcc4fd7eebaf2%2C9c5bae9feeeef7721105db67be0f83e0ded66bb7
2018-05-21 16:33:18 -07:00
Emilio Cobos Álvarez
11794a944d Bug 1461701: Remove nsUpdateType and UPDATE_CONTENT_MODEL. r=smaug
MozReview-Commit-ID: 33iBMZqnkAc
2018-05-15 18:47:16 +02:00
Emilio Cobos Álvarez
cb56e2c9f3 Bug 1459529: Remove UPDATE_STYLE. r=heycam
Now that BeginUpdate is useless for the UPDATE_STYLE case, we don't need the
update mechanism at all. Just ensure that ApplicableStylesChanged is called on
the pres shell via the relevant RuleChanged, etc. notifications.

There's a big hidden gotcha here. nsIDocument::BeginUpdate does put a script
blocker on the stack for these updates. However it's not needed, since no script
can run during these notifications (only the stylesheet events we post for
devtools, but those use AsyncEventDispatcher and PostDOMEvents, so they don't
try to run immediately).

nsIDocument::BeginUpdate also does XBL binding attached queue stuff, but we
can't change bindings during these notifications anyway, so it also doesn't
matter.

MozReview-Commit-ID: HJvK6zQfloh
2018-05-15 18:44:29 +02:00
Emilio Cobos Álvarez
17a92ff99b Bug 1459844: Share more code and fix some inconsistencies between html / svg style elements. r=heycam
MozReview-Commit-ID: IkTrIfJI1iK
2018-05-10 00:21:27 +02:00
Emilio Cobos Álvarez
9509853a38 Bug 1459498: Rename nsIStyleSheetLinkingElement::StyleSheetInfo to SheetInfo. r=heycam
MozReview-Commit-ID: FeOmISAxWBk
2018-05-08 10:07:46 +02:00
Emilio Cobos Álvarez
96600d2b9a Bug 1459498: Use a different enum to differentiate IsAlternate from HasAlternateRel. r=heycam
MozReview-Commit-ID: 6pwR8t6fzSD
2018-05-08 10:07:42 +02:00
Emilio Cobos Álvarez
5b6f2bdee0 Bug 1459498: Refactor nsStyleLinkElement so that all the stylesheet information comes from one place. r=heycam
I've kept the nsAutoStrings in the StyleSheetInfo class on the hopes that the
compiler does RVO, but if it doesn't I can remove I guess.

MozReview-Commit-ID: 2vN6BSEhYcw
2018-05-08 10:07:41 +02:00
Chris Peterson
71422dcaa9 Bug 1457813 - Part 2: Replace non-asserting NS_PRECONDITIONs with MOZ_ASSERTs. r=froydnj
s/NS_PRECONDITION/MOZ_ASSERT/ and reindent

MozReview-Commit-ID: KuUsnVe2h8L

--HG--
extra : source : c14655ab3df2c9b1465dd8102b9d25683359a37b
2018-04-28 12:50:58 -07:00
Robert Longson
dac58f515c Backout Bug 149075 - While it is compatible with the SVG specification, all other browsers allow it 2018-04-28 16:09:38 +01:00
Robert Longson
e8cda31517 Bug 1457351 - color attribute should apply to filters. r=heycam 2018-04-27 07:35:43 +01:00
Boris Zbarsky
1cbc813260 Bug 1455674 part 20. Get rid of nsIDOMElement. r=qdot 2018-04-26 23:37:34 -04:00
Emilio Cobos Álvarez
0faef276ec Bug 1455885: Make the SVG context paint not use a node property, but a member in SVGDocument. r=jwatt
MozReview-Commit-ID: H6SRTsDL5Rh
2018-04-26 17:07:39 +02:00
Emilio Cobos Álvarez
a1b2e5070a Bug 1455885: Inline and make document casts fatally assert. r=bz
For consistency with AsElement / AsContent / AsDocumentFragment, etc.

MozReview-Commit-ID: 8GSj8R9hLBe
2018-04-26 17:05:12 +02:00
Emilio Cobos Álvarez
a00f507b72 Bug 1456435: Make UpdateStyleSheet less bool-happy. r=heycam
MozReview-Commit-ID: FlTD390lMhg
2018-04-26 16:43:52 +02:00
Robert Longson
b0d2ba05a0 Bug 1455763 - Remove SVGViewElement.viewTarget r=heycam r=mystor 2018-04-25 22:44:31 +01:00
Emilio Cobos Álvarez
f8233b4454 Bug 1456471: Remove nsCSSParser.h. r=xidorn
MozReview-Commit-ID: 4qa7llzCXeR
2018-04-25 10:38:37 +02:00
Robert Longson
83c5aceb17 Bug 1455940 - Remove constructors from SVGNumber r=mystor 2018-04-25 07:00:36 +01:00
Margareta Eliza Balazs
fa0ffa186e Merge mozilla-central to autoland. a=merge CLOSED TREE
--HG--
rename : toolkit/mozapps/extensions/internal/XPIProviderUtils.js => toolkit/mozapps/extensions/internal/XPIDatabase.jsm
2018-04-24 14:51:28 +03:00
Robert Longson
34d8c86389 Bug 1455986 - If we cannot parse an enum, set its numeric value to UNKNOWN i.e. 0 r=heycam 2018-04-24 01:42:41 +01:00
Emilio Cobos Álvarez
d2ac5c8400 Bug 1421807: Adjust test expectations for test that no longer asserts. r=me
MozReview-Commit-ID: BCAReWLoZCx
2018-04-24 10:20:37 +02:00
Cameron McCormack
8e2992c3d7 Bug 1133172 - Remove SVGSVGElement.{pixel,screenPixel}UnitToMillimeter{X,Y}. r=longonsr,bz
MozReview-Commit-ID: KKy0J8oQYJj

--HG--
extra : rebase_source : 615b8b0b910344219490c0a5558c67777ecbe521
2018-04-19 17:21:00 +03:00