Commit Graph

3490 Commits

Author SHA1 Message Date
Emilio Cobos Álvarez
b3863ed908 Bug 1547792 - AspectRatio should be a single ratio, not a size. r=dholbert
Differential Revision: https://phabricator.services.mozilla.com/D29244

--HG--
extra : moz-landing-system : lando
2019-05-02 23:28:21 +00:00
Cameron McCormack
dca00b9a3e Bug 1539318 - Prevent getComputedTextLength() from working on non-display SVG text elements. r=jwatt
This adds the same bailing out behavior that was added in bug 1402109 to a number
of other functions implementing SVG DOM text methods.

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

--HG--
extra : moz-landing-system : lando
2019-05-02 01:08:39 +00:00
Cosmin Sabou
aaedb26cee Backed out changeset e9ea26dd5b68 (bug 1539318) for crashtest failures on 1539318-1.html. 2019-05-02 03:18:12 +03:00
Cameron McCormack
a4fce1514d Bug 1539318 - Prevent getComputedTextLength() from working on non-display SVG text elements. r=jwatt
This adds the same bailing out behavior that was added in bug 1402109 to a number
of other functions implementing SVG DOM text methods.

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

--HG--
extra : moz-landing-system : lando
2019-05-01 22:41:50 +00:00
Sylvestre Ledru
e226046cb8 Bug 1547143 - Format the tree: Be prescriptive with the pointer style (left) r=Ehsan
# ignore-this-changeset

Depends on D28954

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

--HG--
extra : moz-landing-system : lando
2019-05-01 08:47:10 +00:00
Emilio Cobos Álvarez
a6845a59a2 Bug 1547619 - Fix :-moz-svg-use-shadow-tree-root pseudo-class. r=violet
Turns out removing the pseudo-class and such ends up not being quite as trivial
as I initially thought, or possible at all, since the fact that the <symbol> is
a <symbol> is observable via selectors, added a test for that.

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

--HG--
extra : moz-landing-system : lando
2019-04-29 08:04:22 +00:00
violet
8213637295 Bug 1372537 - display:none of symbol should be important r=longsonr,emilio
Differential Revision: https://phabricator.services.mozilla.com/D29099

--HG--
extra : moz-landing-system : lando
2019-04-29 00:20:30 +00:00
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