Commit Graph

3475 Commits

Author SHA1 Message Date
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
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