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

3533 Коммитов

Автор SHA1 Сообщение Дата
Razvan Maries a85880b516 Merge mozilla-inbound to mozilla-central a=merge 2019-04-28 00:39:52 +03: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
Daniel Holbert 842b893fe3 Bug 1544121: Make size-contained replaced elements behave as if they had 0x0 intrinsic size and ratio. r=TYLin
Spec quote from https://drafts.csswg.org/css-contain/#containment-size :
"Replaced elements must be treated as having an intrinsic width and height of 0"

To achieve that, we just need to:
 (a) make all of these frame classes' GetPrefISize and GetMinISize methods return 0 if they're styled with contain:size.
 (b) make all of these frame classes' GetIntrinsicSize() and GetIntrinsicRatio() methods return 0,0.

In some cases, these methods are implemented in terms of common helper methods
(and sometimes member variables). For those cases, this patch adjusts the
helper methods (and variables) rather than the getters themselves.

Also: in one case (nsHTMLCanvasFrame), I needed to update its ComputeSize
method to remove a dependency on the "real" intrinsic size & ratio. I believe
the other classes' ComputeSize implementations do the right thing automatically
by sharing code & data with their intrinsic-size codepaths.

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

--HG--
rename : testing/web-platform/tests/media/white.webm => testing/web-platform/tests/css/css-contain/support/white.webm
extra : moz-landing-system : lando
2019-04-26 00:18:32 +00:00
Razvan Maries 444ee13e14 Merge mozilla-inbound to mozilla-central a=merge 2019-04-26 12:46:15 +03:00
violet cd03f30677 Bug 1546636 - Should consider geometry box type r=longsonr
Geometry box was implemented long ago in Bug 1289011. But during some
refactoring, the existence of geometry box was overlooked. We add back
its support.

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

--HG--
extra : moz-landing-system : lando
2019-04-25 19:56:15 +00:00
Emilio Cobos Álvarez 11ea945833 Bug 1546697 - Use a consistent style for enum classes in layout. r=dholbert
Per the discussion in:

  https://groups.google.com/d/msg/mozilla.dev.platform/P79pwa9z5m8/iPYPAWPHCAAJ

They should be CamelCase, and that's what most of them already do. This converts
the rest, which are a few.

For the ones that already used `e` or `k` prefixes, I've mostly done:

 for file in $(rg Type::e layout | cut -d : -f 1 | sort | uniq); do sed -i 's#Type::e#Type::#g' $file; done

For the ones that used uppercase, I've removed the prefix if it was already in
the type name, and turn them into CamelCase.

Depends on D28680

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

--HG--
extra : moz-landing-system : lando
2019-04-25 23:03:04 +00:00
Emilio Cobos Álvarez 3e1e7ce302 Bug 1547138 - IntrinsicSize shouldn't use nsStyleCoord. r=dholbert
We have a better type to represent "a coord or nothing", and that's Maybe.

This code is shorter, and I think reads generally better / is less easy to
misuse.

I wrote this on top of bug 1547126 so there shouldn't be conflicts.

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

--HG--
extra : moz-landing-system : lando
2019-04-25 23:48:14 +00:00
Masayuki Nakano 3622509485 Bug 1545342 - part 2: Make some public enum of nsIPresShell move to mozilla namespace and defined as enum class in PresShellForwards.h r=smaug
This patch moves some `enum` in `nsIPresShell` which are in public scope into
`mozilla` namespace and change them as `enum class`es.

Unfortunately, only "where to scroll" enum is just defines constants of
percentages of scroll destination.  Therefore, this patch makes only them
as `static const`.

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

--HG--
extra : moz-landing-system : lando
2019-04-25 05:04:15 +00:00
violet 126058f55b Bug 1533491 - nsCSSClipPathInstance::ApplyBasicShapeOrPathClip should consider transform r=longsonr
nsSVGUtils::PaintFrameWithEffects needs to pass its transform to
nsCSSClipPathInstance::ApplyBasicShapeOrPathClip so that the latter
can compute the correct box.

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

--HG--
extra : moz-landing-system : lando
2019-04-25 00:52:25 +00:00
violet 8afef00f56 Bug 1323962 - PaintSVG for container should consider CSS transform for its children r=longsonr
Container manages SVG/CSS transform of its children, thus PaintSVG of container
should take children's CSS transform into account.

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

--HG--
rename : layout/reftests/svg/test_bug1323962-3-ref.html => layout/reftests/svg/clipPath-css-transform-ref.html
rename : layout/reftests/svg/test_bug1323962-3.html => layout/reftests/svg/clipPath-css-transform.html
rename : layout/reftests/svg/test_bug1323962-ref.html => layout/reftests/svg/mask-css-transform-ref.html
rename : layout/reftests/svg/test_bug1323962.html => layout/reftests/svg/mask-css-transform.html
rename : layout/reftests/svg/test_bug1247218-ref.html => layout/reftests/svg/non-scaling-stroke-css-transform-ref.html
rename : layout/reftests/svg/test_bug1247218.html => layout/reftests/svg/non-scaling-stroke-css-transform.html
rename : layout/reftests/svg/test_bug1323962-2-ref.html => layout/reftests/svg/pattern-css-transform-ref.html
rename : layout/reftests/svg/test_bug1323962-2.html => layout/reftests/svg/pattern-css-transform.html
extra : moz-landing-system : lando
2019-04-23 00:03:00 +00:00
violet 09e109dd9a Bug 1323962 - Should support CSS transform for clip-path r=longsonr
<clipPath> can itself have SVG transform, thus we need to override
nsIFrame::IsSVGTransformed() method so that layout code will be aware
of the SVG transform.

The remaining is similar to <mask>

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

--HG--
extra : moz-landing-system : lando
2019-04-22 23:59:38 +00:00
violet 60a266004c Bug 1342800 - ComputeSize should not treat iframe as object r=firefox-svg-reviewers,longsonr
We should not treat <iframe> as <object> for SVG, otherwise there will
be unexpected sizing and other webcompat problem (e.g. getScreenCTM).

It behaved correctly before, the change was introduced to solve a double
zooming problem (bug 843480) for <iframe>. Actually the zooming problem
can be solved by avoiding zooming when the window frame is an <iframe>.

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

--HG--
extra : moz-landing-system : lando
2019-04-22 16:32:14 +00:00
Emilio Cobos Álvarez 95d5d947ba Bug 874811 - Outer svg is a replaced box with CSS layout, and CSSOM should reflect that accordingly. r=dholbert,violet
Co-authored-by: violet <violet.bugreport@gmail.com>

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

--HG--
extra : moz-landing-system : lando
2019-04-22 17:01:10 +00:00
Sylvestre Ledru a1dce6440a Bug 1519636 - Reformat recent changes to the Google coding style r=Ehsan
# ignore-this-changeset

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

--HG--
extra : moz-landing-system : lando
2019-04-22 16:35:03 +00:00
Narcis Beleuzu 43fbd93234 Merge mozilla-central to inbound. a=merge CLOSED TREE 2019-04-27 12:54:35 +03:00
longsonr dcc4813635 Bug 1542646 Part 13 - Make function declaration and definition parameter names match r=dholbert 2019-04-27 08:57:50 +01: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
longsonr ff95be21f8 Bug 1542646 Part 10 - simplify boolean logic r=dholbert 2019-04-20 11:29:32 +01:00
longsonr 5f62f5b014 Bug 1542646 Part 9 - Fix else after return r=dholbert 2019-04-20 11:26:19 +01:00
violet f48d16aaf5 Bug 1247218 - Should consider CSS transform when using non-scaling-stroke r=longsonr
We remove initial x/y offset for nsSVGUtils::GetTransformMatrixInUserSpace
so that it can be used in not-nondisplay context. Previously it was only
used in nondisplay context, where x/y offset is always 0.

Then we use this utility to get the transform matrix to judge whether we need
special care for non-scaling-stroke. The old matrix doesn't account for CSS
transform.

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

--HG--
extra : moz-landing-system : lando
2019-04-20 02:04:52 +00:00
violet 3d671c5897 Bug 1323962 - Should support CSS transform for pattern r=longsonr
The same as mask.

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

--HG--
extra : moz-landing-system : lando
2019-04-18 14:35:23 +00:00
violet 5f0ba63570 Bug 1323962 - Should support CSS transform for mask r=longsonr
SVGElement::PrependLocalTransformsTo doesn't take CSS transform into
account, we should use nsIFrame::GetTransformMatrix instead.

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

--HG--
extra : moz-landing-system : lando
2019-04-18 17:19:42 +00:00
Andreea Pavel e5b695eefd Merge mozilla-inbound to mozilla-central. a=merge 2019-04-19 00:36:23 +03:00
Brian Grinstead 381332c51e Bug 1544051 - Part 3 - Scripted change to remove references to AddTask.js r=ahal
This was generated with the script at https://bug1544051.bmoattachments.org/attachment.cgi?id=9058672

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

--HG--
extra : moz-landing-system : lando
2019-04-18 16:51:01 +00:00
Dan Glastonbury d361d6bc8e Bug 1526972 - P1: Compress bool state into bit flags. r=miko
Also move to first cache-line (64-bytes) of nsDisplayItem to improve D-cache hit
when accessing mFrame, mItemFlags, etc.

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

--HG--
extra : moz-landing-system : lando
2019-04-18 02:38:13 +00:00
longsonr 0ae6e3c251 Bug 1542646 Part 7 - use default keyword where possible r=dholbert 2019-04-17 23:38:02 +01:00
Brian Grinstead ede8c44ef2 Bug 1544322 - Part 2.1 - Remove the [type] attribute for one-liner <script> tags loading files in /tests/SimpleTest/ in everything except for dom/ r=bzbarsky
This excludes dom/, otherwise the file size is too large for phabricator to handle.

This is an autogenerated commit to handle scripts loading mochitest harness files, in
the simple case where the script src is on the same line as the tag.

This was generated with https://bug1544322.bmoattachments.org/attachment.cgi?id=9058170
using the `--part 2` argument.

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

--HG--
extra : moz-landing-system : lando
2019-04-16 03:50:44 +00:00
Brian Grinstead 6515f97bcb Bug 1544322 - Part 1 - Remove the [type] attribute for one-liner <script> tags loading files in chrome://mochikit/content/ r=bzbarsky
This is an autogenerated commit to handle scripts loading mochitest harness files, in
the simple case where the script src is on the same line as the tag.

This was generated with https://bug1544322.bmoattachments.org/attachment.cgi?id=9058170
using the `--part 1` argument.

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

--HG--
extra : moz-landing-system : lando
2019-04-15 20:56:58 +00:00
Masayuki Nakano f5737567dd Bug 1544343 - part 3: Make layout use mozilla::PresShell instead of nsIPresShell as far as possible r=emilio
This patch changes remaining things under `layout/`.  However, there are some
places which still need to use `nsIPresShell`.  That will be fixed in a
follow up bug.

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

--HG--
extra : moz-landing-system : lando
2019-04-16 07:25:10 +00:00
Masayuki Nakano 2f9688c14e Bug 1544343 - part 2: Make factory methods take mozilla::PresShell instead of nsIPresShell r=emilio
Additionally, this patch makes `nsFrame.h` stop including `nsIPresShell.h`
and makes each users include `mozilla/PresShell.h` instead.  So, this improves
rebuild performance of `nsIPresShell.h` (and `mozilla/PresShell.h` in the
future).

Note that due to `nsIFrame::PresShell()`, `mozilla::` prefix is necessary for
`PresShell` in a lot of classes which are derived from `nsIFrame` even in
`.cpp` files.

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

--HG--
extra : moz-landing-system : lando
2019-04-16 07:24:49 +00:00
Kartikaya Gupta 25f7a03029 Bug 1543482 - Extract a helper to identify clip paths WR can handle without masks. r=mattwoodrow
Differential Revision: https://phabricator.services.mozilla.com/D27454

--HG--
extra : moz-landing-system : lando
2019-04-15 11:24:53 +00:00
Csoregi Natalia 612325227f Backed out 8 changesets (bug 1526972) for causing crashes (bug 1544406). a=backout
Backed out changeset 815543d81a1d (bug 1526972)
Backed out changeset a895c9028b31 (bug 1526972)
Backed out changeset 2ea2f8533078 (bug 1526972)
Backed out changeset 2fb940b13971 (bug 1526972)
Backed out changeset 8543b9d46521 (bug 1526972)
Backed out changeset ddd57e437228 (bug 1526972)
Backed out changeset 54b14df56e6f (bug 1526972)
Backed out changeset a59f06022a95 (bug 1526972)
2019-04-15 18:15:49 +03:00
Dan Glastonbury a9319e3ae3 Bug 1526972 - P1: Compress bool state into bit flags. r=miko
Also move to first cache-line (64-bytes) of nsDisplayItem to improve D-cache hit
when accessing mFrame, mItemFlags, etc.

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

--HG--
extra : moz-landing-system : lando
2019-04-15 00:23:07 +00:00
violet fa3b85a4da Bug 1544270 - Change 1.f * something to float(something) r=longsonr
Change 1.f * something to float(something)

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

--HG--
extra : moz-landing-system : lando
2019-04-14 09:32:19 +00:00
violet 1ce98d921c Bug 1544209 - Should not scale mFontSizeScaleFactor for user space r=longsonr
We already get the user space metrics, mFontSizeScaleFactor is irrelevant
and the scaling should not be applied in the first place.

Otherwise we will get very wrong bounding box when <text> has SVG transform
or the font has extreme size.

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

--HG--
extra : moz-landing-system : lando
2019-04-14 07:41:42 +00:00
Masayuki Nakano 414509fe00 Bug 1543315 - part 9: Mark nsIPresShell::FlushPendingNotifications() as MOZ_CAN_RUN_SCRIPT r=smaug
So, this patch makes all caller of it safe including its arguments unless
they come from other methods.

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

--HG--
extra : moz-landing-system : lando
2019-04-13 12:43:57 +00:00
longsonr eff829f752 Bug 1542646 Part 6 - pass by reference when it's more efficient r=dholbert 2019-04-12 17:29:32 +01:00
longsonr 07bf678276 Bug 1542646 Part 5 - don't use instance variables to access static methods r=dholbert 2019-04-12 17:28:13 +01:00
Ting-Yu Lin f49d08722a Bug 1543571 Part 1 - Replace "reflow state" with "reflow input". r=dholbert
This patch is generated by the following script on Linux:

function rename() {
    find .\
         -type f\
         ! -path "./obj*"\
         ! -path "./.git"\
         ! -path "./.hg"\
         \( -name "*.cpp" -or\
            -name "*.h" \)\
            -exec sed -i -e "s/$1/$2/g" "{}" \;
}
rename "reflow state" "reflow input"

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

--HG--
extra : moz-landing-system : lando
2019-04-11 20:27:37 +00:00
longsonr 866f2126b4 Bug 1540408 Part 3 - Rename SVGViewBoxRect to SVGViewBox r=dholbert 2019-04-10 05:08:14 +01:00
longsonr 4c4cabe851 Bug 1540408 Part 2 - Move nsSVGLength2 and nsSVGNumber2 to the mozilla namespace renaming them to be SVGAnimatedLength and SVGAnimatedNumber. r=dholbert
--HG--
rename : dom/svg/nsSVGLength2.cpp => dom/svg/SVGAnimatedLength.cpp
rename : dom/svg/nsSVGLength2.h => dom/svg/SVGAnimatedLength.h
rename : dom/svg/nsSVGNumber2.cpp => dom/svg/SVGAnimatedNumber.cpp
rename : dom/svg/nsSVGNumber2.h => dom/svg/SVGAnimatedNumber.h
2019-04-09 21:04:33 +01:00
violet 5c289d7a54 Bug 1542714 - Remove nsSVGUtils::GetUserToCanvasTM r=longsonr
nsSVGUtils::GetUserToCanvasTM becomes dead code and no longer useful,
since it doesn't take CSS transform into account. Let's remove it.

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

--HG--
extra : moz-landing-system : lando
2019-04-08 17:20:07 +00:00
violet c0ca7d5cac Bug 1541021 - Should take CSS transform into account when calculating getBoundingClientRect() r=longsonr
We should use nsLayoutUtils::GetTransformToAncestor instead of
nsSVGUtils::GetUserToCanvasTM to get the transform matrix. Because the former
will also take CSS transform into account while the latter won't.

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

--HG--
extra : moz-landing-system : lando
2019-04-08 04:39:23 +00:00
Narcis Beleuzu 8d78f21970 Backed out changeset 253e90f0ccf3 (bug 1541021) for mochitest failures on test_bounds.html 2019-04-07 19:50:14 +03:00
violet ea72deb0be Bug 1541021 - Should take CSS transform into account when calculating getBoundingClientRect() r=longsonr
We should use nsLayoutUtils::GetTransformToAncestor instead of
nsSVGUtils::GetUserToCanvasTM to get the transform matrix. Because the former
will also take CSS transform into account while the latter won't.

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

--HG--
extra : moz-landing-system : lando
2019-04-07 14:11:39 +00:00
Emilio Cobos Álvarez 7980a72d0a Bug 760345 - Remove the last usage of lossy currentcolor. r=heycam
We don't have lossy currentcolor in the style system anymore, except for a
single property -moz-font-smoothing-background-color.

I could've converted it into a proper StyleColor and thread down all the
necessary information to the font metrics code.

But it doesn't really seem worth it given it's not exposed to the web, so I just
did the simplest thing, which is making currentcolor compute to transparent to
that specific property.

This patch also removes the stores_complex_colors_lossily code and related,
since now we always can cache computed colors.

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

--HG--
extra : moz-landing-system : lando
2019-04-06 17:47:58 +00:00
Masayuki Nakano e8446480e1 Bug 1542407 - Make nsIFrame use mozilla::PresShell directly rather than via nsIPresShell r=emilio
Except retrieving from weak reference, `nsIFrame` should treat
`mozilla::PresShell` directly rather than via `nsIPresShell`.

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

--HG--
extra : moz-landing-system : lando
2019-04-06 06:02:28 +00:00
Kartikaya Gupta 4d9ac753d2 Bug 1541113 - Avoid crashing content process with giant drawtarget. r=mstange
Differential Revision: https://phabricator.services.mozilla.com/D25931

--HG--
extra : moz-landing-system : lando
2019-04-05 16:26:59 +00:00
Coroiu Cristina 749dbdc496 Merge mozilla-central to inbound a=merge 2019-04-05 06:23:29 +03:00
Miko Mynttinen 5463d7f522 Bug 1536423 - Remove SVGCharClipDisplayItem r=mattwoodrow
Differential Revision: https://phabricator.services.mozilla.com/D26191

--HG--
extra : moz-landing-system : lando
2019-04-04 18:04:49 +00:00
Alex Henrie c8349295db Bug 1529182 - Include stroke in SVG <text> bounding box. r=longsonr,heycam
I think I found another mistake in the SVG text code that could explain the regression: If the text is drawn with a stroke, shouldn't the stroke be included in the bounding box?

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

--HG--
extra : moz-landing-system : lando
2019-04-04 06:38:40 +00:00
Masayuki Nakano 9165a150a1 Bug 1540930 - Make nsPresContext use mozilla::PresShell directly rather than via nsIPresShell r=emilio
`nsPresContext` should use `mozilla::PresShell` directly instead of
`nsIPresShell`.  This patch makes it.

Unfortunately, `nsPresContext` and `nsIFrame` have `PresShell()`.  Therefore,
we cannot use `PresShell*` in its methods so that this patch uses `mozilla::`
namespace prefix.

It might be better to rename them as `PresShellPtr()` in another bug.

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

--HG--
extra : moz-landing-system : lando
2019-04-03 12:40:26 +00:00
violet 6db1bbd9b8 Bug 1370646 - Honor the maxTextRunSize if it's within reasonable range r=heycam
If the maximal and minimal font-size in a SVGTextFrame have a huge difference,
previously we chose mFontSizeScaleFactor to satisfy the minimal one. That's
problematic, because the maximal one might be a reasonable size, while the minimal
one is extremely small. We should honor the maximal one if this is the case.

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

--HG--
extra : moz-landing-system : lando
2019-04-03 01:00:38 +00:00
Matt Woodrow d99a15fae2 Bug 1539673 - Support fallible display item construction. r=miko
Differential Revision: https://phabricator.services.mozilla.com/D25167

--HG--
extra : moz-landing-system : lando
2019-04-01 16:53:11 +00:00
violet fa6e04c666 Bug 1540703 - Should also reflow SVGTextFrame for non-display active child of switch element r=longsonr
When <switch> happens to have an active child that is non-display, we should still reflow all its descendant SVGTextFrame for consistency.

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

--HG--
extra : moz-landing-system : lando
2019-04-02 06:08:23 +00:00
Jonathan Kew f5e8791f61 Bug 1533428 - patch 4 - Include chromium-config.mozbuild in the moz.build for a bunch more directories, so that IPC-related headers are available. r=jwatt
Differential Revision: https://phabricator.services.mozilla.com/D22922

--HG--
extra : moz-landing-system : lando
2019-04-01 14:32:44 +00:00
Daniel Varga bd12eaff99 Backed out changeset 005d447749ec (bug 1370646) mochitest failure at layout/style/test/test_font_loading_api.html. On a CLOSED TREE 2019-03-29 10:38:13 +02:00
violet e93691e85b Bug 1370646 - Honor the maxTextRunSize if it's within reasonable range r=heycam
If the maximal and minimal font-size in a SVGTextFrame have a huge difference,
previously we chose mFontSizeScaleFactor to satisfy the minimal one. That's
problematic, because the maximal one might be a reasonable size, while the minimal
one is extremely small. We should honor the maximal one if this is the case.

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

--HG--
extra : moz-landing-system : lando
2019-03-29 07:01:10 +00:00
longsonr bff06425af Bug 1540408 Part 1 - Move most internal attribute representation classes to be of the form SVGAnimated. r=dholbert
--HG--
rename : dom/svg/SVGBoolean.cpp => dom/svg/SVGAnimatedBoolean.cpp
rename : dom/svg/SVGBoolean.h => dom/svg/SVGAnimatedBoolean.h
rename : dom/svg/SVGClass.cpp => dom/svg/SVGAnimatedClass.cpp
rename : dom/svg/SVGClass.h => dom/svg/SVGAnimatedClass.h
rename : dom/svg/SVGEnum.cpp => dom/svg/SVGAnimatedEnumeration.cpp
rename : dom/svg/SVGEnum.h => dom/svg/SVGAnimatedEnumeration.h
rename : dom/svg/SVGInteger.cpp => dom/svg/SVGAnimatedInteger.cpp
rename : dom/svg/SVGInteger.h => dom/svg/SVGAnimatedInteger.h
rename : dom/svg/SVGIntegerPair.cpp => dom/svg/SVGAnimatedIntegerPair.cpp
rename : dom/svg/SVGIntegerPair.h => dom/svg/SVGAnimatedIntegerPair.h
rename : dom/svg/SVGNumberPair.cpp => dom/svg/SVGAnimatedNumberPair.cpp
rename : dom/svg/SVGNumberPair.h => dom/svg/SVGAnimatedNumberPair.h
rename : dom/svg/SVGOrient.cpp => dom/svg/SVGAnimatedOrient.cpp
rename : dom/svg/SVGOrient.h => dom/svg/SVGAnimatedOrient.h
rename : dom/svg/SVGString.cpp => dom/svg/SVGAnimatedString.cpp
rename : dom/svg/SVGString.h => dom/svg/SVGAnimatedString.h
rename : dom/svg/SVGViewBox.cpp => dom/svg/SVGAnimatedViewBox.cpp
rename : dom/svg/SVGViewBox.h => dom/svg/SVGAnimatedViewBox.h
2019-04-04 18:40:56 +01:00
Emilio Cobos Álvarez 2dd6a71b3e Bug 1531333 - Fix <svg:use> cycle detection. r=longsonr
With the current code we'll eventually detect the cycle, but will take much
more, creating many shadow trees unnecessarily. Take for example the following:

<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="133" height="232774">
    <style>
      symbol { display: block }
    </style>
    <symbol id="svg-sprite" viewBox="0 0 133 230866">
        <title>svg-sprite</title>
        <symbol id="svg-sprite" viewBox="0 0 133 230866">
            <title>svg-sprite</title>
            <use xlink:href="#svg-sprite" width="500" height="500" />
        </symbol>
        <use xlink:href="#svg-sprite" y="1601" width="133" height="228958" />
    </symbol>
    <use xlink:href="#svg-sprite" y="1601" width="133" height="230866" />
</svg>

Before this patch, we'd create an svg use element subtree for #svg-sprite. That
subtree will contain two other <use> elements, one under the <symbol>, one not
under it.

Both point to #svg-sprite, but we fail to detect we're an ancestor since the
element #svg-sprite we're looking at is the clone of the #svg-sprite element.

Thus we need to take a look at mOriginal instead (which is the <use> element
under #svg-sprite) rather than at the clone.

Yeah, I had to draw the trees, it's messy :)

Blink and WebKit do something slightly different (they check the element id
directly[1]). That's not 100% correct, since you can have multiple elements with
the same ID.

[1]: https://cs.chromium.org/chromium/src/third_party/blink/renderer/core/svg/svg_use_element.cc?l=560&rcl=861855dcb8c39ba8d42497247d433277858df79b

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

--HG--
extra : moz-landing-system : lando
2019-03-22 22:26:53 +00:00
violet 76cd3244f4 Bug 951904 - SVGTextFrame should always be reflowed even if it is inside a nonactive child of switch element r=longsonr
SVGTextFrame is special, it should always be reflowed to get the correct metrics.

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

--HG--
extra : moz-landing-system : lando
2019-03-21 21:17:18 +00:00
violet 0a0bd52597 Bug 1537708 - Clean up NS_STATE_IS_OUTER_SVG flag in favor of IsSVGOuterSVGFrame r=longsonr
NS_STATE_IS_OUTER_SVG is redundant, we clean it up and use
nsIFrame::IsSVGOuterSVGFrame() instead.

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

--HG--
extra : moz-landing-system : lando
2019-03-22 02:23:35 +00:00
violet 2c538f0dfe Bug 1536892 - Check a frame does maintain overflow before adding to OverflowChangedTracker. r=longsonr CLOSED TREE
Differential Revision: https://phabricator.services.mozilla.com/D24305

--HG--
extra : rebase_source : 90f906520cd20d22276dfa14c51d8f45fa1549c0
extra : amend_source : 84015fc7ebe2db6d8d30d65468deca469ae9bc8f
2019-03-19 20:33:36 +01:00
Cameron McCormack 187b9a230c Bug 1535517 - Don't schedule SVG text reflow in response to bidi resolution. r=jwatt
Differential Revision: https://phabricator.services.mozilla.com/D23615

--HG--
extra : moz-landing-system : lando
2019-03-15 15:29:33 +00:00
Cameron McCormack 9cd8ebef9b Bug 1531890 - Take objectBoundingBox into account when a clipPath's child has its own clip-path. r=longsonr
Differential Revision: https://phabricator.services.mozilla.com/D23612

--HG--
extra : moz-landing-system : lando
2019-03-19 01:18:21 +00:00
Matt Woodrow 756b5124bc Bug 1525372 - Add background-clip:text rendering observer so that we get notified of changes to the clipped contents. r=jwatt
Differential Revision: https://phabricator.services.mozilla.com/D20110

--HG--
extra : moz-landing-system : lando
2019-03-18 16:24:20 +00:00
violet 68968a150f Bug 1504072 - non-display outer SVG also doesn't maintain overflow r=longsonr
There is some inconsistency between nsIFrame::FrameMaintainsOverflow() and
nsSVGContainerFrame::ComputeCustomOverflow(). If an element is a nondisplay
outer SVG, the latter gives false while the former returns true. We make them
consistent since nondisplay element doesn't need to maintain overflow.

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

--HG--
extra : moz-landing-system : lando
2019-03-17 11:00:48 +00:00
violet d307082a12 Bug 1072758 - ScheduleReflowSVGNonDisplayText when changing style to display none r=emilio
DidSetComputedStyle won't be called if the style changes to "display:none".
To ensure the reflow is properly scheduled, we need to also hook DestroyFrom.

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

--HG--
extra : moz-landing-system : lando
2019-03-16 02:36:09 +00:00
Dorel Luca 0e9ffb4c4f Merge mozilla-inbound to mozilla-central. a=merge 2019-03-14 18:25:40 +02:00
Emilio Cobos Álvarez 5aa8533517 Bug 1533963 - Use a single RestyleHint representation. r=heycam
Differential Revision: https://phabricator.services.mozilla.com/D22828

--HG--
extra : moz-landing-system : lando
2019-03-14 11:47:50 +00:00
Sylvestre Ledru 4aa92e3091 Bug 1519636 - Reformat recent changes to the Google coding style r=Ehsan
# ignore-this-changeset

Differential Revision: https://phabricator.services.mozilla.com/D22514
2019-03-13 10:19:06 +01:00
Andrew Osmond bc278165ae Bug 1534188 - Use high quality downscaling for raster images embedded in SVGs. r=tnikkel
Differential Revision: https://phabricator.services.mozilla.com/D23374
2019-03-14 07:16:29 -04:00
longsonr 65caeb2944 Bug 1532444 - Go back to doing synchronous invalidation in ReflowSVGNonDisplayText as its invoked by ScheduleReflowSVGNonDisplayText so is already asynchronous r=dholbert 2019-03-09 14:14:33 +00:00
violet 7d525e84a8 Bug 1508028 - Change stroke-miterlimit restriction from GreaterThanOrEqualToOneNumber to NonNegativeNumber. r=longsonr,emilio 2019-03-09 13:05:56 +00:00
Chris Peterson 9b04fe7446 Bug 1532128 - layout: Make some global functions static. r=dholbert
clang's -Wmissing-prototypes option identifies global functions that can be made static (because they're only called from one compilation unit) or removed (if they're never called).

layout/painting/FrameLayerBuilder.cpp:2593:6 [-Wmissing-prototypes] no previous prototype for function 'ReleaseLayerUserData'
layout/painting/RetainedDisplayListBuilder.cpp:1084:6 [-Wmissing-prototypes] no previous prototype for function 'FindContainingBlocks'
layout/style/FontFaceSet.cpp:423:6 [-Wmissing-prototypes] no previous prototype for function 'IsPdfJs'
layout/svg/SVGObserverUtils.cpp:969:6 [-Wmissing-prototypes] no previous prototype for function 'DestroyFilterProperty'

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

--HG--
extra : rebase_source : 7b876a976087eef710ff70ca0ae42abb3c505e49
extra : histedit_source : 4254fd49e36bef38bbb6197861a4a22e040d17e0
2019-02-22 20:33:01 -08:00
Jeff Muizelaar 4febae72fc Bug 1495170. Use CreateClippedDrawTarget more. r=mstange
This lets us restrict the size of the mask surface that we allocate
to the destination tile size. This gives a large performance
improvement.

It also includes some miscelanous fixes to the CreateClippedDrawTarget
code path.

Differential Revision: https://phabricator.services.mozilla.com/D21750
2019-03-04 22:30:09 -05:00
violet 3f63d086cd Bug 1528635 - Check urlExtraReferrer not null before dereference to avoid crash r=longsonr
urlExtraReferrer could be null, we should check before dereference.  Otherwise
it will cause crash when webrender is enabled by gfx.webrender.enabled=true
and gfx.webrender.all=true,

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

--HG--
extra : moz-landing-system : lando
2019-03-03 19:35:42 +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
Ryan Hunt b936c00a65 Bug 1523969 part 14 - Move method definition inline comments to new line in 'layout/'. r=dholbert
Differential Revision: https://phabricator.services.mozilla.com/D21115

--HG--
extra : rebase_source : 4d65c07d8822f3a54ac881b5d0f55468ce884554
2019-02-25 16:09:24 -06:00
Timothy Nikkel 4a54583c19 Bug 1505871. C++ code to get component transfer filter data into webrender. r=jrmuizel
Have to use a pointer/size pair to transfer the value list to rust.

We use a "filter holder" that contains an nsTArray that owns the values.
2019-02-26 00:16:36 -06:00
Timothy Nikkel b2695b4b73 Backed out changeset 2bf33f573505 2019-02-25 22:48:35 -06:00
Timothy Nikkel b9d0354d8a Bug 1505871. C++ code to get component transfer filter data into webrender. r=jrmuizel
Have to use a pointer/size pair to transfer the value list to rust.

We use a "filter holder" that contains an nsTArray that owns the values.
2019-02-25 22:45:15 -06:00
Noemi Erli a50bfca7a3 Backed out 10 changesets (bug 1505871) for wrench bustages CLOSED TREE
Backed out changeset 045ab0ec3613 (bug 1505871)
Backed out changeset 6486435a048d (bug 1505871)
Backed out changeset 9be871042749 (bug 1505871)
Backed out changeset 0007feaf988d (bug 1505871)
Backed out changeset 3cb8fb01e77e (bug 1505871)
Backed out changeset 2fff213d97e3 (bug 1505871)
Backed out changeset 1ad20d485eca (bug 1505871)
Backed out changeset 0fd8742fa662 (bug 1505871)
Backed out changeset 1899600a7985 (bug 1505871)
Backed out changeset f9578d20e54e (bug 1505871)
2019-02-26 03:43:12 +02:00
Timothy Nikkel 17f5b2d751 Bug 1505871. C++ code to get component transfer filter data into webrender. r=jrmuizel
Have to use a pointer/size pair to transfer the value list to rust.

We use a "filter holder" that contains an nsTArray that owns the values.
2019-02-25 19:20:26 -06:00
Alex Henrie 9d83a1b171 Bug 1529182 - Correctly apply scale factor when clamping SVG text size. r=longsonr
--HG--
extra : amend_source : 63508a69c60363cac314ae6d1278df728c3fa0a6
2019-02-24 15:14:32 -07:00
Razvan Maries d7a2f49ed8 Merge mozilla-inbound to mozilla-central a=merge 2019-02-23 06:15:14 +02:00
Razvan Maries 5173412ca4 Backed out changeset 27284783216c (bug 1529182) for reftest fails on text-stroke-scaling-02a.html after fix. a=backout 2019-02-23 02:21:08 +02:00
Samuel Thibault 3ec9cb5130 Bug 919508 - nsTextFrame::GetTrimmedOffsets: Rework flag parameters r=jfkthame
--HG--
extra : histedit_source : 5c59e716d7a94030b6146bc471bc8dbbd92c7122
2019-02-22 22:12:27 +01:00
Alex Henrie 6dbf36393c Bug 1529182 - Recalculate context scale when inflating mRect of SVG text. r=longsonr
--HG--
extra : histedit_source : 532cfc0bb9c8ae23a9d2d8ab31452d8a3bdb7525
2019-02-21 09:06:28 -07:00
Boris Chiou b332718138 Bug 1505225 - Part 1: Make sure we also check the existence of individual transform animations. r=hiro
nsIFrame::BuildDisplayListForStackingContext() will check the existence
of transform animations, so we need to update
nsLayoutUtils::HasAnimationsOfPoperty(). However, checking only
eCSSProperty_transform is not enough. We have to check all the transform-like
properties. Therefore, we update these functions to accept a property
set as the argument, and pass a collection of transform-like properties
into them.

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

--HG--
extra : moz-landing-system : lando
2019-02-20 02:14:39 +00:00
scharing 87df459a63 Bug 1528464 - Convert NS_STYLE_MASK_MODE_* to enum class r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D20063

--HG--
extra : moz-landing-system : lando
2019-02-19 16:54:52 +00:00
Alex Henrie 7afb5aaf34 Bug 1521425 - Round up when inflating mRect of SVG text. r=longsonr 2019-02-17 22:27:56 -07:00
Razvan Maries 2fb9019d41 Merge mozilla-central to mozilla-inbound. a=merge on a CLOSED TREE 2019-02-15 11:59:08 +02:00
Emilio Cobos Álvarez e9ae3b0907 Bug 1527410 - Use Rust sizes for flex-basis, width, height, and their min/max properties. r=jwatt
Really sorry for the size of the patch :(

Only intentional behavior change is in the uses of HasLengthAndPercentage(),
where it's easier to do the right thing. The checks that used to check for
(IsCalcUnit() && CalcHasPercentage()) are wrong since bug 957915.

Differential Revision: https://phabricator.services.mozilla.com/D19553
2019-02-15 03:59:31 +01:00
Ting-Yu Lin 8c62035164 Bug 1527519 Part 3 - Replace remaining nsLayoutUtils::GetAsBlock() with do_QueryFrame(), and delete nsLayoutUtils::GetAsBlock(). r=mats
Depends on D19861

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

--HG--
extra : moz-landing-system : lando
2019-02-15 01:38:05 +00:00
Jeff Muizelaar ce64d00a94 Bug 1524661. Include perspective items as container items. r=mstange
Differential Revision: https://phabricator.services.mozilla.com/D19562

--HG--
extra : moz-landing-system : lando
2019-02-12 20:47:36 +00:00
Emilio Cobos Álvarez 12867b1a3f Bug 1525371 - Kill ComputedStyle::mPresContext, move the pointer to the frame instead. r=jwatt
Differential Revision: https://phabricator.services.mozilla.com/D18734
2019-02-07 11:15:36 +01:00
Andrew Swan ee2283d446 Bug 1523980 Revoke special testpilot permissions r=kmag
Differential Revision: https://phabricator.services.mozilla.com/D18768

--HG--
extra : moz-landing-system : lando
2019-02-06 22:21:01 +00:00
Emilio Cobos Álvarez e38aff2db7 Bug 1525134 - Move image loads out of the style struct accessors. r=heycam
After this I can pass the document from the caller to ResolveSameStructsAs, and
get rid of the pres context pointer.

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

--HG--
extra : moz-landing-system : lando
2019-02-05 19:47:29 +00:00