Commit graph

1464 commits

Author SHA1 Message Date
Emilio Cobos Álvarez
211344891a Bug 1645132 - Use NSToCoordCeilClamped to prevent overflow when laying out very big text nodes. r=jfkthame
The test in D79145 hits a negative isize assertion because of this.

Differential Revision: https://phabricator.services.mozilla.com/D79328
2020-06-11 18:18:45 +00:00
Emilio Cobos Álvarez
ef3d21048d Bug 1640623 - Use enum classes for LookAndFeel int and float IDs. r=jmathies,geckoview-reviewers,esawin
Differential Revision: https://phabricator.services.mozilla.com/D76694
2020-06-11 11:27:43 +00:00
Jonathan Kew
90eb219457 Bug 1643126 - When measuring text, don't include letter-spacing on a preformatted newline character. r=heycam
Differential Revision: https://phabricator.services.mozilla.com/D78603
2020-06-09 08:52:10 +00:00
Shishir Jaiswal
09db33e848 Bug 1634911 - Simplify loops over lines in block layout to use ranged for. r=emilio
- Fixed wrong 'line' comparison
- Fixed clang-tidy warning
- Addressed the final review comments.
- Fixed the build failures happening in DEBUG mode. Had to revert the range based for loop usage at one place.

Differential Revision: https://phabricator.services.mozilla.com/D75673
2020-05-20 10:38:40 +00:00
Dorel Luca
20db993541 Backed out changeset 39dff7adfc30 (bug 1634911) for build bustage in layout/generic/nsBlockFrame.cpp. CLOSED TREE 2020-05-19 20:10:12 +03:00
Shishir Jaiswal
ddcf08c7d4 Bug 1634911 - Simplify loops over lines in block layout to use ranged for. r=emilio
- Fixed clang-tidy warning
- Addressed the final review comments.
- Fixed the build failures happening in DEBUG mode. Had to revert the range based for loop usage at one place.

Differential Revision: https://phabricator.services.mozilla.com/D75673
2020-05-19 16:54:02 +00:00
Mirko Brodesser
9b384325c1 Bug 1633448: part 2) Rename nsFrameSelection::GetTableCellSelection to IsInTableSelectionMode. r=smaug
Depends on D72688

Differential Revision: https://phabricator.services.mozilla.com/D72689
2020-04-27 19:34:53 +00:00
Emilio Cobos Álvarez
8cfb840466 Bug 1627643 - Allow to find and display selection native anonymous content. r=jfkthame
The check for generated content in nsTextFrame is to the best of my
knowledge useless: We don't display generated content as selected when
the parent is selected anyhow, and the offsets would be wrong.

We special-case text inputs and textarea because of ::placeholder, see
the comment, but otherwise there's no reason you shouldn't be able to
find-in-page generated content / fallback / etc.

I added ForceBreakBetween so as to not create ranges that span across
shadow / anonymous content boundaries. They don't work anyway (see the
TODO in test_find.html), so it seems better to make that explicit until
we properly handle them (bug 1590379).

I added a pref just to be safe since this is long-standing behavior, but
I think it should be uncontroversial.

Differential Revision: https://phabricator.services.mozilla.com/D72447
2020-04-27 13:56:04 +00:00
Simon Giesecke
191a830575 Bug 1628715 - Part 7: Add MOZ_NONNULL_RETURN to infallible nsTArray::AppendElements. r=xpcom-reviewers,necko-reviewers,nika,valentin
Differential Revision: https://phabricator.services.mozilla.com/D70831
2020-04-24 13:31:14 +00:00
Jonathan Kew
3751d26654 Bug 425915 - Use complex line breaker to identify word boundaries in SEAsian languages without interword spaces. r=m_kato
Differential Revision: https://phabricator.services.mozilla.com/D71206
2020-04-23 14:18:08 +00:00
Botond Ballo
54e45ef6b0 Bug 1629732 - Fix non-unified build errors in layout/generic. r=tnikkel
Differential Revision: https://phabricator.services.mozilla.com/D71122

--HG--
extra : moz-landing-system : lando
2020-04-16 00:52:02 +00:00
Ting-Yu Lin
5610a9711b Bug 1627398 Part 1 - Convert nsIFrame::List flags to EnumSet. r=heycam
Differential Revision: https://phabricator.services.mozilla.com/D69914

--HG--
extra : moz-landing-system : lando
2020-04-08 00:22:19 +00:00
Mirko Brodesser
33bac859bb Bug 1626665: part 3) Declare more methods around nsTextFrame const. r=hsivonen
Differential Revision: https://phabricator.services.mozilla.com/D69573

--HG--
extra : moz-landing-system : lando
2020-04-06 08:36:30 +00:00
Mirko Brodesser
69c90a4e03 Bug 1626665: part 2) Declare some methods in ClusterIterator const. r=hsivonen
Depends on D69225

Differential Revision: https://phabricator.services.mozilla.com/D69357

--HG--
extra : moz-landing-system : lando
2020-04-03 05:26:25 +00:00
Mirko Brodesser
2fd410ffa9 Bug 1626665: declare some methods around nsTextFrame const or static. r=hsivonen
Differential Revision: https://phabricator.services.mozilla.com/D69225

--HG--
extra : moz-landing-system : lando
2020-04-03 05:26:07 +00:00
André Bargull
9ad58ea608 Bug 1625138 - Part 13: Replace mozilla::IsUnsigned with std::is_unsigned. r=froydnj
Differential Revision: https://phabricator.services.mozilla.com/D68368

--HG--
extra : moz-landing-system : lando
2020-03-28 13:57:14 +00:00
Mirko Brodesser
16d65c131f Bug 1623858: part 6) Use switch statement in nsTextPaintStyle::InitSelectionColorsAndShadow. r=smaug
Depends on D67644

Differential Revision: https://phabricator.services.mozilla.com/D67806

--HG--
extra : moz-landing-system : lando
2020-03-23 10:47:08 +00:00
Mirko Brodesser
8c66344a6d Bug 1623858: part 1) Rename nsINode::IsSelectionDescendant to nsINode::IsMaybeSelected. r=smaug
More accurate.

Differential Revision: https://phabricator.services.mozilla.com/D67599

--HG--
extra : moz-landing-system : lando
2020-03-20 14:27:39 +00:00
Simon Giesecke
8aa47bcfb7 Bug 1613985 - Use default for equivalent-to-default constructors/destructors in layout. r=dholbert
Differential Revision: https://phabricator.services.mozilla.com/D66016

--HG--
extra : moz-landing-system : lando
2020-03-17 09:38:32 +00:00
Ting-Yu Lin
afe9123179 Bug 1622008 Part 3 - Remove nsPresContext* and PresShell* from the argument list of some continuing-frame-creation methods. r=dholbert
Both PresShell() and PresContext() are cached in nsIFrame. This
simplifies the setup for the callers to
nsCSSFrameConstructor::CreateContinuingFrame().

Differential Revision: https://phabricator.services.mozilla.com/D66600

--HG--
extra : moz-landing-system : lando
2020-03-12 21:50:23 +00:00
Andrew Osmond
91b071ed14 Bug 1618345 - Enforce proper color management by splitting gfx::Color into sRGBColor and DeviceColor types. r=jrmuizel
gfx::Color is currently misused in many places. The DrawTargets expect
the color space to be in device space, e.g. what we are actually going
to draw using. Everything sitting above generally deals with sRGB, as
specified in CSS. Sometimes we missed the conversion from sRGB to device
space when issuing draw calls, and similarly sometimes we converted the
color to device space twice.

This patch splits the type in two. sRGBColor and DeviceColor now
represent sRGB and device color spaces respectively. DrawTarget only
accepts DeviceColor, and one can get a DeviceColor from an sRGBColor via
the ToDeviceColor helper API. The reftests now pass with color
management enabled for everything (e.g. CSS) instead of just tagged
raster images.

There will be a follow up patch to enable color management everywhere by
default on all supported platforms.

Differential Revision: https://phabricator.services.mozilla.com/D64771

--HG--
extra : moz-landing-system : lando
2020-03-09 14:16:17 +00:00
Sylvestre Ledru
ca6530131a Bug 1519636 - Reformat recent changes to the Google coding style r=Ehsan,kvark
# ignore-this-changeset

Differential Revision: https://phabricator.services.mozilla.com/D63787

--HG--
extra : moz-landing-system : lando
2020-02-24 15:33:38 +00:00
Emilio Cobos Álvarez
5e65211744 Bug 1617472 - Use enums for text-align / text-align-last. r=jfkthame
This also fixes some backwards logic in nsBlockFrame::ReflowDirtyLines, and adds
some static assertions to nsGenericHTMLElement that almost cause a very subtle
bug.

Depends on D63792

Differential Revision: https://phabricator.services.mozilla.com/D63793

--HG--
extra : moz-landing-system : lando
2020-02-24 13:32:57 +00:00
Emilio Cobos Álvarez
fff63130d9 Bug 1617421 - Use cbindgen for cursors. r=jwatt
Pretty straight-forward.

Differential Revision: https://phabricator.services.mozilla.com/D63777

--HG--
extra : moz-landing-system : lando
2020-02-23 13:07:30 +00:00
Masayuki Nakano
351bd16f96 Bug 1615532 - Make line style in TextRangeStyle an enum class and sync it with GeckoEditable.IME_RANGE_LINE_* r=m_kato
At bug 1614208, the line style value mapping was changed, but
`GeckoEditable.IME_RANGE_LINE_*` are not updated.

This patch makes the style in `TextRangeStyle` an enum class for making it
type safer, and updates `GeckoEditable.IME_RANGE_LINE_*`, and finally, adds
`FYI` comments in `TextRangeStyle` to make developers realize it requires
manual update.

Differential Revision: https://phabricator.services.mozilla.com/D62883

--HG--
extra : moz-landing-system : lando
2020-02-17 07:53:46 +00:00
Simon Giesecke
b50347f917 Bug 1611415 - Prefer using std::move over forget. r=froydnj
Differential Revision: https://phabricator.services.mozilla.com/D60980

--HG--
extra : moz-landing-system : lando
2020-02-13 14:38:48 +00:00
shindli
91aa0518dd Backed out changeset 0c982bc69cb3 (bug 1611415) for causing build bustages in /builds/worker/workspace/build/src/obj-firefox/dist/include/nsCOMPtr CLOSED TREE 2020-02-12 20:13:29 +02:00
Simon Giesecke
f604a47fa5 Bug 1611415 - Applied FixItHints from mozilla-non-std-move. r=froydnj
Differential Revision: https://phabricator.services.mozilla.com/D60980

--HG--
extra : moz-landing-system : lando
2020-02-12 17:24:41 +00:00
Emilio Cobos Álvarez
49abab29a5 Bug 1614208 - Remove nsStyleConsts usage from TextRange.h. r=masayuki
Differential Revision: https://phabricator.services.mozilla.com/D62172

--HG--
extra : moz-landing-system : lando
2020-02-11 01:23:12 +00:00
Emilio Cobos Álvarez
69c87f6cb2 Bug 1613349 - Rename nsINode::DeleteProperty to RemoveProperty. r=smaug
And the related methods as well.

Differential Revision: https://phabricator.services.mozilla.com/D61768

--HG--
extra : moz-landing-system : lando
2020-02-06 16:06:49 +00:00
Emilio Cobos Álvarez
c5c0ef9787 Bug 1613349 - Rename nsIFrame::DeleteProperty to RemoveProperty. r=dholbert
As it doesn't necessarily call delete and that may be confusing.

Differential Revision: https://phabricator.services.mozilla.com/D61764

--HG--
extra : moz-landing-system : lando
2020-02-06 16:06:49 +00:00
Emilio Cobos Álvarez
bf6256b1fc Bug 1613349 - Make nsIFrame::TakeProperty MOZ_MUST_USE. r=dholbert
Depends on D61756

Differential Revision: https://phabricator.services.mozilla.com/D61757

--HG--
extra : moz-landing-system : lando
2020-02-06 00:39:10 +00:00
Emilio Cobos Álvarez
bba367ec8f Bug 1613349 - Rename nsIFrame::RemoveProperty to nsIFrame::TakeProperty. r=dholbert
This is hopefully clearer naming.

Differential Revision: https://phabricator.services.mozilla.com/D61755

--HG--
extra : moz-landing-system : lando
2020-02-06 00:13:38 +00:00
Emilio Cobos Álvarez
c413ac1229 Bug 1613572 - Restore the meaning of text-decoration-thickness: auto. r=jfkthame
While using always the underline thickness seemed ok when I reviewed the
regressing bug, it seems it's not always fine to use the font-provided value.

At least I see the same thing as
https://bugzilla.mozilla.org/show_bug.cgi?id=1613285#c0 it in two different
(though similarly configured, in fairness) Linux machines.

Keep `auto` meaning the slightly different thing that it used to mean, and use
`from-font` for the underline thickness (though there's at least one case where
`from-font` could maybe be the `strikeOutSize`... wdyt?).

In particular, for spell-checking markers, we have a somewhat bespoke
`ComputeSelectionUnderlineHeight`...

Differential Revision: https://phabricator.services.mozilla.com/D61781

--HG--
extra : moz-landing-system : lando
2020-02-06 08:41:54 +00:00
Emilio Cobos Álvarez
4ce82f5a4c Bug 1613285 - Reintroduce the skip-ink mitigation lost during bug 1612822. r=jfkthame
I should've caught this during review, sorry :(

Differential Revision: https://phabricator.services.mozilla.com/D61649

--HG--
extra : moz-landing-system : lando
2020-02-05 16:14:57 +00:00
Jonathan Kew
ab65dd885f Bug 1612822 - Refactor text decoration offset/thickness computations. r=emilio
We replace SetWidthIfLength and SetOffsetIfLength with ComputeDecorationLine{Thickness,Offset} functions,
and consolidate more of the computation of the offset within this function to simplify callers.

Differential Revision: https://phabricator.services.mozilla.com/D61454

--HG--
extra : moz-landing-system : lando
2020-02-03 14:38:47 +00:00
Jonathan Kew
4a153d86a2 Bug 1607308 - Move the from-font value from text-underline-offset to text-underline-position, as per recent spec changes, and fix interaction between position and offset. r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D59778

--HG--
extra : moz-landing-system : lando
2020-02-03 14:38:28 +00:00
Jonathan Kew
aa8ee28de1 Bug 1607534 - Support percentage values for the CSS text-decoration-thickness and text-underline-offset properties. r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D59777

--HG--
extra : moz-landing-system : lando
2020-02-03 14:21:32 +00:00
Ciure Andrei
141db422c6 Backed out 2 changesets (bug 1607308, bug 1607534) for causing text-decoration-underline-position-vertical-ja.html to permafail CLOSED TREE
Backed out changeset e55052ed4064 (bug 1607308)
Backed out changeset 280bd106d48a (bug 1607534)
2020-02-03 16:17:02 +02:00
Jonathan Kew
8b019300fc Bug 1607308 - Move the from-font value from text-underline-offset to text-underline-position, as per recent spec changes, and fix interaction between position and offset. r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D59778

--HG--
extra : moz-landing-system : lando
2020-02-03 11:12:16 +00:00
Jonathan Kew
1ee6b76d7d Bug 1607534 - Support percentage values for the CSS text-decoration-thickness and text-underline-offset properties. r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D59777

--HG--
extra : moz-landing-system : lando
2020-02-03 11:11:52 +00:00
Mirko Brodesser
2abd6d5a82 Bug 1609662: part 16) Move nsRange::IsNodeSelected to nsINode::IsSelected. r=smaug
Make it const-correct too.

Differential Revision: https://phabricator.services.mozilla.com/D60643

--HG--
extra : moz-landing-system : lando
2020-01-27 09:25:00 +00:00
Mirko Brodesser
ab604ca294 Bug 1609662: part 11) Rename nsTextFrame::SetSelectedRange and add nsIFrame::SelectionStateChanged. r=emilio,smaug
Differential Revision: https://phabricator.services.mozilla.com/D60157

--HG--
extra : moz-landing-system : lando
2020-01-21 16:01:45 +00:00
Emilio Cobos Álvarez
5cd5e6f148 Bug 1609996 - Remove mozilla::Swap in favor of std::swap. r=froydnj
Now mfbt/Move.h is empty except for that excellent comment about move
semantics... Should we put it somewhere else and delete the header as a
follow-up? Or just delete the header and carry on?

Differential Revision: https://phabricator.services.mozilla.com/D60297

--HG--
extra : moz-landing-system : lando
2020-01-20 16:17:06 +00:00
Jonathan Kew
c1274a33d3 Bug 1609730 - Don't apply text-underline-position:right to sideways text (rotated horizontal typographic mode). r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D60351

--HG--
extra : moz-landing-system : lando
2020-01-20 16:16:33 +00:00
Emilio Cobos Álvarez
d10341c0bc Bug 1607049 - Split LengthPercentage again. r=boris
This is needed to support min() / max() / clamp(), etc, as those need to be a
tree of values and thus need heap storage.

This unfortunately grows LengthPercentage to be two pointers, which is bad as
it blows up the size of nsStylePosition enough to trigger the size assertions.

This patch comments out the assertion for now, the follow-up patches will
uncomment them.

Differential Revision: https://phabricator.services.mozilla.com/D58700

--HG--
extra : moz-landing-system : lando
2020-01-13 13:21:58 +00:00
Chris Peterson
406763af7f Bug 1570499 - Part 1: Replace MOZ_FALLTHROUGH macro with C++17's [[fallthrough]] attribute. r=froydnj
This changeset is a simple find and replace of `MOZ_FALLTHROUGH` and `[[fallthrough]]`.

Unfortunately, the MOZ_FALLTHROUGH_ASSERT macro (to assert on case fallthrough in debug builds) is still necessary after switching from [[clang::fallthrough]] to [[fallthrough]] because:

* MOZ_ASSERT(false) followed by [[fallthrough]] triggers a -Wunreachable-code warning in DEBUG builds
* but MOZ_ASSERT(false) without [[fallthrough]] triggers a -Wimplicit-fallthrough warning in NDEBUG builds.

Differential Revision: https://phabricator.services.mozilla.com/D56440

--HG--
extra : moz-landing-system : lando
2019-12-20 07:16:43 +00:00
Emilio Cobos Álvarez
cae1e55d61 Bug 1581467 - Do not use synthetic display-inside values. r=TYLin
This matches the new servo layout engine too, and thus removes some #[cfg]
gunk.  Just use `flow` since it doesn't simplify the layout code as much.

Differential Revision: https://phabricator.services.mozilla.com/D45973

--HG--
extra : moz-landing-system : lando
2019-12-19 01:19:04 +00:00
Emilio Cobos Álvarez
4a3be9604a Bug 1602317 - Switch style system to associated constants-in-body. r=heycam
This is closer to the equivalent Rust code.

Differential Revision: https://phabricator.services.mozilla.com/D56306

--HG--
extra : moz-landing-system : lando
2019-12-09 03:32:28 +00:00
Jonathan Kew
46dd64cc2a Bug 770780 - Implement rendering support for text-underline-position in nsTextFrame. r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D54723

--HG--
extra : moz-landing-system : lando
2019-12-04 19:48:22 +00:00