Commit Graph

3450 Commits

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