Commit Graph
1416 Commits
Author SHA1 Message Date
Emilio Cobos Álvarez 1fccbabe09 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
2019-12-09 03:32:28 +00:00
Jonathan Kew 69eaf7da84 Bug 770780 - Implement rendering support for text-underline-position in nsTextFrame. r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D54723
2019-12-04 19:48:22 +00:00
Jonathan Kew 2db5a3dfd0 Bug 1581715 - Ensure the fontgroup is refreshed before attempting to (re-)build textrun for a frame. r=jwatt
Differential Revision: https://phabricator.services.mozilla.com/D53689
2019-11-29 21:29:15 +00:00
Cameron McCormack 222ae5066f Bug 1599173 - Disable SVG text spacing with a pref. r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D54887
2019-11-27 23:29:41 +00:00
Sylvestre Ledru 0f8c6db00f Bug 1519636 - Reformat recent changes to the Google coding style r=Ehsan
# ignore-this-changeset

Differential Revision: https://phabricator.services.mozilla.com/D54686
2019-11-26 14:35:02 +00:00
Cameron McCormack 0051931fab Bug 371787 - Add support for letter-spacing and word-spacing in SVG text. r=jfkthame,longsonr
Differential Revision: https://phabricator.services.mozilla.com/D53376
2019-11-20 04:10:36 +00:00
Sam Mauldin 43a1a4df46 Bug 1592389 - Rename Mozfield / Mozfieldtext to Field and Fieldtext r=emilio
Split off of Bug 1590894
Rename these to support unprefixed version
Also add alias to keep compatibility

Differential Revision: https://phabricator.services.mozilla.com/D50989
2019-11-02 21:28:49 +00:00
Daniel Varga 8a98e1b6bf Backed out changeset ec25a8482342 (bug 1592389) for mochitest failure at layout/style/test/test_value_computation.html. On a CLOSED TREE 2019-10-30 10:17:29 +02:00
Sam Mauldin f087a63a53 Bug 1592389 - Rename Mozfield / Mozfieldtext to Field and Fieldtext r=emilio
Split off of Bug 1590894
Rename these to support unprefixed version
Also add alias to keep compatibility

Differential Revision: https://phabricator.services.mozilla.com/D50989
2019-10-30 05:51:38 +00:00
Alex Henrie fd5feb4ae7 Bug 1591490 - Use the NS_IS_SURROGATE_PAIR macro everywhere. r=Ehsan
Differential Revision: https://phabricator.services.mozilla.com/D50697
2019-10-27 05:05:51 +00:00
David Major 8c460bc047 Bug 1468131 - Avoid a ubsan complaint in GetTrimmableWhitespaceCount r=emilio
ubsan was complaining about the expression
```
    const char* str = aFrag->Get1b() + aStartOffset;
```
when `aFrag->Get1b() == nullptr` and `aStartOffset == -1`, because the addition generates an invalid pointer.

Due to other logic in the function, we would never dereference that pointer, so it was reasonably harmless, but this patch silences the complaint.

Differential Revision: https://phabricator.services.mozilla.com/D49345
2019-10-15 22:59:51 +00:00
Jonathan Kew 27f88e516b Bug 1472328 - Check if we're already at the end of the frame's content. r=mats
Differential Revision: https://phabricator.services.mozilla.com/D45924
2019-09-16 19:07:00 +00:00
Jonathan Kew e8addc88b2 Bug 1582016 - When text-underline-offset is auto, clamp the minimum used underline-offset to 1/16em. r=dholbert
This is to avoid skip-ink problems with fonts that leave the OpenType field at zero,
which is unlikely to ever be what is really wanted. Authors can still avoid the clamp by
explicitly using text-underline-offset:from-font.

Differential Revision: https://phabricator.services.mozilla.com/D46268
2019-09-18 17:31:14 +00:00
Jonathan Kew d3eb483c1d Bug 1241631 - Don't trim leading whitespace from soft-wrapped lines when getting rendered text for a11y or .innerText. r=mats
Differential Revision: https://phabricator.services.mozilla.com/D45157
2019-09-17 17:36:13 +00:00
Jonathan Kew dd9c17fb29 Bug 1573711 - Account for baseline offset (potential effect of vertical-align property) when computing skip-ink intercepts. r=dholbert
Differential Revision: https://phabricator.services.mozilla.com/D44297
2019-08-31 04:32:55 +00:00
Jonathan Kew 701d210d6e Bug 1575908 - Remove spurious code trying to reinitialize a propertyProvider. r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D43261
2019-08-23 15:49:28 +00:00
Emilio Cobos Álvarez ffb949c2b1 Bug 1575608 - Avoid manual paint-order glue code. r=boris
Differential Revision: https://phabricator.services.mozilla.com/D42913
2019-08-21 19:47:53 +00:00
Mats Palmgren 66432bdda6 Bug 1574994 part 2 - Remove display:-moz-inline-grid/-moz-inline-stack. r=emilio
Depends on D42551

Differential Revision: https://phabricator.services.mozilla.com/D42552
2019-08-19 21:19:04 +00:00
Mats Palmgren 1b48239683 Bug 1105868 part 2 - Use nsStyleDisplay::DisplayInside() in a few places to prepare for inline list-items. r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D39831
2019-08-14 14:36:53 +00:00
Charlie Marlow d296699b8d Bug 1558929: adding from-font support to text-underline-offset and text-decoration-thickness r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D41476
2019-08-13 17:43:25 +00:00
Emilio Cobos Álvarez 3e0f527c21 Bug 1572805 - Use cbindgen for text-emphasis-style. r=boris
I sent https://github.com/eqrion/cbindgen/pull/377 since I got sick of
copy-pasting the private default constructor stuff :)

Differential Revision: https://phabricator.services.mozilla.com/D41419
2019-08-10 18:11:31 +00:00
Daniel Varga ead7b8c5f2 Backed out 2 changesets (bug 1572805) for build-rusttests failure. On a CLOSED TREE
Backed out changeset 849ca4b3f9de (bug 1572805)
Backed out changeset 81b56d76505a (bug 1572805)
2019-08-10 21:07:03 +03:00
Emilio Cobos Álvarez 273121c141 Bug 1572805 - Use cbindgen for text-emphasis-style. r=boris
I sent https://github.com/eqrion/cbindgen/pull/377 since I got sick of
copy-pasting the private default constructor stuff :)

Differential Revision: https://phabricator.services.mozilla.com/D41419
2019-08-10 16:21:15 +00:00
Charlie Marlow 0da4cb56a4 Bug 1411922: Part 1: Add rendering support for text-decoration-skip-ink r=jfkthame
Differential Revision: https://phabricator.services.mozilla.com/D39377
2019-08-07 17:41:13 +00:00
Emilio Cobos Álvarez 6fa0204537 Bug 1571460 - Set prev-in-flow before calling nsFrame::Init. r=TYLin
Parts of nsFrame::Init or code called by it should be able to rely on the
invariant that, if the frame has the NS_FRAME_OUT_OF_FLOW bit, the first-in-flow
frame has a placeholder property.

Alternatively to this patch, the NS_FRAME_OUT_OF_FLOW frame bit could be
propagated later, as it used to be.

Differential Revision: https://phabricator.services.mozilla.com//D40815
2019-08-07 16:55:34 +02:00
Cosmin Sabou 023a6f9f48 Backed out changeset 3f4421e34ab4 (bug 1571460) for assertion failures on nsTextFrame.cpp. CLOSED TREE 2019-08-07 14:57:58 +03:00
Emilio Cobos Álvarez 399117f0d1 Bug 1571460 - Set prev-in-flow before calling nsFrame::Init. r=TYLin
Parts of nsFrame::Init or code called by it should be able to rely on the
invariant that, if the frame has the NS_FRAME_OUT_OF_FLOW bit, the first-in-flow
frame has a placeholder property.

Alternatively to this patch, the NS_FRAME_OUT_OF_FLOW frame bit could be
propagated later, as it used to be.

Differential Revision: https://phabricator.services.mozilla.com/D40815
2019-08-07 10:44:54 +00:00
Masayuki Nakano 9f76bac2e9 Bug 1569613 - Add surrogate pair handling API to nsTextFragment r=hsivonen
We check surrogate pair at specific index in `nsTextFragement` in a lot of
places.  This requires boundary check of the index so that it can cause
security issue and crash reason with simple mistake, and also it steals
your time to understand the code what it does especially when it's a
part of an `if` condition.

Therefore, this patch adds new API to `nsTextFragment` and makes the all
surrogate pair handlers of `nsTextFragument` use new API.

Differential Revision: https://phabricator.services.mozilla.com/D39689
2019-08-06 05:43:21 +00:00
Jonathan Kew 9a72249bbf Bug 1437367 - Remove the layout.css.paint-order.enabled pref, this feature is always enabled. r=jwatt
Differential Revision: https://phabricator.services.mozilla.com/D39340
2019-07-26 14:07:17 +00:00
Nicholas Nethercote c4aacd8403 Bug 1563139 - Remove StaticPrefs.h. r=glandium
This requires replacing inclusions of it with inclusions of more specific prefs
files.

The exception is that StaticPrefsAll.h, which is equivalent to StaticPrefs.h,
and is used in `Codegen.py` because doing something smarter is tricky and
suitable for a follow-up. As a result, any change to StaticPrefList.yaml will
still trigger recompilation of all the generated DOM bindings files, but that's
still a big improvement over trigger recompilation of every file that uses
static prefs.

Most of the changes in this commit are very boring. The only changes that are
not boring are modules/libpref/*, Codegen.py, and ServoBindings.toml.

Differential Revision: https://phabricator.services.mozilla.com/D39138
2019-07-26 01:10:23 +00:00
Masayuki Nakano 4a34bf9c3c Bug 1548389 - part 10: Make TextEditor::SetUnmaskRangeInternal() expand the range if specified offset is middle of a surrogate pair r=m_kato
Unmasking is an optional style of showing password.  Therefore, if callers of
`nsIEditor::Unmask()` specify middle of surrogate pair(s), it may mean that
they want to expand the unmask range from shorter range which does not include
the high and/or low surrogate.  Therefore, one of the surrogates is in unmasked
range, we unmask the surrogate pair.  However, we handle this in a lot of
places, i..e., we have duplicated code.  This can get rid of these duplicates
with making `nsIEditor::Unmask()` expand the range automatically.

Differential Revision: https://phabricator.services.mozilla.com/D38432
2019-07-22 03:56:33 +00:00
Masayuki Nakano caa0c5eb8e Bug 1548389 - part 9: Make ContentEventHandler return masked text r=m_kato
In some cases, other tools may show selected content in their UI.  E.g.,
character palette of macOS.  Therefore, we shouldn't allow them to show
masked password.

Differential Revision: https://phabricator.services.mozilla.com/D38430
2019-07-22 03:56:15 +00:00
Masayuki Nakano 52c56eb77f Bug 1548389 - part 8: Make nsTextFrame::PeekOffsetWord() scan masked text r=jfkthame
Double click, long tap, moving selection with keyboard and deleting text
scan word boundary.  With these changes, the text node has raw password
value even if it's masked visually.  For making safer,
`nsTextFrame::PeekOffsetWord()` should search word boundary in masked text.
Then, we can hide word boundary at masked range, but keep allowing to look
for word boundary only in unmasked range.

Differential Revision: https://phabricator.services.mozilla.com/D38013
2019-07-22 03:55:53 +00:00
Masayuki Nakano a6fbd786d9 Bug 1548389 - part 5: Make nsTextFrame and related code treat masking password characters as text-transform r=jfkthame
Anonymous text node in password field has `NS_MAYBE_MASKED` flag and
`TextEditor` managing the node has range of unmasking.  This patch makes
`BuildTextRunsScanner::BuildTextRunForFrames()` treat text frame in
password field as `text-transform` applied.  For recording the unmask range,
this patch creates `nsTransformedCharStyle::mMaskPassword` and treats unmask
range start/end edges as different style boundary.  Therefore,
`nsCaseTransformTextRunFactory::TransformString()` can replace each character
with a password mask character with the information.

Note that we need to kill bidi algorithm in password fields with forms.css
because caret position will tell everybody whether the typing character is
an RTL or an LTR character.

Differential Revision: https://phabricator.services.mozilla.com/D38009
2019-07-22 03:54:50 +00:00
Charlie Marlow ae5f09fb0e Bug 1567282: renamed text-decoration-width to text-decoration-thickness r=dholbert
Differential Revision: https://phabricator.services.mozilla.com/D38586
2019-07-19 16:33:08 +00:00
L. David Baron 07c8e14901 Bug 1566945 - Pass line box through from nsTextFrame::SetLength. r=dholbert
Differential Revision: https://phabricator.services.mozilla.com/D38390
2019-07-17 23:34:45 +00:00
L. David Baron ca88671959 Bug 1566945 - Add a parameter to nsContainerFrame::InsertFrames for aPrevFrame's line box. r=dholbert
For now, always pass null, except when passing it through from one
overload to another.

Differential Revision: https://phabricator.services.mozilla.com/D38389
2019-07-17 23:34:45 +00:00
Charlie Marlow 995b4157e3 Bug 1561657: fixed text-underline-offset so that positive lengths represent movement outwards from the text r=jfkthame
Differential Revision: https://phabricator.services.mozilla.com/D36669
2019-07-08 20:15:54 +00:00
Charlie Marlow 54fe7aacf8 Bug 1562704: fixed text-underline-offset for Japanese and Korean text, where underlines appear to the right of text r=jfkthame
Differential Revision: https://phabricator.services.mozilla.com/D36519
2019-07-08 20:15:56 +00:00
shindli 9bc31d1835 Backed out 3 changesets (bug 1561657, bug 1557857, bug 1562704) for causing Wr permafailures in z:/build/build/src/layout/base/nsCSSFrameConstructor.cpp:3962 CLOSED TREE
Backed out changeset 3fd103a9fce8 (bug 1557857)
Backed out changeset c4ffd7ba0442 (bug 1561657)
Backed out changeset 4b67dff062c6 (bug 1562704)
2019-07-08 22:56:35 +03:00
Charlie Marlow 92f1380394 Bug 1561657: fixed text-underline-offset so that positive lengths represent movement outwards from the text r=jfkthame
Differential Revision: https://phabricator.services.mozilla.com/D36669
2019-07-08 16:07:45 +00:00
Charlie Marlow 546d9b2de2 Bug 1562704: fixed text-underline-offset for Japanese and Korean text, where underlines appear to the right of text r=jfkthame
Differential Revision: https://phabricator.services.mozilla.com/D36519
2019-07-08 16:07:33 +00:00
Emilio Cobos Álvarez 570ec250da Bug 1563315 - Use cbindgen for fill and stroke r=boris
Differential Revision: https://phabricator.services.mozilla.com/D36807
2019-07-06 08:31:02 +00:00
Ting-Yu Lin 707888adae Bug 1563370 - Eliminate GetPrevInFlowVirtual() and GetNextInFlowVirtual(). r=dholbert
Differential Revision: https://phabricator.services.mozilla.com/D36829
2019-07-03 21:37:14 +00:00
Charlie Marlow db39fcc6ab Bug 1559493: Fixed origin from which text-underline-offset is set in vertical writing modes r=jfkthame
Differential Revision: https://phabricator.services.mozilla.com/D36219
2019-07-03 21:23:38 +00:00
Gerald SquelartandL. David Baron 0088545108 Bug 1474771 - Propagate NS_FRAME_IS_DIRTY to descendants when marking as dirty rather than during reflow. r=dholbert
This simplifies dealing with frames that are pushed/pulled between
continuations during reflow, allows us to avoid the complexity of the
fix to 1459937, and hopefully fixes some of the regressions from bug
1308876.

This disables the changes from bug 1459937 by commenting out a single
line in ReparentFrameInternal in nsBlockFrame.cpp, but all the added
code will be removed in the following patch.

Co-authored-by: Gerald Squelart <[email protected]>
Co-authored-by: L. David Baron <[email protected]>

Depends on D36423

Differential Revision: https://phabricator.services.mozilla.com/D36424
2019-07-01 21:56:43 +00:00
Nicholas Nethercote 25e6095b36 Bug 1561825 - Make layout.* static prefs follow the naming convention. r=KrisWright
Differential Revision: https://phabricator.services.mozilla.com/D36160
2019-06-27 16:28:25 +10:00
Charlie Marlow 06a93ae8c4 Bug 1440014: Part 1: Implemented rendering for text-decoration-width CSS property r=jfkthame
reftests will be added later

Differential Revision: https://phabricator.services.mozilla.com/D34238
2019-06-26 21:21:57 +00:00
Charlie Marlow 3443ef6735 Bug 1552062: Part 2: Implemented rendering for text-underline-offset in nsTextFrame r=jfkthame
reftests will be added in part 3, from-font support will be added later on

Differential Revision: https://phabricator.services.mozilla.com/D34019
2019-06-14 02:33:45 +00:00
Charlie Marlow dc3ac270f8 Bug 1552062: Part 1: Added text underline offset member variable to LineDecorations struct r=dholbert
Differential Revision: https://phabricator.services.mozilla.com/D33882
2019-06-14 02:33:45 +00:00