Commit Graph

2865 Commits

Author SHA1 Message Date
cku
38afa468c3 Bug 1349462 - Part 2. one line for static function. r=jwatt
MozReview-Commit-ID: 9jVkHtLouVN

--HG--
extra : rebase_source : 8a512a93e562129475c68feba1e50f6b28edd37e
2017-03-23 16:53:47 +08:00
cku
a52259bf72 Bug 1349462 - Part 1. Rename IsSVGText as IsInSVGTextSubtree. r=heycam
MozReview-Commit-ID: LTo6c8tTtaf

--HG--
extra : rebase_source : bc6913c42cca141d7a3098fdd4dcc72fbf146b5a
2017-03-23 15:29:11 +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
cku
ea64988785 Bug 1348564 - Part 2. Crash test. r=jwatt
MozReview-Commit-ID: 6u7vqwFHynP

--HG--
extra : rebase_source : 4526bd541a39f822954ebc8949f95f376e422104
2017-03-21 18:27:28 +08:00
cku
e4f16b779e Bug 1348564 - Part 1. Fix crash in nsSVGUtils::GetBBox. r=jwatt
This change fixes the code so that it does not assume that frames with the
NS_FRAME_SVG_LAYOUT bit set implement nsISVGChildFrame. This assumption is
incorrect since there are many SVG frame types that do not inherit
nsISVGChildFrame (such as nsSVGGradientFrame).

MozReview-Commit-ID: 9dCZAhJk3E0

--HG--
extra : rebase_source : 346755b3215b38560ab57e87cf12585b4a869d65
2017-03-22 18:56:53 +08:00
cku
6f602b53e4 Bug 1348430 - Part 3. Correct mTargetBBoxInFilterSpace. r=mstange
I introduced ComputeTargetBBoxInFilterSpace[1] function in bug 1287492.
Two reasons that I think we should not clip filter boundary by viewport
in that function:
1. The patch in bug 1336480 can also fix bug 1287492 and is more correct.
2. That restriction cause wrong rendering result
  In this bug, reporter apply filter onto a path object in pattern element.
  Before the clipping applied in [1], the boundary of filter effects region is
    (x=-1, y=-1, width=10, height=10) in CSS units
  After clipping by svg viewport, the boundary turns out to be
    (x=0, y=0, width=9, height=9) in CSS units
  which is smaller then we need for filter painting. So we should stop clip the
  boundary by svg viewport. (Please refer to filter-in-pattern-02.svg in the next
  patch).

[1] https://hg.mozilla.org/mozilla-central/file/dbabc189256e/layout/svg/nsFilterInstance.cpp#l235

MozReview-Commit-ID: 2d14rnyWPJs

--HG--
extra : rebase_source : ca3a523c8ae95d166441690d5ee1def2ed56a550
2017-03-22 21:29:14 +08:00
cku
fca3b40aa9 Bug 1348430 - Part 2. Rename a local variable in nsSVGPatternFrame::PaintPattern. r=mstange
MozReview-Commit-ID: FIWQOHsC5o5

--HG--
extra : rebase_source : f1c3d0f3c81073ca5c57f6bd4482a061a56fc7a3
2017-03-21 23:40:36 +08:00
cku
21d49e1368 Bug 1348430 - Part 1. (Main) Correct value pass to nsFilterInstance::PaintFilteredFrame in nsSVGUtil. r=mstange
There are two places that use nsFilterInstance::PaintFilteredFrame. One is
nsSVGIntegrationUtil::PaintFilter, we do take care of it in bug 1224207.
Another path is at nsSVGUtils::PaintFrameWithEffects, apparently I missed that
path while working on bug 1224207.

MozReview-Commit-ID: K4MjKa4ZpCR

--HG--
extra : rebase_source : 46696b620b210348052fe554b15abf0c3adedc72
2017-03-20 01:30:32 +08:00
Jonathan Watt
e42cb4dd27 Bug 1349388, part 5 - Assert in AutoReferenceChainGuard's ctor that we didn't fail to break a loop. r=longsonr 2017-02-17 14:20:32 +00:00
Jonathan Watt
b70b72f418 Bug 1349388, part 4 - Allow a single instance of AutoReferenceLimiter to guard against both reference loops and long reference chains. r=longsonr
--HG--
rename : layout/svg/AutoReferenceLimiter.h => layout/svg/AutoReferenceChainGuard.h
2017-02-17 13:15:18 +00:00
Jonathan Watt
618c7360e8 Bug 1349388, part 3 - Provide AutoReferenceLimiter with a default maximum reference chain length. r=longsonr 2017-02-16 11:18:33 +00:00
Jonathan Watt
6f850d0f40 Bug 1349388, part 2 - Add guard to AutoReferenceLimiter to prevent it being used as a temporary. r=longsonr 2017-02-16 10:31:03 +00:00
Jonathan Watt
78209c36d4 Bug 1349388, part 1 - Make AutoReferenceLimiter report long reference chains and reference loops to the console. r=longsonr 2017-02-16 10:26:39 +00:00
Timothy Nikkel
ca076ee1dd Bug 1346501. Don't mark every image as visible when a frame is created for it. r=mats
This is a bug from https://hg.mozilla.org/mozilla-central/rev/2d171d75b746 (bug 1157546). It took a shortcut in trying to get around one of the downsides of tracking visibility on frames instead of content nodes.

We cannot get our primary frame during FrameCreate calls because FrameCreate is called during the frame's Init() function, which happens before the primary frame pointer is set.

So when TrackImage is called from FrameCreate |frame| will be null but mFrameCreateCalled will be true. So we won't hit the early return that tries to detect nonvisible images.

The comment being removed is just wrong. We can obtain a frame for <feImage> just as well as any other image type.

The thing that is different about <feImage> is that it calls IncApproximateVisibleCount() followed by FrameCreated() in the frame's Init() function. This means that the frame is marked visible at the time of the FrameCreated, and there will be no further calls to TrackImage (because there are no further changes). So the FrameCreated call is the last chance to mark this image visible. The regressing changeset tries to get around this by just considering the image visible whenever we know a frame exists (because of mFrameCreateCalled) but can't access it. This ends up affecting all types of images, not just <feImage>.

The above paragraph is also true for SVG <image> that are non-display.
2017-03-22 00:32:48 -05: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
cku
ff59d84e8f Bug 1349115 - Remove gfxPattern::CairoStatus r=mstange
This function is not a virtual function and always returns CAIRO_STATUS_SUCCESS
after the patch in bug 1054838 landed. There is no reason to keep it anymore.

MozReview-Commit-ID: EadrrFQyjfY

--HG--
extra : rebase_source : 3f6a284dc9fa396d5cfd3f64190562373801a0a2
2017-03-21 14:32:22 +08: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
Sebastian Hengst
e35416592f Backed out changeset a46f3da8aba6 (bug 1345853) 2017-03-17 21:53:24 +01:00
cku
3d3a05d1ee Bug 1345853 - Part 2. If the transform matrix is singular, return DrawResult::SUCCESS, instead of DrawResult::BAD_ARGS r=tnikkel
According to bug 1345853 comment 5, tn said:
You probably want to return whatever was drawn there regardless of the
DrawResult. SVGMaskFrame has the same problem. Keep in mind that DrawResult is
only reporting on how drawing of any images went, not the drawing of anything
else. Also looking over the patches from bug 1258510 I see a couple places where
BAD_ARGS is returned if the transform matrix is singular. We would want to
return SUCCESS in that case I think, because we drew what we were instructed to
draw.

MozReview-Commit-ID: 5XcDuKQwXTJ

--HG--
extra : rebase_source : ba764df599844c9eb179736f61d6c7f6ee46c9fc
2017-03-16 12:06:36 +08: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
62104073dc Bug 1343664 - Part 1. Correct transform matrix. r=mstange
MozReview-Commit-ID: Eg6i4SoSPoe

--HG--
extra : rebase_source : d2a5dea5d614e56e673828eb7bd91f736309b8cc
2017-03-06 15:25:29 +08:00
Boris Zbarsky
1081d17998 Bug 1347411 part 7. Change stylo to correctly recompute style of SVG anonymous wrapper boxes. r=heycam
This handles ::-moz-svg-marker-anon-child and ::-moz-svg-outer-svg-anon-child.

MozReview-Commit-ID: 8FcYeDG1CKZ
2017-03-15 14:00:44 -04:00
Boris Zbarsky
784eb8f590 Bug 1347411 part 2. Fix stylo to properly update styles for the various frames that use FCDATA_WITH_WRAPPING_BLOCK to wrap an anonymous block around their kids. r=heycam
This handles ::-moz-button-content, ::-moz-html-canvas-content, ::-moz-svg-text,
::-moz-svg-foreign-content.

MozReview-Commit-ID: 3xk7214X2uR
2017-03-15 14:00:43 -04: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
Ting-Yu Lin
1923f5a65b Bug 1326409 Part 4 - Extract a function to compute polygon vertices. r=dholbert
MozReview-Commit-ID: B4BzBHjLHxW
2017-03-13 12:03:40 +08:00
Jonathan Watt
ca0876480e Bug 1345841 - Stop using Maybe<const T>. r=mats 2017-02-07 11:52:22 +00:00
Jonathan Watt
6bb704eb39 Bug 1058040, part 13 - Fix an uninitialized memory bug in SVGImageContext's default ctor. r=dholbert 2017-02-03 22:21:04 +00:00
Jonathan Watt
94608339b3 Bug 1058040, part 12 - Make SVGImageContext's ctor's aViewportSize parameter optional. r=dholbert 2017-01-30 13:25:00 +00:00
Daniel Holbert
48bd77677c Bug 1345202 part 3: Add a few more required 'using' and #include statements in layout/svg. r=TYLin
Specifically:
 - SVGGeometryFrame.cpp has several uses the type SVGGeometryElement which is
   really mozilla::dom::SVGGeometryElement. So I'm adding a 'using' decl for
   the 'mozilla::dom' namespace (and I'm dropping a now-unnecessary explicit
   dom:: prefix from another type there).
 - SVGImageContext.cpp calls several functions on nsIFrame (PresContext() &
   StyleSVG() at least). So I'm adding an #include for nsIFrame.h.
 - nsSVGMarkerFrame.cpp uses the type SVGGeometryFrame, which is really
   mozilla::SVGGeometryFrame. So I'm adding a 'using' decl for
   the 'mozilla' namespace.

MozReview-Commit-ID: AlCrocHhPtr

--HG--
extra : rebase_source : 8fe64f35179954813c00188587e0d7724f17791c
2017-03-07 20:10:29 -08:00
Daniel Holbert
2fcc3e7e4f Bug 1345202 part 2: Add "using namespace mozilla::image" to all layout/svg/*.cpp files that use the DrawResult type. r=TYLin
(DrawResult is really mozilla::image::DrawResult.)

MozReview-Commit-ID: 77OMdTEfibV

--HG--
extra : rebase_source : 75f6f616e5f99b00a81219ce93e0fdb28e84fe92
2017-03-07 20:07:00 -08:00
Daniel Holbert
31976f3092 Bug 1345202 part 1: Add missing mozilla:: namespace prefixes in layout/svg/*.h. r=TYLin
These only build successfully (in unified mode) right now because they're lucky
enough to pick up a "using namespace mozilla;" declaration from a .cpp file
earlier in their unified compilation unit.

MozReview-Commit-ID: JylaTtjdSZu

--HG--
extra : rebase_source : 5233e0322556f2494745fa6ece6ea0fd6af23fec
2017-03-07 20:06:25 -08:00
cku
6a92a74443 Bug 1345052 - Remove EffectProperties::MightHaveNoneSVGMask. r=heycam
MozReview-Commit-ID: 3WFAjwhBkDp

--HG--
extra : rebase_source : 1840ab0b7d156e4ff6e65ebe1f6127e5975ac6ac
2017-03-07 17:01:31 +08:00
Boris Zbarsky
5f864e31c5 Reenable several crashtests that no longer crash or leak or time out with stylo. No bug, r=bzbarsky
MozReview-Commit-ID: 88XjZyn4mnv
2017-02-24 15:22:37 -05:00
Carsten "Tomcat" Book
afda854868 Merge mozilla-central to mozilla-inbound 2017-02-23 15:28:43 +01:00
Carsten "Tomcat" Book
e6b82618f4 merge mozilla-inbound to mozilla-central a=merge 2017-02-23 14:59:37 +01:00
cku
3edceb1620 Bug 1224207 - (followup) remove an unused local var. r=me
MozReview-Commit-ID: B7MJkHS1S88

--HG--
extra : rebase_source : 73b3a175baf4752d7df53d090e5c39eeb4150afd
2017-02-23 17:08:17 +08:00
Timothy Nikkel
442d47eb2c Bug 1341881. Don't do sync decode for SVG <image> elements images. r=aosmond
SVG <image> elements have approximately the same level of visibility tracking as regular html <img>s so we shouldn't need to do sync decode. It shows up in some profiles.

The comment being removed was written a long time ago, before image visibility tracking for one.

We could even go a step further and ask for no sync decoding at all, but one step at a time to make sure this doesn't cause any regressions.
2017-02-22 18:58:42 -06:00
Wes Kocher
b7294d3167 Merge inbound to central, a=merge
MozReview-Commit-ID: 2R3yE5OIznC
2017-02-22 15:01:04 -08:00
Daniel Holbert
2bf2cfcd23 (no bug) Tweak some source files in layout to have correct number of newline characters at the end (exactly 1). (no review, whitespace-only, DONTBUILD)
MozReview-Commit-ID: 1hEEkCMy0pL
2017-02-22 08:58:50 -08:00
Wes Kocher
13e1cccb3f Merge inbound to central, a=merge
MozReview-Commit-ID: EEMZdLCheAm
2017-02-21 17:35:01 -08:00
cku
cfc6e5755f Bug 1336905 - Part 1. Remove StyleShapeSource's template argument. r=heycam,TYLin
MozReview-Commit-ID: FHTwGyXHsce

--HG--
extra : rebase_source : c043e4790bc2c84e4f3735a95c8ef0d9aa268986
extra : source : fb3c04effbd191767b1ff3e46c3c2d416ac8ee37
2017-02-21 23:26:17 +08:00
Ting-Yu Lin
8f840dc923 Bug 775624 Part 22 - Remove NS_FRAME_COMPLETE. r=dholbert
This patch is written by the following script with some manual adjustment to
the comment in nsRubyTextContainerFrame.cpp and nsRubyFrame.cpp, and
nsColumnSetFrame's constructor.

function rename() {
find layout\
     -type f\
     \( -name "*.cpp" -or\
        -name "*.h" \)\
        -exec sed -i -r "s/$1/$2/g" "{}" \;
}

rename "nsReflowStatus *([a-zA-Z0-9]*) = NS_FRAME_COMPLETE" "nsReflowStatus \1"
rename "([a-zA-Z0-9.*]*) *= NS_FRAME_COMPLETE;" "\1.Reset();"
rename "([a-zA-Z0-9.*]*) == NS_FRAME_COMPLETE" "\1.IsEmpty()"

MozReview-Commit-ID: 9tqQAHvdQex

--HG--
extra : rebase_source : 3119776946dc2c8350098b7bf9f3ceff29bdffb5
2017-02-14 17:55:48 +08:00
cku
dc40936bd9 Bug 1336480 - Part 1. Apply suface limitation in nsFilterInstance::ComputeNeededBoxes. r=mstange
There is no need to limit output space bounds in
nsFilterInstance::OutputFilterSpaceBounds(), it's just far too early.
MozReview-Commit-ID: 9i9huKDGxq6

--HG--
extra : rebase_source : 3f7a16fe27f661e79087c6a302235b01f65169d5
2017-02-21 00:08:38 +08:00
Boris Zbarsky
96054e12cc Bug 1324661 part 1. When recreating style contexts for elements in stylo, use the right frame (not the primary frame!) for tables. r=bholley,emilio
For a table, the primary frame is the table wrapper anonymous box.  That
anonymous box inherits style from its _child_ table frame, which is the frame that
has the actual style for the element.  So we want to use the stylo-computed
style for the table frame, and then compute an updated style for the table
wrapper too, because some things (like absolute positioning) are done for the
table wrapper anonymous box, not the table frame.
2017-02-17 14:52:39 -05: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
Carsten "Tomcat" Book
f3b2544de0 Merge mozilla-central to autoland 2017-02-16 13:20:11 +01:00
Carsten "Tomcat" Book
b218b4c6ae merge mozilla-inbound to mozilla-central a=merge 2017-02-16 13:15:55 +01:00
Ting-Yu Lin
961a315c82 Bug 1326407 Part 2 - Extract a function to compute inset radii. r=dbaron
MozReview-Commit-ID: 3XbfW40AJCI

--HG--
extra : rebase_source : 074d5110759ff6ec4632104109d9a11d01d9cbf7
2017-02-16 10:51:48 +08:00
Ting-Yu Lin
3c289a249f Bug 1326407 Part 1 - Extract a function to compute inset rect. r=dbaron
MozReview-Commit-ID: DmVOVArtzBZ

--HG--
extra : rebase_source : 835edd63d53cb439f4ebcd0551a2d4a8065f1ba6
2017-02-16 10:51:47 +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