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

69 Коммитов

Автор SHA1 Сообщение Дата
jeffin143 aa897e8496 Bug 1597881 : convert NS_STYLE_STROKE_LINECAP_* to an enum class in nsStyleConsts.h r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D53908

--HG--
extra : moz-landing-system : lando
2019-11-21 06:07:30 +00:00
Boris Zbarsky d5a8a4a595 Bug 1557793 part 3. Change the signatures of various nsContentUtils localization methods to play nicer with the new stringbundle API. r=smaug
Differential Revision: https://phabricator.services.mozilla.com/D34201

--HG--
extra : moz-landing-system : lando
2019-06-08 21:26:12 +00:00
violet a524e7ef15 Bug 1555758 - Fallback to GetComputedStyleNoFlush for BuildPath r=longsonr,emilio
It turns out the `BuildPath()` method will still be exposed by DOM
API via `getTotalLength()`. So we need to fallback to `GetComputedStyleNoFlush()`
to handle display:none problem, and if the element doesn't even belong
to a document, we further fallback to 0.

`BuildPath()` being affected also means `GetStrokeWidth()`, etc. will also
be indirectly exposed to DOM API in some obscure cases. Let's add a utility
to handle the fallback.

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

--HG--
extra : moz-landing-system : lando
2019-05-31 13:17:46 +00:00
violet 5519af913c Bug 1554457 - Obtain style from frame rather than GetComputedStyleNoFlush r=emilio,longsonr,birtles
These usecases are almost the same as the geometry property stuff. It'd
be better to use `GetPrimaryFrame()->Style()` consistently rather than
using `GetComputedStyleNoFlush()` here.

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

--HG--
extra : moz-landing-system : lando
2019-05-27 05:06:47 +00:00
violet 17083b6e11 Bug 1547209 - Compute transform matrix directly in nsSVGUtils::GetTransformMatrixInUserSpace r=longsonr
Since now most CSS transform related bugs are fixed, it's clear that the
purpose of nsSVGUtils::GetTransformMatrixInUserSpace() should solely be to
replace SVGElement::PrependLocalTransformsTo(eUserSpaceToParent).

After fixing Bug 972041, the only other usecase (Bug 1247218) no longer exists.

OTOH, there is a problem when the parent has a viewbox transform, in that case,
SVGElement::PrependLocalTransformsTo() doesn't include it, but
nsLayoutUtils::GetTransformToAncestor() does.

In fact, it's much easier to compute the transform matrix directly based on
the implementation of nsDisplayTransform::GetResultingTransformMatrixInternal(),
which is also the function internally called by nsLayoutUtils::GetTransformToAncestor().

In particular, we don't need to look at 3D stuff since our matrix is inherently 2D.

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

--HG--
extra : moz-landing-system : lando
2019-04-27 07:22:53 +00:00
violet 92d63fc969 Bug 972041 - getCTM should account for CSS transform r=longsonr
We use nsSVGUtils::GetTransformMatrixInUserSpace to support
CSS transform in getCTM.

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

--HG--
extra : moz-landing-system : lando
2019-04-27 08:42:51 +00:00
longsonr b768833e62 Bug 1542646 Part 12 - avoid implicit double to float conversions by using std:: variants of mathematical functions r=dholbert 2019-04-25 22:46:33 +01:00
violet 510981c8fe Bug 1073207 - getScreenCTM should account for padding and border for outer svg r=longsonr
Differential Revision: https://phabricator.services.mozilla.com/D28488

--HG--
extra : moz-landing-system : lando
2019-04-23 18:15:57 +00:00
longsonr 4928e9ca91 Bug 1542646 Part 4 - use nullptr rather than NULL r=dholbert 2019-04-12 15:47:56 +01:00
Masayuki Nakano de2d589e58 Bug 1540015 - part 3: Rename Document::GetShell() to Document::GetPresShell() and make it return PresShell* rather than nsIPresShell* r=smaug,emilio
This makes `Document::GetShell()` return `PresShell*` instead of `nsIPresShell`.

Additonally, "shell" is unclear ("docshell" vs. "presshell").  Therefore, this
also renames `Document::GetShell()` to `Document::GetPresShell()`.

Similarly, some other method names of `Document` are also renamed from
`*Shell*` to `*PresShell*`.

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

--HG--
extra : moz-landing-system : lando
2019-03-29 15:12:47 +00:00
Dorel Luca 5a0fa68b78 Backed out 3 changesets (bug 1540015) for build bustage. CLOSED TREE
Backed out changeset 7b71c9da0214 (bug 1540015)
Backed out changeset 5723ddbc5c44 (bug 1540015)
Backed out changeset 9561d2c36fa5 (bug 1540015)
2019-03-29 16:14:26 +02:00
Masayuki Nakano 9273f25ce2 Bug 1540015 - part 3: Rename Document::GetShell() to Document::GetPresShell() and make it return PresShell* rather than nsIPresShell* r=smaug,emilio
This makes `Document::GetShell()` return `PresShell*` instead of `nsIPresShell`.

Additonally, "shell" is unclear ("docshell" vs. "presshell").  Therefore, this
also renames `Document::GetShell()` to `Document::GetPresShell()`.

Similarly, some other method names of `Document` are also renamed from
`*Shell*` to `*PresShell*`.

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

--HG--
extra : moz-landing-system : lando
2019-03-29 13:09:26 +00:00
violet 5cb2a2829c Bug 1512745 - Use nsWhitespaceTokenizer to ignore leading and trailing whitespace r=longsonr
Length attribute should allow leading and trailing whitespace per SVG2.

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

--HG--
extra : moz-landing-system : lando
2019-03-27 08:52:33 +00:00
Emilio Cobos Álvarez f02f6a3545 Bug 1218257 - Use rust lengths for the SVG lengths. r=boris
As it turns out we need this to avoid losing precision both during painting and
during serialization.

This patch also changes to serialize `context-value` if it's the computed value.

I could keep the previous behavior, but it makes no sense to serialize the
initial value. We're the only ones to support this value anyway, and I couldn't
find a definition or spec for this.

Also update tests and expectations for:

 * New unexpected passes.
 * Always serializing the unit in getComputedStyle.
 * Calc and interpolation support.

Chrome also always serializes the unit in getComputedStyle, so I'm pretty sure
this is compatible with them. Chrome is inconsistent and keeps numbers in
specified style, but that's inconsistent with itself and with other quirky
lengths, so I updated the tests instead.

Differential Revision: https://phabricator.services.mozilla.com/D21819
2019-03-03 00:16:24 +01:00
Emilio Cobos Álvarez 7e10c7b612 Bug 1218257 - Cleanup and fix interpolation of SVG lengths. r=boris
Instead of storing them as LengthPercentage | Number, always store as
LengthPercentage, and use the unitless length quirk to parse numbers instead.

Further cleanups to use the rust representation can happen as a followup, which
will also get rid of the boolean argument (since we can poke at the rust length
itself). That's why I didn't bother to convert it to an enum class yet.

Differential Revision: https://phabricator.services.mozilla.com/D21804
2019-03-03 00:16:13 +01:00
Emilio Cobos Álvarez d2ed260822 Bug 1517241 - Rename nsIDocument to mozilla::dom::Document. r=smaug
Summary: Really sorry for the size of the patch. It's mostly automatic
s/nsIDocument/Document/ but I had to fix up in a bunch of places manually to
add the right namespacing and such.

Overall it's not a very interesting patch I think.

nsDocument.cpp turns into Document.cpp, nsIDocument.h into Document.h and
nsIDocumentInlines.h into DocumentInlines.h.

I also changed a bunch of nsCOMPtr usage to RefPtr, but not all of it.

While fixing up some of the bits I also removed some unneeded OwnerDoc() null
checks and such, but I didn't do anything riskier than that.
2019-01-03 17:48:33 +01:00
Daniel Holbert 1305e2bc41 Bug 1516025 part 3: Move SVG static helper function "ParseNumber" outside of the mozilla namespace to fix unified build bustage. r=longsonr
This function is invoked elsewhere in this file as "::ParseNumber(...)", which
only works if it's declared outside of any namespace.  So, it needs to be moved
outside of the mozilla namespace in order to be referenced that way (and to be
truly a static function that's private to this .cpp file).

I'm not sure why this builds at all in unified mode, but however it works, it's
cheating, apparently.

Also: this patch adds a 'using' statement for the mozilla namespace, for
e.g. the RangedPtr usages in this function definition (since it no longer lives
inside of a namespace mozilla{} block).

Depends on D15232

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

--HG--
extra : moz-landing-system : lando
2018-12-22 09:13:21 +00:00
longsonr aa644bddf1 Bug 1515962 - Move nsSVGPathDataParser nsSVGDataParser and nsSVGArcConverter to the mozilla namespace r=dholbert
--HG--
rename : dom/svg/nsSVGDataParser.cpp => dom/svg/SVGDataParser.cpp
rename : dom/svg/nsSVGDataParser.h => dom/svg/SVGDataParser.h
rename : dom/svg/nsSVGPathDataParser.cpp => dom/svg/SVGPathDataParser.cpp
rename : dom/svg/nsSVGPathDataParser.h => dom/svg/SVGPathDataParser.h
2018-12-21 20:19:15 +00:00
longsonr 3d04ba9c9e Bug 1515187 - Part 4 Rename nsSVGElement to SVGElement and put it in the mozilla:dom namespace r=dholbert
--HG--
rename : dom/svg/nsSVGElement.cpp => dom/svg/SVGElement.cpp
rename : dom/svg/nsSVGElement.h => dom/svg/SVGElement.h
2018-12-21 08:58:14 +00:00
longsonr 323a94ea24 Bug 1515187 - Part 3 move SVGContentUtils into the mozilla namespace r=dholbert 2018-12-20 07:58:08 +00:00
Sylvestre Ledru 265e672179 Bug 1511181 - Reformat everything to the Google coding style r=ehsan a=clang-format
# ignore-this-changeset

--HG--
extra : amend_source : 4d301d3b0b8711c4692392aa76088ba7fd7d1022
2018-11-30 11:46:48 +01:00
Robert Longson 5050624201 Bug 1486115 - use mozilla::IsAsciiDigit and mozilla::AsciiAlphanumericToNumber r=dholbert 2018-08-31 16:55:04 +01: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
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 f39eaa5d48 Bug 1452080: Remove ComputedStyle::PresContext usage from layout and canvas code. r=xidorn
Couldn't find an easy way of splitting these up :(

MozReview-Commit-ID: 2kTZ5McREUT
2018-04-09 11:19:49 +02:00
Noemi Erli 5d9588e156 Backed out 3 changesets (bug 1452080) for bustage in /builds/worker/workspace/build/src/layout/base/nsCSSFrameConstructor.cpp on a CLOSED TREE
Backed out changeset 7f5104c7a242 (bug 1452080)
Backed out changeset 806a9c95a243 (bug 1452080)
Backed out changeset bffebe8aa254 (bug 1452080)
2018-04-09 11:18:12 +03:00
Emilio Cobos Álvarez 2a427429ff Bug 1452080: Remove ComputedStyle::PresContext usage from layout and canvas code. r=xidorn
Couldn't find an easy way of splitting these up :(

MozReview-Commit-ID: 2kTZ5McREUT
2018-04-09 09:57:55 +02:00
Jonathan Watt 82ebebe276 Bug 1448714 - Fix up comments referring to 'style context' after the rename of nsStyleContext. r=emilio 2018-03-23 13:49:21 +00:00
Jonathan Watt 384c345f21 Bug 1448294 - Clean up naming of 'styleContext' variables after the big nsStyleContext rename. r=emilio
Reviewers: emilio

Bug #: 1448294

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

MozReview-Commit-ID: KJq2i9nrg7y
2018-03-25 20:49:58 +02:00
Narcis Beleuzu 47581f78e2 Backed out 2 changesets (bug 1448294, bug 1448337) for wpt and reftest failures on /mathml
Backed out changeset 180051cfe357 (bug 1448294)
Backed out changeset c188176f3289 (bug 1448337)
2018-03-25 21:31:08 +03:00
Jonathan Watt 21bff4e120 Summary: Bug 1448294 - Clean up naming of 'styleContext' variables after the big nsStyleContext rename. r=emilio
Reviewers: emilio

Bug #: 1448294

Differential Revision: https://phabricator.services.mozilla.com/D796
2018-03-22 13:49:21 +00:00
Emilio Cobos Álvarez e341b20ec4 Bug 1447483: Merge nsStyleContext and ServoStyleContext, rename to ComputedStyle. r=jwatt on a CLOSED TREE
MozReview-Commit-ID: JPopq0LudD
2018-03-22 20:06:24 +01:00
Emilio Cobos Álvarez 5dd797f154 Back out changeset b683bb3f22a1 (Bug 1447483) for not landing with all the files. r=me on a CLOSED TREE
This reverts commit 1808914126bb9f9e4a82d2c3d7ac961885fe7d62.

MozReview-Commit-ID: 5skESBseEvo
2018-03-22 20:05:22 +01:00
Emilio Cobos Álvarez ca5ac79cca Bug 1447483: Merge nsStyleContext and ServoStyleContext, rename to ComputedStyle. r=jwatt
MozReview-Commit-ID: JPopq0LudD
2018-03-22 19:48:42 +01:00
Robert Longson 797f6cb1a6 Bug 1325320 part 3 - move GetPathLengthScale to SVGGeometryElement and convert callers of SVGPathElement methods to work on the base SVGGeometryElement class and work for all shapes, not just paths r=dholbert 2018-03-13 19:52:03 +00:00
Robert Longson 7709e9b3e1 Bug 1444666 - get rid of nsSVGUtils version of GetStrokeDashData and replace by SVGContentUtils::GetStrokeOptions r=jwatt 2018-03-11 16:11:24 +00:00
Emilio Cobos Álvarez 7dffe29d8f Bug 1432490: Make nsComputedDOMStyle::GetStyleContext / GetStyleContextNoFlush not take a presShell. r=bz
Everyone calls them with the shell of the current composed document, and this
allows the multi-presShell stuff to just be in UpdateCurrentStyleSources /
DoGetStyleContextNoFlush.

The only reason we need to use OwnerDoc()->GetShell() instead of the composed
doc in GetStyleContext / GetStyleContextNoFlush is Element::GetBindingURL, which
does expect to get the binding URL for stuff outside of the composed doc (and
changing that gave me a useless browser).

That's technically a behavior change on the cases that used to pass nullptr, but
I think all callers are fine with that. I could also just add a special function
for that particular case, it may be worth it.

MozReview-Commit-ID: 2XlnkgdgDCK
2018-02-25 02:23:59 +01:00
Robert Longson 728a3f36fc Bug 1435477 - Make the SVG dom code use the WebIDL constants from the bindings r=jwatt 2018-02-18 15:53:13 +00:00
Robert Longson 0e21ecb9e3 Bug 1398806 - GetCtx and GetNearestViewport should return the nearest svg or symbol element which is now an SVGViewportElement rather than only returning the nearest svg element because a symbol establishes a viewport too. r=dholbert 2017-10-10 07:58:34 +01:00
Sylvestre Ledru 4e9cf83ee8 Bug 1378712 - Remove all trailing whitespaces r=Ehsan
MozReview-Commit-ID: Kdz2xtTF9EG

--HG--
extra : rebase_source : 7235b3802f25bab29a8c6ba40a181a722f3df0ce
2017-07-06 14:00:35 +02: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
Sebastian Hengst 1ebf682014 merge mozilla-central to mozilla-inbound. r=merge a=merge 2017-03-26 21:00:31 +02:00
Jonathan Watt d942383a79 Bug 1350493 - Speed up and clean up SVGTransformableElement::PrependLocalTransformsTo and its overrides. r=longsonr 2017-02-23 08:35:08 +00:00
Jan Henning 8a6b5c9c8a Bug 1328868 - Part 2 - Apply the system font scale as an additional text zoom factor to all pages that are not font inflated. r=tnikkel
We want to use a similar model as Chrome on Android does for scaling our display of web content, that is use font inflation for desktop pages and plain text zooming for everything else.

Since we don't want to simply clobber any text zoom that might have been set by the user/front-end code, we allow setting and storing the system font scale separately on the PresContext. We then calculate the effective text zoom value as the product of the system font scale and the current text zoom value.

Any function that is using the PresContext's TextZoom value for layouting/rendering is switched over to this new EffectiveTextZoom value, whereas functions that are interested in the text zoom as actually set by the user/front-end (e.g. the nsDocumentViewer, or the code responsible for copying text and full zoom settings into the new PresContext on page navigation) continue using the plain TextZoom value.

As long as font inflation is enabled in principle (e.g. font.size.inflation.minTwips != 0), every page starts out as eligible for font inflation until the relevant meta viewport tags marking the page as "mobile friendly" have been detected. Since the PresShell caches the font inflation state and only recalculates it when necessary, we make use of that and set the PresContext's system font scale as necessary whenever the font inflation state has been refreshed.

MozReview-Commit-ID: 2InyE04wKAW

--HG--
extra : rebase_source : 3f6d7128f37c1dc18f67a6655f86d9a3003fe90b
extra : source : 6100458b97289f9aea5ac8fda57ded045e6860b7
2017-02-25 13:22:52 +01:00
Robert Longson 89c77adf8e Bug 1325487 - Improve SVGContentUtils::ComputeNormalizedHypotenuse and use it more r=dholbert 2016-12-23 17:28:13 +00:00
Jonathan Watt db80f397f6 Bug 1058040, part 2 - Rename gfxTextContextPaint to SVGContextPaint and add some code comments. r=dholbert 2016-07-22 14:56:09 +01:00
Jonathan Watt c5d930fd27 Bug 1058040, part 1 - Move gfxTextContextPaint to a separate file to enable use in imagelib. r=dholbert 2016-07-22 12:07:39 +01:00
Cameron McCormack 97ad9d5793 Bug 1277154 - Remove bitfields from nsStyleSVG to help with rust bindgen. r=xidorn 2016-06-03 17:16:39 +10:00
Ting-Yu Lin 0dd7719112 Bug 1269175 - Convert nsStyleSVG::mStrokeDasharray to be nsTArray. r=heycam
MozReview-Commit-ID: 5TC8KBD5cO6

--HG--
extra : rebase_source : 5a1cc695279dc5c5f4d1799814613c3335a65196
2016-05-26 14:01:58 +08:00