Commit Graph

418 Commits

Author SHA1 Message Date
Iulian Moraru
941a3e39e2 Backed out 4 changesets (bug 1796697) as per Daniel Holbert's request. CLOSED TREE
Backed out changeset f9d2d5f60fe9 (bug 1796697)
Backed out changeset b7ee22f54a6c (bug 1796697)
Backed out changeset d43777f8ef79 (bug 1796697)
Backed out changeset a2763d3ad250 (bug 1796697)
2022-10-30 23:06:57 +02:00
Daniel Holbert
01898a44b3 Bug 1798080 part 2: Add const annotation to some never-modified member-vars in SVGTextFrame's helper classes, to reflect reality. r=jfkthame
This patch doesn't impact behavior.

The new const annotations will help to simplify reasoning about these various
helper classes & what states they could possibly be in.

Differential Revision: https://phabricator.services.mozilla.com/D160695
2022-10-29 17:43:29 +00:00
Daniel Holbert
a663439150 Bug 1798080 part 1: Add MOZ_STACK_CLASS annotation to some text layout/painting classes, to reflect reality. r=jfkthame
This patch doesn't impact behavior; it's just adding an annotation to activate
a static analysis check for various classes.

The annotation gives us some confidence that these instances are tightly scoped
to a particular function-call.  This helps reduce concerns about to-what-extent
the affected classes might need to worry about the lifetimes of the objects
pointed to by their member-vars.

The specific classes I'm annotating are:

 - gfxTextRunDrawCallbacks and PaintTextParams, both of which have multiple
   subclasses, all of which will automatically inherit this annotation and
   benefit from it.

 - TextFrameIterator and CharIterator, two local utility classes in
   SVGTextFrame.cpp.

Differential Revision: https://phabricator.services.mozilla.com/D160694
2022-10-29 17:43:29 +00:00
Daniel Holbert
90d06cfd5d Bug 1796697 part 1: Update SVGTextFrame.cpp to use Maybe<> to represent an optionally-invalid gfxSkipCharsIterator. r=jfkthame
This patch shouldn't change behavior.

This lets us remove the rarely-used no-arg constructor for gfxSkipCharsIterator
in the next patch. (That constructor was an alternate representation of an
invalid gfxSkipCharsIterator; but the Maybe<> representation added here makes
things a bit easier to reason about.)

Differential Revision: https://phabricator.services.mozilla.com/D159902
2022-10-24 14:06:12 +00:00
Robert Longson
61d438af63 Bug 1696505 - stop SVG text reflows triggering other reflows r=jwatt
Differential Revision: https://phabricator.services.mozilla.com/D158912
2022-10-10 21:30:38 +00:00
Nicolas Silva
5a86ad27de Bug 1404086 - Early-out when the length adjust scale factor is zero. r=jfkthame
Differential Revision: https://phabricator.services.mozilla.com/D155834
2022-08-30 09:45:46 +00:00
Jeff Muizelaar
84b79d2679 Bug 1779602 - Remove nsImageGeometryMixin. r=tnikkel
nsImageGeometryMixin was disabled in bug 1776198. No problems have shown up
so let's get rid of it.

Differential Revision: https://phabricator.services.mozilla.com/D151864
2022-07-18 21:20:50 +00:00
Robert Longson
c8453138e0 Bug 1777671 - Account for glyph orientations when returning rotation of character r=jfkthame
Differential Revision: https://phabricator.services.mozilla.com/D150858
2022-07-06 06:01:22 +00:00
Jonathan Kew
f572678eca Bug 1765093 - patch 3 - Also use the new gfxTextRun::GetLineHeightMetrics to optimize GetAscentAndDescentInAppUnits. r=emilio
This accelerates web-exposed SVG APIs such as getExtentOfChar() by avoiding the expensive
MeasureText() call when we're just getting the line-height metrics.

Differential Revision: https://phabricator.services.mozilla.com/D145717
2022-05-07 13:12:00 +00:00
Jonathan Kew
dfb404bce9 Bug 1765093 - patch 1 - Avoid measuring entire textrun in SVGTextFrame's GetBaselinePosition function. r=dholbert
This aims to prevent an O(n^2) performance situation when per-glyph
positioning is in use.

This reduces the time to load the testcase here from around 70s to 17s
in my local build. Still not great, but at least it's less of a disaster.

Differential Revision: https://phabricator.services.mozilla.com/D145631
2022-05-07 13:11:59 +00:00
Cristian Tuns
534456190f Backed out 4 changesets (bug 1765093) for causing web-platform-test failures on boundary-shaping-010.html CLOSED TREE
Backed out changeset 4f24833ac254 (bug 1765093)
Backed out changeset 6e5b336588d1 (bug 1765093)
Backed out changeset 17d5218d84b7 (bug 1765093)
Backed out changeset bbc194412080 (bug 1765093)
2022-05-06 17:08:52 -04:00
Jonathan Kew
d01d1cbf7f Bug 1765093 - patch 3 - Also use the new gfxTextRun::GetLineHeightMetrics to optimize GetAscentAndDescentInAppUnits. r=emilio
This accelerates web-exposed SVG APIs such as getExtentOfChar() by avoiding the expensive
MeasureText() call when we're just getting the line-height metrics.

Differential Revision: https://phabricator.services.mozilla.com/D145717
2022-05-06 17:47:23 +00:00
Jonathan Kew
a9992bf2ae Bug 1765093 - patch 1 - Avoid measuring entire textrun in SVGTextFrame's GetBaselinePosition function. r=dholbert
This aims to prevent an O(n^2) performance situation when per-glyph
positioning is in use.

This reduces the time to load the testcase here from around 70s to 17s
in my local build. Still not great, but at least it's less of a disaster.

Differential Revision: https://phabricator.services.mozilla.com/D145631
2022-05-06 17:47:22 +00:00
David Shin
3bc7313e07 Bug 1755770 - Ensure TextRenderedRun::GetRunUserSpaceRect casts float to int without invoking Undefined Behavior r=dholbert
Differential Revision: https://phabricator.services.mozilla.com/D142223
2022-03-28 21:07:58 +00:00
Emilio Cobos Álvarez
9fd05b05c5 Bug 1751108 - Deal with nan context scale in SVGTextFrame::UpdateFontSizeScaleFactor. r=layout-reviewers,jfkthame
Depends on D139936

Differential Revision: https://phabricator.services.mozilla.com/D139937
2022-03-01 14:35:36 +00:00
Emilio Cobos Álvarez
a69cceb2fa Bug 1757230 - Add missing includes elsewhere to unbust hybrid builds.
MANUAL PUSH: Trivial orange fix CLOSED TREE
2022-02-26 01:08:16 +01:00
Emilio Cobos Álvarez
3bf68effee Bug 1753105 - Deal with negative letter-spacing in SVGTextFrame. r=jfkthame
Otherwise we can end up with a rect with negative width, bad stuff to
follow.

Differential Revision: https://phabricator.services.mozilla.com/D137881
2022-02-04 23:25:22 +00:00
Emilio Cobos Álvarez
dc15260cbc Bug 1746794 - Make more nsLayoutUtils functions SVG-text aware. r=layout-reviewers,jfkthame
This makes TransformPoint and TransformRect deal with SVG text
correctly. We need TransformPoint support so that GeometryUtils works as
expected, since we need to transform the points individually so that
stuff like transforms report the expected result (a rect doesn't cut it
for those).

Differential Revision: https://phabricator.services.mozilla.com/D135152
2022-01-28 16:50:14 +00:00
Robert Longson
9c9d8cfcc4 Bug 1730049 - correct dominant-baseline for vertical-rl r=jfkthame
Differential Revision: https://phabricator.services.mozilla.com/D125371
2021-09-15 08:52:32 +00:00
Cristian Tuns
6062cc3b3d Backed out changeset 373c4720d3ce (bug 1730049) for causing reftest failures on text-layout-10.svg. CLOSED TREE 2021-09-14 15:12:58 -04:00
Robert Longson
c2e0f487cb Bug 1730049 - correct dominant-baseline for vertical-rl r=jfkthame
Differential Revision: https://phabricator.services.mozilla.com/D125371
2021-09-14 15:05:46 +00:00
Matt Woodrow
445639539e Bug 1728232 - Remove RestoreState. r=miko
Differential Revision: https://phabricator.services.mozilla.com/D124006
2021-09-13 05:01:34 +00:00
criss
3f0efebda9 Backed out 10 changesets (bug 1714138, bug 1542929, bug 1728232, bug 1729236, bug 1728258, bug 1728251, bug 1728050) for causing bug 1424348 a=backout
Backed out changeset c5b71e6ce0e5 (bug 1729236)
Backed out changeset c6bcc4ed3d2e (bug 1729236)
Backed out changeset 7e292895282a (bug 1729236)
Backed out changeset d9ddd915e0c2 (bug 1714138)
Backed out changeset 82b98d2f0dcf (bug 1728258)
Backed out changeset 9a84a36b9dc4 (bug 1542929)
Backed out changeset 96be978630ff (bug 1728251)
Backed out changeset d7a8bf19d849 (bug 1728251)
Backed out changeset cce0c53b439f (bug 1728232)
Backed out changeset 3afd6aee7849 (bug 1728050)
2021-09-12 12:00:30 +03:00
Matt Woodrow
fd0279e72a Bug 1728232 - Remove RestoreState. r=miko
Differential Revision: https://phabricator.services.mozilla.com/D124006
2021-09-10 03:43:32 +00:00
Marian-Vasile Laza
da24ed0855 Backed out 7 changesets (bug 1728050, bug 1728251, bug 1728232, bug 1542929, bug 1714138, bug 1728258) for causing reftest failures. CLOSED TREE
Backed out changeset 41e053201cd3 (bug 1714138)
Backed out changeset 16ae9f5b4aa0 (bug 1728258)
Backed out changeset 414aa7ff05fe (bug 1542929)
Backed out changeset 7217ecf149c4 (bug 1728251)
Backed out changeset 405ff2ed2110 (bug 1728251)
Backed out changeset 3eec9e6c7218 (bug 1728232)
Backed out changeset 66038c15fe54 (bug 1728050)
2021-09-07 09:00:26 +03:00
Matt Woodrow
22423c85ea Bug 1728232 - Remove RestoreState. r=miko
Differential Revision: https://phabricator.services.mozilla.com/D124006
2021-09-06 23:12:03 +00:00
longsonr
d9d1666983 Bug 1695490 - Remove svg.text-spacing.enabled pref r=emilio
Backs out bug 1599173 which landed in Firefox 72. The pref has been enabled since bug 1600855 which landed in Firefox 73

Differential Revision: https://phabricator.services.mozilla.com/D106731
2021-02-28 21:52:21 +00:00
longsonr
f4bf57a0bc Bug 1693032 - SVG text reflow can flow through multiple outer svg elements r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D105350
2021-02-17 14:51:47 +00:00
Butkovits Atila
15cb93424e Backed out changeset 4b9a80f187e8 (bug 1693032) for causing failures on 1693032.html 2021-02-17 00:09:08 +02:00
longsonr
62aefa44bd Bug 1693032 - SVG text reflow can flow through multiple outer svg elements r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D105350
2021-02-16 21:06:55 +00:00
longsonr
8addf49d4a Bug 1691659 - don't re-enter ScheduleReflowSVG r=emilio
The testcase in the bug does assert under a debug Firefox here: https://searchfox.org/mozilla-central/source/layout/svg/SVGUtils.cpp#156 presumably fuzz testing has not uncovered this because of the mouse over part. I don't know how to write an automated test for this.

Note that scheduling a reflow will cause a repaint especially as we're setting state bits so we don't need to do a paint notify too.

Differential Revision: https://phabricator.services.mozilla.com/D104564
2021-02-13 07:45:31 +00:00
longsonr
e86a63d8bd Bug 1689799 - Ensure we move to the next path when displaying multiple adjacent textPaths r=emilio
reverts part of bug 1678756

Differential Revision: https://phabricator.services.mozilla.com/D103558
2021-01-30 21:35:17 +00:00
Mirko Brodesser
3cef08a463 Bug 1685303: part 10) Annotate nsFrameSelection::HandleClick with MOZ_CAN_RUN_SCRIPT. r=smaug
Differential Revision: https://phabricator.services.mozilla.com/D101598
2021-01-14 13:24:36 +00:00
Bogdan Tara
1bdc209f41 Backed out 4 changesets (bug 1685303) for bustage complaining about offsets CLOSED TREE
Backed out changeset a4640aac6619 (bug 1685303)
Backed out changeset bd2020c26531 (bug 1685303)
Backed out changeset 3f2e96b93f19 (bug 1685303)
Backed out changeset 8cf49a7677c9 (bug 1685303)
2021-01-14 12:58:25 +02:00
Mirko Brodesser
1454bdc35c Bug 1685303: part 10) Annotate nsFrameSelection::HandleClick with MOZ_CAN_RUN_SCRIPT. r=smaug
Differential Revision: https://phabricator.services.mozilla.com/D101598
2021-01-14 10:21:17 +00:00
longsonr
3419ef31ad Bug 1678756 - Check we don't run off the end of the textPath while skipping characters r=emilio
The textcase and reference differ by a single space.
We should check that we've not run off the end of the path while we're skipping characters
Also removes a redundant check presumably left over from some earlier refactoring.

Differential Revision: https://phabricator.services.mozilla.com/D97828
2020-12-05 21:05:41 +00:00
Butkovits Atila
575860a58b Backed out changeset 247ecae76586 (bug 1678756) for failures on gfxTextRun.h. CLOSED TREE 2020-12-04 18:16:29 +02:00
longsonr
3459fed0b7 Bug 1678756 - Check for new clusters or ligature groups in textPaths even in skipped characters r=emilio
The textcase and reference differ by a single space.
We should check for new clusters or ligature groups in textPaths even in skipped characters
Also removes a redundant check presumably left over from some earlier refactoring.

Differential Revision: https://phabricator.services.mozilla.com/D97828
2020-12-04 06:21:37 +00:00
Ting-Yu Lin
558d6cf95c Bug 1677635 Part 4 - Rename nsOverflowAreas to OverflowAreas, and move it into mozilla namespace. r=layout-reviewers,emilio
This patch is generated via the rename functionality in my editor; add
`mozilla::` prefix to `OverflowAreas` in headers; and remove the
`OverflowType` alias added in Part 1.

Differential Revision: https://phabricator.services.mozilla.com/D97235
2020-11-18 00:08:12 +00:00
longsonr
546f6db34c Bug 1677187 - ignore x values for vertical and y values for horizontal text in textPaths r=heycam
Differential Revision: https://phabricator.services.mozilla.com/D97086
2020-11-16 10:54:56 +00:00
longsonr
89afb7bb2f Bug 1603629 - fix dominant-baseline hanging and mathematical r=jfkthame
Differential Revision: https://phabricator.services.mozilla.com/D88877
2020-09-04 11:00:40 +00:00
longsonr
b78ddc699a Bug 1661912 - Convert remaining typedefs in SVG code to 'using' r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D88718
2020-08-29 14:24:37 +00:00
longsonr
cc1711d31a Bug 1459905 - Merge DOMSVGTranslatePoint and DOMSVGPoint and fix updates r=emilio
SVGSVGElement::SetCurrentScaleTranslate checks that things have changed but if we
manage to update both translate values before we get here then we'll skip the screen update
that we need.

Also
- introduces a tear off for SVGSVGElement.currentTranslate so we hand out the same object as required by the SVG idl
- removes SVGSVGElement::SetCurrentTranslate as dead code
- removes mPreviousScale and mPreviousTranslate from SVGSVGElement as they are no longer necessary

Differential Revision: https://phabricator.services.mozilla.com/D84796
2020-08-25 14:38:32 +00:00
Ting-Yu Lin
ede6f9503a Bug 1637130 - Rename visual overflow to ink overflow. r=dbaron
This patch is generated by:

```
# Rename the nsOverflowType enum.
rg -l "eVisualOverflow" layout/ gfx/ | xargs sed -i "s/eVisualOverflow/eInkOverflow/g"

# Rename and drop the "Get" prefix from various functions.
rg -l "GetVisualOverflowRect" layout/ gfx/ | xargs sed -i "s/GetVisualOverflowRect/InkOverflowRect/g"
rg -l "GetPreEffectsVisualOverflowRect" layout/ gfx/ | xargs sed -i "s/GetPreEffectsVisualOverflowRect/PreEffectsInkOverflowRect/g"
rg -l "GetVisualOverflowFromDeltas" layout/ gfx/ | xargs sed -i "s/GetVisualOverflowFromDeltas/InkOverflowFromDeltas/g"
rg -l "GetScrollableOverflowRect" layout/ gfx/ | xargs sed -i "s/GetScrollableOverflowRect/ScrollableOverflowRect/g"

# Rename, drop the "Get" prefix, and change the suffix "Area" to "Rect"
# (because they return nsRect) for the two methods in nsLineBox.
rg -l "GetVisualOverflowArea" layout/ gfx/ | xargs sed -i "s/GetVisualOverflowArea/InkOverflowRect/g"
rg -l "GetScrollableOverflowArea" layout/ gfx/ | xargs sed -i "s/GetScrollableOverflowArea/ScrollableOverflowRect/g"

# Rename rest of the functions and variables.
rg -l "VisualOverflow" layout/ gfx/ | xargs sed -i "s/VisualOverflow/InkOverflow/g"
rg -l "visual overflow" layout/ gfx/ | xargs sed -i "s/visual overflow/ink overflow/g"
rg -l "visualOverflow" layout/ gfx/ | xargs sed -i "s/visualOverflow/inkOverflow/g"
rg -l "visOverflow" layout/ gfx/ | xargs sed -i "s/visOverflow/inkOverflow/g"
rg -l "vis-overflow" layout/ gfx/ python/ | xargs sed -i "s/vis-overflow/ink-overflow/g"

./mach clang-format
```

Differential Revision: https://phabricator.services.mozilla.com/D84231
2020-07-20 20:17:36 +00:00
longsonr
ba1943ecf8 Bug 1259861 - Move everything else into the mozilla namespace in layout/svg r=dholbert
Also: adjust include paths to be consistent for usages of various SVG headers,
and remove unused SVG includes (mostly for "utils" classes),
and drop stray "ns" from already-renamed SVG classes in various code comments.

Differential Revision: https://phabricator.services.mozilla.com/D83140
2020-07-11 02:20:20 +00:00
longsonr
1cfaf8a73c Bug 1651404 - Move nsSVGDisplayableFrame and nsISVGSVGFrame to the mozilla namespace r=dholbert
Differential Revision: https://phabricator.services.mozilla.com/D82945
2020-07-09 18:34:54 +00:00
Ting-Yu Lin
73114fe7f7 Bug 1651171 - Convert NS_SUBTREE_DIRTY to an inline method of nsIFrame. r=jfkthame
This is a straightforward conversion except that
`NS_SUBTREE_DIRTY(this)` can be written terser as `IsSubtreeDirty()`.

Differential Revision: https://phabricator.services.mozilla.com/D82811
2020-07-09 18:29:15 +00:00
longsonr
0ac7d6cac5 Bug 1651289 - Move remaining SVG concrete frame classes to the mozilla namespace r=dholbert
Differential Revision: https://phabricator.services.mozilla.com/D82650
2020-07-09 01:33:33 +00:00
longsonr
0b67f822be Bug 1649739 - Move SVG paint server and clipPath classes to the mozilla namespace r=dholbert
Differential Revision: https://phabricator.services.mozilla.com/D81858
2020-07-07 13:49:30 +00:00
Kagami Sascha Rosylight
93741338a8 Bug 1630704 - Part 27: Remove nsFrame from inheritance chain r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D81864
2020-07-06 22:29:42 +00:00