Commit Graph

242 Commits

Author SHA1 Message Date
cku
a9228a48bc Bug 1343139 - Part 1. Implement nsStyleSVGReset::HasMask. r=heycam
Implement this unil function to improve readability
MozReview-Commit-ID: FLKOGyq180W

--HG--
extra : rebase_source : db8dbc67dbc63c19df806e79ea36016d3d5fc8b6
extra : source : 47fa0a1f03acd6007e2d40e4ec5bc0ddba221361
2017-03-07 13:43:21 +08:00
cku
1c222a7b6c Bug 1348564 - Part 3. More comment in nsSVGIntegrationUtils::GetSVGBBoxForNonSVGFrame. r=jwatt
MozReview-Commit-ID: Gq9vLmqrcjy

--HG--
extra : rebase_source : 4aefa23ea76dadbb38508fb7bc85e628cc6b4fc0
2017-03-22 15:53:55 +08:00
Jonathan Watt
e331fb83fd Bug 1349244 - Rename nsISVGChildFrame to nsSVGDisplayableFrame to reduce confusion. r=longsonr
MozReview-Commit-ID: IQCv2ebZbwk

--HG--
rename : layout/svg/nsISVGChildFrame.h => layout/svg/nsSVGDisplayableFrame.h
2017-02-09 18:24:31 +00:00
Sebastian Hengst
e4de847b3c Backed out changeset 836d16519edf (bug 1345853) for frequently failing its own test pattern-big-image.html. r=backout 2017-03-17 21:54:01 +01:00
cku
e2d44c26bf Bug 1345853 - Part 1. Pass DrawResult from nsSVGPatternFrame::PaintPattern back to nsDisplaySVGGeometry::Paint. r=mstange,tnikkel
I did many change in many files in this patch. But the goal is pretty simple: To
pass the return value of nsSVGPatternFrame::PaintPattern back to the caller
(nsDisplaySVGGeometry). My suggestion is to review this patch right from
nsSVGPatternFrame.cpp.

I made two mistakes in bug 1258510
1. We should not return directly at [1]. RemoveStateBits at l418 will be skip.
2. nsSVGPatternFrame::PaintPattern should return both SourceSurface and draw
result, so that we can update UpdateDrawResult in display item.

All the other changes are to
1. make sure the return value of nsSVGPatternFrame::PaintPattern goes back to
nsDisplaySVGGeometry::Paint correctly.
2. Since the return value of nsSVGPatternFrame::PaintPattern change, we need
modify all existed callers.

I also filed bug 1346124 for handle the returning value of PaintMarkers.

[1] https://hg.mozilla.org/mozilla-central/file/c0700bedb4f7/layout/svg/nsSVGPatternFrame.cpp#l415

MozReview-Commit-ID: Iq9RPQ6Omz0

--HG--
extra : rebase_source : bc338b1a33f1dbf209706577b2455315dfb855e2
2017-03-16 12:17:19 +08:00
cku
8f0a57337e Bug 1320036 - Part 1. Correct objectBoundingBox region of a filter applied to an outer SVG element. r=jwatt
MozReview-Commit-ID: 8frACVe2gFE

--HG--
extra : rebase_source : f796c7ae084cc2af0960a0702167fe8211aa083a
extra : source : 43b17a8af53a4684abb4379a3fba95c9d424c77f
2017-03-15 18:36:53 +08:00
cku
2f1f711b2d Bug 1340257 - Part 2. Revert the change in bug 842114. r=cjku
MozReview-Commit-ID: Kqyt4AHwpJL

--HG--
extra : rebase_source : 2e4ddbe50895b79433ddbe1e392b1a0be83d142c
2017-02-22 16:27:40 +08:00
cku
bda562a499 Bug 1340257 - Part 1. Remove Assertion failure: mightHaveNoneSVGMask. r=heycam
After fighting with this assertion several months, I decided to remove it for
two reasons:

This assertion allows PreEffectBBoxProperty not being cached only under specific
condition. But the condition is wider then we expect.

1.
PreEffectsBBoxProperty is cached by nsIFrame::FinishAndStoreOverflow(this
function calls ComputeEffectsRect which cache this property actually) and
it is called from nsXXXFrame::Reflow on demand. Yes, *on demand*, not always.
And this is the fist reason that why I think we should just remove
this assertion.

For example, nsBlockFrame::Reflow calls FinishAndStoreOverflow to store this
property. But like BRFrame, it does not call FinishAndStoreOverflow at all.
In anohter word, if you apply any SVG effect to a BRFrame, you will always hit
this assertion. Here is an example:
  <br style="filter: saturate(0%);"/>

So, if we still want to keep this assertion, we may need to create a list which
list all frame types that cache PreEffectsBBoxProperty, and do this check only if
the type of aFrame is listed. This is error prone since we may introduce a
new frame type at any time and forget to update this table.

2.
So, I think it's better just removing this assertion. The assertion that we
really need is the next one(2nd one):
MOZ_ASSERT(!preTransformOverflows,
           "GetVisualOverflowRect() won't return the pre-effects rect!");
Since hitting that assertion, the 2nd one, means caller will retrieve wrong
effect region. Hitting the first assertion only means we do not cache
PreEffectsBBoxProperty, it's pretty normal and not hurt anything. This is the
second reason that I think we should remvoe this assertion.

MozReview-Commit-ID: JfiYTiP2laG

--HG--
extra : rebase_source : b0225e36cd7e33a23516cfbe5a40c731d92f8825
2017-02-22 15:56:53 +08:00
cku
aaa97f23a2 Bug 1340992 - Demote MOZ_ASSERT to NS_ASSERTION before root cause addressed. r=me
MozReview-Commit-ID: I8goOZdPs9d
2017-02-21 17:44:22 +08:00
cku
3e138fa63b Bug 824300 - Part 1. Correct assert condition and promote NS_ASSERTION to MOZ_ASSERT r=heycam
MozReview-Commit-ID: 1FHD2xhQ3x4

--HG--
extra : rebase_source : 6629580190cdf7587a63674e2936988004bf9a03
extra : source : 0ba11d51f4c6998396a64161ce6fe2da3c721b2c
2017-02-04 20:43:08 +08:00
cku
f8a699428b Bug 842114 - Part 1. Correct assert condition and promote NS_ASSERTION to MOZ_ASSERT. r=heycam
Except during restyle process, we should skip this checking in reflow as well.
But what really should do is to skip this checking if this function is called
from ComputeEffectsRect. The reason is explained in the beginning of
ComputePostEffectsVisualOverflowRect.

Also promote NS_ASSERTION to MOZ_ASSERTION in this patch.

MozReview-Commit-ID: 3CuKkdR4kTK

--HG--
extra : rebase_source : 968f708603ec4424dd32f23bf2a4ffc74ce3fc85
2017-02-03 21:37:08 +08:00
Cameron McCormack
f63cdecde2 Bug 1297899 - Part 6: Move RestyleManagerHandle functionality into RestyleManager. r=bholley
MozReview-Commit-ID: 7lsti0bGzNr

--HG--
extra : rebase_source : 13c64026190afe5de25f540adb6deea9f518149f
2017-02-13 11:21:33 +08:00
Cameron McCormack
c041778642 Bug 1297899 - Part 1: Rename RestyleManager.{h,cpp} to GeckoRestyleManager.{h,cpp}. r=bholley
MozReview-Commit-ID: 1v0ufuGFtiD

--HG--
rename : layout/base/RestyleManager.cpp => layout/base/GeckoRestyleManager.cpp
rename : layout/base/RestyleManager.h => layout/base/GeckoRestyleManager.h
extra : rebase_source : 9e9432b1185697dc21eb23de93a09610a5a074bd
2017-02-13 11:21:30 +08:00
Daniel Holbert
452a3b8454 Bug 1339609: Add #include for gfxPrefs.h to all source code that calls gfxPrefs APIs. r=jgilbert
MozReview-Commit-ID: GxWehmDYB3t

--HG--
extra : rebase_source : cd994e5c6abf777f77c5a708cbfb2f6afc49a44c
2017-02-14 14:01:59 -08:00
cku
66ee16b6b0 Bug 1224207 - Part 7. (Main) Pass frame transform info down to nsFilterInstance. r=mstange
The biggest change is located in
nsFilterInstance::ComputeUserSpaceToFilterSpaceScale.

Originally, nsSVGUtils::GetCanvasTM is used. This function returns combination
of svg-transform, e.g. <rect transform="translate(30,40)" />, and
css-to-dev-scale-transform. That why we do not see this bug in a transformed
svg element.

For example, the following svg can be rendered correctly on FF:
<svg xmlns="http://www.w3.org/2000/svg">
<defs>
  <filter id="blurMe">
    <feGaussianBlur in="SourceGraphic" stdDeviation="1"/>
  </filter>
</defs>
  <!-- nsSVGUtils::GetCanvasTM return transform="scale(3)" correctly -->
  <text x="0" y="35" font-size="35" transform="scale(3)" filter="url(#blurMe)">
    Hello, out there
  </text>
</svg>

Unfortunately, this function does not report css-transform at all. So, I
replaced it by mPaintTransfom, which is passed from the caller. So now it's the
caller's responsibility to pass a UserSpace-To-DeviceSpace transform into
nsFilterInstance. And, we actually change the meaning of mPaintTransform in this
patch. Before this patch, mPaintTransform means css-to-dev-px scaling transform;
After this patch it means "userspace-to-filterspace-scaling * css-to-dev-scaling"
transform.

All the other modifictions are to respect the change in
nsFilterInstance::ComputeUserSpaceToFilterSpaceScale.

MozReview-Commit-ID: LwNUAMo98M

--HG--
extra : rebase_source : 4ed9fbd1493decef43b6d606d78c4dd23e975146
2017-02-07 11:51:34 +08:00
cku
2d91b08fdf Bug 1224207 - Part 6. Move GetCSSPxToDevPxMatrix to nsSVGUtils. r=mstange
To use GetCSSPxToDevPxMatrix in nsFilterInstance, pull this untility function down
to nsSVGUtils; Otherwise, we have to include nsSVGIntegrationUtils header in
nsFilterIntance, which is ok but not good I think.

MozReview-Commit-ID: 6SGtwj4EE1S

--HG--
extra : rebase_source : f75c904602f7f0f4ad0e4bdb5786c3a405a86be6
2017-01-24 23:22:43 +08:00
cku
3a2459d1e9 Bug 1224207 - Part 2. Fine tune RegularFramePaintCallback. r=mstange
1. Pass offset in device pixel unit instead of app unit.
2. Keep old context of the basic manager before replacing.

MozReview-Commit-ID: IoYFTU35aw6

--HG--
extra : rebase_source : b77c8e32d875fe69838904932e47bbee161c987a
2017-01-23 02:51:23 +08:00
cku
1223a2adfa Bug 1224207 - Part 1. Split SetupContext into ComputeEffectOffset and TranslateToUserSpace. r=mstange
We need ComputeEffectOffset along in the following patch.
MozReview-Commit-ID: GoIZ07IqoQ3

--HG--
extra : rebase_source : 54ad8ad25225a110b1cdf190d51df771386b7a26
2017-01-23 02:36:41 +08:00
Iris Hsiao
6fbbd6b7c2 Backed out 8 changesets (bug 1224207) for Win8 Reftest failures
Backed out changeset 2fce8d53b105 (bug 1224207)
Backed out changeset c31e96bf56d0 (bug 1224207)
Backed out changeset 587cde853b75 (bug 1224207)
Backed out changeset 7faefd871e00 (bug 1224207)
Backed out changeset 15f62c3ec366 (bug 1224207)
Backed out changeset 9448e628569e (bug 1224207)
Backed out changeset 958379e4f61c (bug 1224207)
Backed out changeset d23079bc188e (bug 1224207)
2017-02-08 17:53:07 +08:00
cku
66f91bc1e5 Bug 1224207 - Part 7. (Main) Pass frame transform info down to nsFilterInstance. r=mstange
The biggest change is located in
nsFilterInstance::ComputeUserSpaceToFilterSpaceScale.

Originally, nsSVGUtils::GetCanvasTM is used. This function returns combination
of svg-transform, e.g. <rect transform="translate(30,40)" />, and
css-to-dev-scale-transform. That why we do not see this bug in a transformed
svg element.

For example, the following svg can be rendered correctly on FF:
<svg xmlns="http://www.w3.org/2000/svg">
<defs>
  <filter id="blurMe">
    <feGaussianBlur in="SourceGraphic" stdDeviation="1"/>
  </filter>
</defs>
  <!-- nsSVGUtils::GetCanvasTM return transform="scale(3)" correctly -->
  <text x="0" y="35" font-size="35" transform="scale(3)" filter="url(#blurMe)">
    Hello, out there
  </text>
</svg>

Unfortunately, this function does not report css-transform at all. So, I
replaced it by mPaintTransfom, which is passed from the caller. So now it's the
caller's responsibility to pass a UserSpace-To-DeviceSpace transform into
nsFilterInstance. And, we actually change the meaning of mPaintTransform in this
patch. Before this patch, mPaintTransform means css-to-dev-px scaling transform;
After this patch it means "userspace-to-filterspace-scaling * css-to-dev-scaling"
transform.

All the other modifictions are to respect the change in
nsFilterInstance::ComputeUserSpaceToFilterSpaceScale.

MozReview-Commit-ID: LwNUAMo98M

--HG--
extra : rebase_source : eaae0570dcc0b8dea39f5d4b87f5e2920509053d
2017-02-07 11:51:34 +08:00
cku
0faeebe858 Bug 1224207 - Part 6. Move GetCSSPxToDevPxMatrix to nsSVGUtils. r=mstange
To use GetCSSPxToDevPxMatrix in nsFilterInstance, pull this untility function down
to nsSVGUtils; Otherwise, we have to include nsSVGIntegrationUtils header in
nsFilterIntance, which is ok but not good I think.

MozReview-Commit-ID: 6SGtwj4EE1S

--HG--
extra : rebase_source : ff6c6173c599afe630aa8b16330a0d1fc667ced8
2017-01-24 23:22:43 +08:00
cku
b3bfa5feb7 Bug 1224207 - Part 2. Fine tune RegularFramePaintCallback. r=mstange
1. Pass offset in device pixel unit instead of app unit.
2. Keep old context of the basic manager before replacing.

MozReview-Commit-ID: IoYFTU35aw6

--HG--
extra : rebase_source : 03c3b70c2c7f93acd1654fd4eefba602bfa2974d
2017-01-23 02:51:23 +08:00
cku
78af925e0a Bug 1224207 - Part 1. Split SetupContext into ComputeEffectOffset and TranslateToUserSpace. r=mstange
We need ComputeEffectOffset along in the following patch.
MozReview-Commit-ID: GoIZ07IqoQ3

--HG--
extra : rebase_source : d8750a067e436912643f351737d0bdb392036c50
2017-01-23 02:36:41 +08:00
cku
08b8ea9a74 Bug 1334554 - Handle the return value of nsFilterInstance::PaintFilteredFrame r=mstange
MozReview-Commit-ID: 79gddAmRjnp

--HG--
extra : rebase_source : a5652db96f271c5e367aedda1e2e607bec404fe4
2017-01-28 02:54:38 +08:00
cku
2ccbd7a896 Bug 1325038 - Part 1. Correct assertion logic. r=heycam
In the test case of bug 1324809:
1. A span is been broken into two continuation frames: FA and FB. FA is the first
connituation
2. Adding a filter effect to this span.
3. FA::FinishAndStoreOverflow is called. This function will call ComputeEffect:
  if (nsSVGIntegrationUtils::UsingEffectsForFrame(aFrame)) {
    aFrame->Properties().
    Set(nsIFrame::PreEffectsBBoxProperty(), new nsRect(r)); // Now FA has
                                                            // PreEffectsBBoxProperty
                                                            // but FB does not
                                                            // have yet.
    // ComputePostEffectsVisualOverflowRect will iterate all continuations from
    // FA to FB. At this moment, FB does not carry PreEffectsBBoxProperty,
    // assertion failure.
    r = nsSVGIntegrationUtils::ComputePostEffectsVisualOverflowRect(aFrame, r);
  }
4. FB::FinishAndStoreOverflow is called. But already too late.


MozReview-Commit-ID: 2c8OFzSLhfD
***
merge

MozReview-Commit-ID: C0lYQkKCYT6

--HG--
extra : rebase_source : d4777d5b60c9df78fd2ee1d734649b76579644c3
2017-01-12 16:38:48 +08:00
Phil Ringnalda
4ca465c687 Backed out 2 changesets (bug 1325038) for unexpected assertions in filter-on-continuation-box-ref.html
CLOSED TREE

Backed out changeset f1690763f5a4 (bug 1325038)
Backed out changeset 9d8c6f724256 (bug 1325038)
2017-01-11 19:21:14 -08:00
cku
0de5fe0f17 Bug 1325038 - Part 1. Correct assertion logic. r=heycam
In the test case of bug 1324809:
1. A span is been broken into two continuation frames: FA and FB. FA is the first
connituation
2. Adding a filter effect to this span.
3. FA::FinishAndStoreOverflow is called. This function will call ComputeEffect:
  if (nsSVGIntegrationUtils::UsingEffectsForFrame(aFrame)) {
    aFrame->Properties().
    Set(nsIFrame::PreEffectsBBoxProperty(), new nsRect(r)); // Now FA has
                                                            // PreEffectsBBoxProperty
                                                            // but FB does not
                                                            // have yet.
    // ComputePostEffectsVisualOverflowRect will iterate all continuations from
    // FA to FB. At this moment, FB does not carry PreEffectsBBoxProperty,
    // assertion failure.
    r = nsSVGIntegrationUtils::ComputePostEffectsVisualOverflowRect(aFrame, r);
  }
4. FB::FinishAndStoreOverflow is called. But already too late.


MozReview-Commit-ID: 2c8OFzSLhfD

--HG--
extra : rebase_source : ea159f1181dca12f69a38338d918e0c10f608793
2017-01-10 23:18:56 +08:00
cku
8ed218233f Bug 1323912 - Part 5. Apply opacity in mask layer painting path. r=mstange
MozReview-Commit-ID: HX2Tcum2smO

--HG--
extra : rebase_source : 2c2f96aa28e21f79b5fafe12fac8daa3fe89eb21
2017-01-03 17:12:32 +08:00
cku
b10b619355 Bug 1323912 - Part 4. Apply opacity in indirect image mask painting path. r=mstange
MozReview-Commit-ID: IKKKMccyMsO

--HG--
extra : rebase_source : 701d84e241ba36aeaa30b8d9946c79515969ae95
2017-01-03 16:35:17 +08:00
cku
7ffd5790e1 Bug 1323912 - Part 1. Rename PaintBackground to PaintStyleImageLayer. r=mstange
MozReview-Commit-ID: GWuII34t0j7

--HG--
extra : rebase_source : 4b08672f76c57562b9ab46d6605611d99aa64cf0
2017-01-03 11:57:13 +08:00
Iris Hsiao
53e5ead7ef Backed out changeset a44640701558 (bug 1323912) 2017-01-04 21:47:16 -05:00
Iris Hsiao
6989ec2d7a Backed out changeset a2f133998adf (bug 1323912) 2017-01-04 21:47:05 -05:00
Iris Hsiao
d569188dd7 Backed out changeset b3ad53915c5e (bug 1323912) 2017-01-04 21:47:01 -05:00
cku
8c03e0e5d4 Bug 1323912 - Part 5. Apply opacity in mask layer painting path. r=mstange
MozReview-Commit-ID: HX2Tcum2smO

--HG--
extra : rebase_source : 8a28c67b898efbea304d71709c0fd13e25632032
2017-01-03 17:12:32 +08:00
cku
1aaf3f65d2 Bug 1323912 - Part 4. Apply opacity in indirect image mask painting path. r=mstange
MozReview-Commit-ID: IKKKMccyMsO

--HG--
extra : rebase_source : aaaf45dacac16fae7dc1a05529125b195de1b3cd
2017-01-03 16:35:17 +08:00
cku
e36c492419 Bug 1323912 - Part 1. Rename PaintBackground to PaintStyleImageLayer. r=mstange
MozReview-Commit-ID: GWuII34t0j7

--HG--
extra : rebase_source : f74e9d242e2ef505790575cd12e0a58cc07ec44f
2017-01-03 11:57:13 +08:00
cku
ccf62e0161 Bug 1324174 - Simplify context management logic in nsSVGIntegrationUtils::PaintMask. r=mstange
MozReview-Commit-ID: BwPSFlfqN8e

--HG--
extra : rebase_source : b16bad5f5baee1a469237b72ea6a23c341ebdb25
2016-12-30 02:07:04 +08:00
cku
706f1d717e Bug 1314001 - (followup) give different color to different kind of mask. r=me
MozReview-Commit-ID: 5NtefGdSrUT

--HG--
extra : rebase_source : 2f1cbf149e6baa42829c6f50cb81c682865e2e81
2016-12-30 03:35:36 +08:00
Phil Ringnalda
419cda6127 Backed out changeset 6a9a6e524a7b (bug 1314001) for Windows -werror bustage
MozReview-Commit-ID: Gzhx80yqTnG
2016-12-28 22:00:49 -08:00
cku
50446c645c Bug 1314001 - (followup) give different color to different kind of mask. r=me
MozReview-Commit-ID: Ko9MyTzMhL2
2016-12-29 11:36:39 +08:00
cku
df51b78be9 Bug 1313276 - Part 2. Add comment for bug 1323912. r=mstange
MozReview-Commit-ID: CetQxWIr1sq

--HG--
extra : rebase_source : c5941bdbd076197b13f2474160b67b9923048974
extra : source : d306c622c34e8290dc22212928eed6e817f0c182
2016-12-16 12:52:21 +08:00
cku
bedd21d45a Bug 1313276 - Part 1. Draw clip-path-basic-shape onto mask layer. r=mstange
MozReview-Commit-ID: ICZiy84AFfi

--HG--
extra : rebase_source : 6a181c3d76d525b35bf3eae07c8f40cb9e1f2d95
extra : source : 9fe78d3eab3725c5838acf705843694c69197e05
2016-12-16 10:56:07 +08:00
Sebastian Hengst
8b13894203 Backed out changeset d539253e91ae (bug 1313276) for failing own test paint-on-maskLayer-1c.html on Android debug. r=backout 2016-12-22 20:16:20 +01:00
Sebastian Hengst
dc41e31e4c Backed out changeset d90a8fc45b74 (bug 1313276) 2016-12-22 20:15:40 +01:00
cku
8abbd30968 Bug 1313276 - Part 2. Add comment for bug 1323912. r=mstange
MozReview-Commit-ID: CetQxWIr1sq

--HG--
extra : rebase_source : 64d7bde4138773f7923166db7120fe4683d357bc
extra : source : d306c622c34e8290dc22212928eed6e817f0c182
2016-12-16 12:52:21 +08:00
cku
f2114f97f8 Bug 1313276 - Part 1. Draw clip-path-basic-shape onto mask layer. r=mstange
MozReview-Commit-ID: ICZiy84AFfi

--HG--
extra : rebase_source : 9862f64480946e08edaa9157f26f7e82fc8ea5a8
extra : source : 9fe78d3eab3725c5838acf705843694c69197e05
2016-12-16 10:56:07 +08:00
cku
d25e2f154e Bug 1324809 - Part 1. Fix wrong clip region while painting filter. r=mstange
MozReview-Commit-ID: Cqjo7VwtnlK

--HG--
extra : rebase_source : 0473eb6a9297d0cf0dee3e2e7b1e5f1ac8740bb1
2016-12-21 16:21:23 +08:00
cku
b8109179f1 Bug 1318266 - Part 1. Paint trivial clip-path onto mask layer. r=mstange
MozReview-Commit-ID: G2ghy7qGf5N

--HG--
extra : rebase_source : 3e090928ccc9ac58533162634f1269f76aba9131
2016-11-04 15:33:38 +08:00
Wes Kocher
aaaaf4e40c Backed out 5 changesets (bug 1318266) for clipboard leaks a=backout
Backed out changeset a6d9ee58afd9 (bug 1318266)
Backed out changeset 47b22189955a (bug 1318266)
Backed out changeset 936cc01602c4 (bug 1318266)
Backed out changeset 95d7547ad1c3 (bug 1318266)
Backed out changeset a4c80aed15d8 (bug 1318266)
2016-12-20 11:30:26 -08:00
cku
baf48e8a2b Bug 1318266 - Part 1. Paint trivial clip-path onto mask layer. r=mstange
MozReview-Commit-ID: G2ghy7qGf5N

--HG--
extra : rebase_source : b8e0c64cf251f09139cbd12c5e391daf4d0c949c
2016-11-04 15:33:38 +08:00