Граф коммитов

12126 Коммитов

Автор SHA1 Сообщение Дата
Hiroyuki Ikezoe 22056382c0 Bug 1504065 - Run background-color animations on the compositor. r=birtles
Changes for nsIDOMWindowUtils.getOMTAValue is in the next commit with come test
cases.

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

--HG--
extra : moz-landing-system : lando
2018-11-28 00:58:46 +00:00
Andreea Pavel f97b59258b Backed out 2 changesets (bug 1504065) for failing Win reftest at child-in-animating-element-display-none.html on a CLOSED TREE
Backed out changeset 129188370231 (bug 1504065)
Backed out changeset 359e81b35cfb (bug 1504065)
2018-11-27 15:33:29 +02:00
Hiroyuki Ikezoe 212fa4884a Bug 1504065 - Run background-color animations on the compositor. r=birtles
Changes for nsIDOMWindowUtils.getOMTAValue is in the next commit with come test
cases.

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

--HG--
extra : moz-landing-system : lando
2018-11-27 09:26:51 +00:00
Emilio Cobos Álvarez ef08f4f834 Bug 1509945 - Remove the display: -moz-box overrides display: -webkit-box hack. r=dholbert
display: -moz-box is no longer exposed to content so this is not necessary.

See bug 1407701 for context.

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

--HG--
extra : moz-landing-system : lando
2018-11-26 18:56:14 +00:00
Emilio Cobos Álvarez 9ed36d7ba6 Bug 1506547 - Align user-select behavior more with other UAs. r=mats
There's a few subtle behavior changes here, which I'll try to break down in the
commit message.

The biggest one is the EditableDescendantCount stuff going away. This
was added in bug 1181130, to prevent clicking on the non-editable div from
selecting the editable div inside. This is problematic for multiple reasons:

 * First, I don't think non-editable regions of an editable element should
   be user-select: all.

 * Second, it just doesn't work in Shadow DOM (the editable descendant count is
   not kept up-to-date when not in the uncomposed doc), so nested
   contenteditables behave differently inside vs. outside a Shadow Tree.

 * Third, I think it's user hostile to just entirely disable selection if you
   have a contenteditable descendant as a child of a user-select: all thing.

   WebKit behaves like this patch in the following test-case (though not Blink):

     https://crisal.io/tmp/user-select-all-contenteditable-descendant.html

   Edge doesn't seem to support user-select: all at all (no pun intended).

   But we don't allow to select anything at all which looks wrong.

 * Fourth, it's not tested at all (which explains how we broke it in Shadow DOM
   and not even notice...).

In any case I've verified that this doesn't regress the editor from that bug. If
this regresses anything we can fix it as outlined in the first bullet point
above, which should also make us more compatible with other UAs in that
test-case.

The other change is `all` not overriding everything else. So, something like:

  <div style="-webkit-user-select: all">All <div style="-webkit-user-select: none">None</div></div>

Totally ignores the -webkit-user-select: none declaration in Firefox before this
change. This doesn't match any other UA nor the spec, and this patch aligns us
with WebKit / Blink.

This in turn makes us not need -moz-text anymore, whose only purpose was to
avoid this.

This also fixes a variety of bugs uncovered by the previous changes, like the
SetIgnoreUserModify(false) call in editor being completely useless, since
presShell->SetCaretEnabled ended in nsCaret::SetVisible, which overrode it.

This in turn uncovered even more bugs, from bugs in the caret painting code,
like not checking -moz-user-modify on the right frame if you're the last frame
of a line, to even funnier bits where before this patch you show the caret but
can't write at all...

In any case, the new setup I came up with is that when you're editing (the
selection is focused on an editable node) moving the caret forces it to end up
in an editable node, thus jumping over non-editable ones.

This has the nice effect of not completely disabling selection of
-moz-user-select: all elements that have editable descendants (which was a very
ad-hoc hack for bug 1181130, and somewhat broken per the above), and also
not needing the -moz-user-select: all for non-editable bits in contenteditable.css
at all.

This also fixes issues with br-skipping like not being able to insert content in
the following test-case:

  <div contenteditable="true"><span contenteditable="false">xyz </span><br>editable</div>

If you start moving to the left from the second line, for example.

I think this yields way better behavior in all the relevant test-cases from bug
1181130 / bug 1109968 / bug 1132768, shouldn't cause any regression, and the
complexity is significantly reduced in some places.

There's still some other broken bits that this patch doesn't fix, but I'll file
follow-ups for those.

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

--HG--
extra : moz-landing-system : lando
2018-11-26 09:21:37 +00:00
Brindusan Cristian 31f0c21cca Backed out changeset 1575904619b5 (bug 1506547) for mochitest failures on test_reftests_with_caret.html. 2018-11-26 03:03:14 +02:00
Emilio Cobos Álvarez b74c31e4d9 Bug 1506547 - Align user-select behavior more with other UAs. r=mats
There's a few subtle behavior changes here, which I'll try to break down in the
commit message.

The biggest one is the EditableDescendantCount stuff going away. This
was added in bug 1181130, to prevent clicking on the non-editable div from
selecting the editable div inside. This is problematic for multiple reasons:

 * First, I don't think non-editable regions of an editable element should
   be user-select: all.

 * Second, it just doesn't work in Shadow DOM (the editable descendant count is
   not kept up-to-date when not in the uncomposed doc), so nested
   contenteditables behave differently inside vs. outside a Shadow Tree.

 * Third, I think it's user hostile to just entirely disable selection if you
   have a contenteditable descendant as a child of a user-select: all thing.

   WebKit behaves like this patch in the following test-case (though not Blink):

     https://crisal.io/tmp/user-select-all-contenteditable-descendant.html

   Edge doesn't seem to support user-select: all at all (no pun intended).

   But we don't allow to select anything at all which looks wrong.

 * Fourth, it's not tested at all (which explains how we broke it in Shadow DOM
   and not even notice...).

In any case I've verified that this doesn't regress the editor from that bug. If
this regresses anything we can fix it as outlined in the first bullet point
above, which should also make us more compatible with other UAs in that
test-case.

The other change is `all` not overriding everything else. So, something like:

  <div style="-webkit-user-select: all">All <div style="-webkit-user-select: none">None</div></div>

Totally ignores the -webkit-user-select: none declaration in Firefox before this
change. This doesn't match any other UA nor the spec, and this patch aligns us
with WebKit / Blink.

This in turn makes us not need -moz-text anymore, whose only purpose was to
avoid this.

This also fixes a variety of bugs uncovered by the previous changes, like the
SetIgnoreUserModify(false) call in editor being completely useless, since
presShell->SetCaretEnabled ended in nsCaret::SetVisible, which overrode it.

This in turn uncovered even more bugs, from bugs in the caret painting code,
like not checking -moz-user-modify on the right frame if you're the last frame
of a line, to even funnier bits where before this patch you show the caret but
can't write at all...

In any case, the new setup I came up with is that when you're editing (the
selection is focused on an editable node) moving the caret forces it to end up
in an editable node, thus jumping over non-editable ones.

This has the nice effect of not completely disabling selection of
-moz-user-select: all elements that have editable descendants (which was a very
ad-hoc hack for bug 1181130, and somewhat broken per the above), and also
not needing the -moz-user-select: all for non-editable bits in contenteditable.css
at all.

This also fixes issues with br-skipping like not being able to insert content in
the following test-case:

  <div contenteditable="true"><span contenteditable="false">xyz </span><br>editable</div>

If you start moving to the left from the second line, for example.

I think this yields way better behavior in all the relevant test-cases from bug
1181130 / bug 1109968 / bug 1132768, shouldn't cause any regression, and the
complexity is significantly reduced in some places.

There's still some other broken bits that this patch doesn't fix, but I'll file
follow-ups for those.

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

--HG--
extra : moz-landing-system : lando
2018-11-25 20:01:07 +00:00
Margareta Eliza Balazs 876022232b Merge inbound to mozilla-central. a=merge 2018-11-22 11:21:21 +02:00
Coroiu Cristina 5b23f6f303 Merge mozilla-central to autoland a=merge 2018-11-22 06:33:06 +02:00
Hiroyuki Ikezoe 1c6d6276f9 Bug 1506988 - Set the important rule change flag when a newly important rule is inserted. r=birtles
Without this change an assertion checking IsInStyleRefresh() in
EffectCompositor::PostRestyleForAnimation will be hit when we call
FindAnimationsForCompositor from RestyleManager::DoProcessPendingRestyles
that will be introduced in a subsequent commit in this series.

I wrote a crash test which causes an assertion in KeyframeEffect::CanThrottle()
without the subsequent commit, but we need more work in display item stuff to
make the assertion won't happen (bug 1508466).

Depends on D12367

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

--HG--
extra : moz-landing-system : lando
2018-11-22 04:03:06 +00:00
Mats Palmgren 91372ff9f3 Bug 1507905 - Add -webkit-appearance:textarea and make that the default for <textarea> for compatibility with other UAs. r=jwatt 2018-11-21 22:05:20 +01:00
Cameron McCormack 9c372819c4 Bug 1508013 - Run rustfmt on servo/ports/geckolib/ r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D12206

--HG--
extra : moz-landing-system : lando
2018-11-20 04:37:53 +00:00
Andreea Pavel 72b0594cb8 Merge mozilla-inbound to mozilla-central. a=merge 2018-11-17 13:27:24 +02:00
Emilio Cobos Álvarez 77a61b05f9 Bug 1508026 - Cherry-pick some changes to malloc_size_of's Cargo.toml. 2018-11-17 10:01:59 +01:00
CYBAI 7433c9192b Bug 1508026 - Fix wrong spec link. r=emilio
This cherry-picks servo/servo#22172.
2018-11-17 10:01:31 +01:00
Emilio Cobos Álvarez bdd6cb8f48 Bug 1508026 - Fix formatting. 2018-11-17 10:01:24 +01:00
Boris Chiou e2fc919e91 Bug 1464791 - Add comments for the calculation of Procedure::Add on Scale and transform list. r=birtles
Add more comments to let people know the intention of the special case.

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

--HG--
extra : moz-landing-system : lando
2018-11-16 19:06:16 +00:00
Boris Chiou 727ec2b557 Bug 1424134 - Part 4: Expand the mako code of Matrix3D and move them into transform.rs. r=emilio
Although the methods of Matrix3D in animated_properties.mako.rs could be
simplified by mako, it's a little bit hard to read because they are far
from the usage and definition. Therefore, we move them to the definition of
computed::Matrix3D and expand the mako.

Depends on D11935

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

--HG--
extra : moz-landing-system : lando
2018-11-16 19:29:28 +00:00
Boris Chiou 2718fd0897 Bug 1424134 - Part 3: Implement ComputeSquaredDistance for individual transforms. r=birtles
We manually implement ComputeSquaredDistance for Translate, Rotate, and
Scale because we have to handle mismatch cases, and actually we don't
need to implement it for specified types.

Depends on D11934

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

--HG--
extra : moz-landing-system : lando
2018-11-16 18:58:41 +00:00
Boris Chiou 40a2db875c Bug 1424134 - Part 2: Move the animation code of transform into a different file. r=emilio
Basically, most of the animation code of transform don't need mako, so
we could move them into values/animated/transform.rs.

However, we still use mako to generate some code to make the methods of
Matrix3D simpler, so I still leave them in animated_properties.mako.rs.

Depends on D11933

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

--HG--
rename : servo/components/style/properties/helpers/animated_properties.mako.rs => servo/components/style/values/animated/transform.rs
extra : moz-landing-system : lando
2018-11-16 18:58:39 +00:00
Boris Chiou a9d05e01da Bug 1424134 - Part 1: Factor the mako code out from transform functions. r=emilio
I'm trying to put all the mako code together, so we could move transform
code into a different file.

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

--HG--
extra : moz-landing-system : lando
2018-11-16 18:58:37 +00:00
Kristen Wright f22175b197 Bug 1460439 - Conversion from NS_STYLE_BORDER_STYLE_* macro to StyleBorderStyle::* enum class r=emilio
Converted NS_STYLE_BORDER_STYLE_* consts to enum class. Updated corresponding values to enum class. reduced BCCornerInfo struct values to fit StyleBorderStyle values inside struct. Added defaults to switches that do not fully cover all instances of StyleBorderStyle.
2018-11-07 11:56:17 -08:00
Alex Gaynor 16b6cb470e Bug 1507498 - fixed an unused import warning; r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D12028

--HG--
extra : moz-landing-system : lando
2018-11-15 16:42:54 +00:00
Emilio Cobos Álvarez f3bce5b4dd Bug 1507305 - Add a mechanism to serialize shorthands for getComputedStyle(). r=heycam
This implements the mechanism reusing the animation machinery for now, so it
asserts in a few cases that this wouldn't handle correctly.

For shorthands that have colors and other bits we'd need a more sophisticated
mechanism with a bit more code (that resolves colors and such), but it'd look
something like this regardless, and we should have this in any case.

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

--HG--
extra : moz-landing-system : lando
2018-11-15 08:25:13 +00:00
Emilio Cobos Álvarez e31725c66f Bug 1507311 - Make the serialization of the mask shorthand more compact. r=heycam
This helps to preserve the old longhand form when possible (mask used to be a
longhand), which will be relevant when we serialize this for the computed
value.

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

--HG--
extra : moz-landing-system : lando
2018-11-15 08:22:31 +00:00
Emilio Cobos Álvarez 96e9a73918 Bug 1507309 - Simplify background-repeat. r=heycam
This way we always serialize in the shortest form, and take less space.

This is useful because when serializing uncomputed values we'd like to compare
to the initial value to avoid serializing parts of a shorthand, but with the
existing implementation we would generate always a second keyword, which means
that we'll never match it.

This also matches Chrome and WebKit, incidentally, so I'm pretty confident the
behavior change when serializing specified style is web-compatible.

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

--HG--
extra : moz-landing-system : lando
2018-11-15 03:23:39 +00:00
Emilio Cobos Álvarez d16b7e3e9a Bug 1507127 - Also move page-break-inside outside of mako. r=heycam
Differential Revision: https://phabricator.services.mozilla.com/D11876

--HG--
extra : moz-landing-system : lando
2018-11-15 08:16:23 +00:00
Emilio Cobos Álvarez 7cefd0df6a Bug 1507127 - Move the page-break-{before,after} properties to not use mako. r=heycam
And respect the computed value of `left` / `right` / etc.

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

--HG--
extra : moz-landing-system : lando
2018-11-15 08:15:13 +00:00
Timothy Guan-tin Chien af2973ef61 Bug 1503019 - Part II, Remove dom.webcomponents.customelements.enabled pref r=smaug
This patch removes the following functions:

* nsContentUtils::IsCustomElementsEnabled()
* CustomElementRegistry::IsCustomElementEnabled(JSContext* aCx, JSObject* aObject)
* CustomElementRegistry::IsCustomElementEnabled(nsIDocument* aDoc)

and all references of the pref.

Depends on D11183

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

--HG--
extra : moz-landing-system : lando
2018-11-15 06:52:01 +00:00
Timothy Guan-tin Chien 2b5881e46b Bug 1503019 - Part I, Remove dom.webcomponents.shadowdom.enabled r=smaug
This patch removes the dom.webcomponents.shadowdom.enabled pref and all its
references, including the following functions:

* nsContentUtils::IsShadowDOMEnabled()
* nsIDocument::IsShadowDOMEnabled()
* nsDocument::IsShadowDOMEnabled(JSContext* aCx, JSObject* aGlobal)
* nsDocument::IsShadowDOMEnabled(const nsINode* aNode)
* nsTextNode::IsShadowDOMEnabled(JSContext* aCx, JSObject* aObject)

This function is renamed and updated to nsDocument::IsCallerChromeOrAddon():

* nsDocument::IsShadowDOMEnabledAndCallerIsChromeOrAddon(JSContext* aCx, JSObject* aObject)

I didn't change the tests that load Shadow DOM tests in an iframe, in the interest of keeping hg annotation history.

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

--HG--
extra : moz-landing-system : lando
2018-11-15 06:51:07 +00:00
Andreea Pavel d51566f085 Backed out 2 changesets (bug 1503019) for failing crashtests at dom/base/crashtests/1505811.html on a CLOSED TREE
Backed out changeset 06b12fd41ff1 (bug 1503019)
Backed out changeset 7b845eac9dd7 (bug 1503019)
2018-11-15 01:52:30 +02:00
Andreea Pavel 9cabbb0b47 Merge mozilla-central to autoland. a=merge on a CLOSED TREE 2018-11-15 00:35:07 +02:00
Timothy Guan-tin Chien c69315234b Bug 1503019 - Part II, Remove dom.webcomponents.customelements.enabled pref r=smaug
This patch removes the following functions:

* nsContentUtils::IsCustomElementsEnabled()
* CustomElementRegistry::IsCustomElementEnabled(JSContext* aCx, JSObject* aObject)
* CustomElementRegistry::IsCustomElementEnabled(nsIDocument* aDoc)

and all references of the pref.

Depends on D11183

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

--HG--
extra : moz-landing-system : lando
2018-11-14 19:37:42 +00:00
Timothy Guan-tin Chien c0cc4f74e7 Bug 1503019 - Part I, Remove dom.webcomponents.shadowdom.enabled r=smaug
This patch removes the dom.webcomponents.shadowdom.enabled pref and all its
references, including the following functions:

* nsContentUtils::IsShadowDOMEnabled()
* nsIDocument::IsShadowDOMEnabled()
* nsDocument::IsShadowDOMEnabled(JSContext* aCx, JSObject* aGlobal)
* nsDocument::IsShadowDOMEnabled(const nsINode* aNode)
* nsTextNode::IsShadowDOMEnabled(JSContext* aCx, JSObject* aObject)

This function is renamed and updated to nsDocument::IsCallerChromeOrAddon():

* nsDocument::IsShadowDOMEnabledAndCallerIsChromeOrAddon(JSContext* aCx, JSObject* aObject)

I didn't change the tests that load Shadow DOM tests in an iframe, in the interest of keeping hg annotation history.

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

--HG--
extra : moz-landing-system : lando
2018-11-14 19:34:52 +00:00
Cameron McCormack dd8df1647e Bug 1507050 - Store MediaFeatureDescription references as an index into the MEDIA_FEATURES array r=emilio
The current use of a static reference is incompatible with sharing style sheet data
across processes.

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

--HG--
extra : moz-landing-system : lando
2018-11-14 21:33:01 +00:00
Cameron McCormack d3bc43cc8c Bug 1506760 - Store variable references with a boxed slice rather than a PrecomputedHashSet r=emilio
Once we've parsed the variable references, there is no need to keep an entire HashSet
object around, as all we do is iterate over the values.

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

--HG--
extra : moz-landing-system : lando
2018-11-13 12:51:05 +00:00
Boris Chiou 94b54b2b26 Bug 1504327 - Support keywords [x|y|z] on rotate. r=emilio
Update the parser and the serialization to support the keywords, [x|y|z].

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

--HG--
extra : moz-landing-system : lando
2018-11-13 18:37:14 +00:00
Emilio Cobos Álvarez 6ca25ecbe6 Bug 1499170 - Add an atom bit to know whether we're ascii lowercase. r=njn
And thus massively speed up ascii-case-insensitive atom comparisons when both
atoms are lowercase (which is the common case by far).

This removes almost all the slow selector-matching in this page, and it seems
an easier fix than storing the lowercased version of all class-names in quirks
mode in elements and selectors...

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

--HG--
extra : moz-landing-system : lando
2018-11-13 12:47:40 +00:00
Cosmin Sabou 007b66c1f5 Merge mozilla-inbound to mozilla-central. a=merge 2018-11-13 06:23:01 +02:00
Boris Chiou 6e361a1a9a Bug 1505200 - Part 3: Parse any order of number and angle for Rotate. r=emilio
Rotate accepts rotate axis and angle in any order
(i.e. <number>{3} <angle> or <angle> <number>{3}), so we rewrite the
parser.

Depends on D11401

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

--HG--
extra : moz-landing-system : lando
2018-11-12 19:21:32 +00:00
Boris Chiou 5f3b39da88 Bug 1505200 - Part 1: Rewrite the interpolation of Rotate to return correct type. r=birtles
The original implementation always returns Rotate::Rotate3D, but it is
not correct, so we have to rewrite it:
1. If both from value and to value are none, we don't have to convert it
   into identity value, so just return None.
2. If one of the value is none, we replace it with an identity value based on
   the other one's rotate axis.
3. If we only have 2D rotation, we just animate the <angle>.
4. Otherwise, we do interpolation by 3D rotation.

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

--HG--
extra : moz-landing-system : lando
2018-11-12 23:17:19 +00:00
Emilio Cobos Álvarez bea44aa4f6 Bug 1473184: Remove serialize_basicshape_position. r=xidorn
Per https://github.com/w3c/csswg-drafts/issues/2274. There's a whole lot of new failures, but those need to be updated along with the spec changes in that issue.

We did resolve that position serialized the same everywhere though.

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

--HG--
extra : moz-landing-system : lando
2018-11-12 09:21:17 +00:00
Emilio Cobos Álvarez f8ed926bb3 Bug 1506391 - Manually extinguish multi-line use statements. 2018-11-11 02:40:30 +01:00
Emilio Cobos Álvarez 652ee99c60 Bug 1506391 - Revert try -> r#try change.
Since we're in an inconsistent state because mako files weren't updated, and
it's really ugly.
2018-11-11 02:40:28 +01:00
Emilio Cobos Álvarez 58166142d5 Bug 1506391 - cargo fix on the merged changes + formatting. 2018-11-11 02:40:26 +01:00
Simon Sapin f7c7465ccb Bug 1506391 - `cargo fix --edition --features gecko`. r=emilio 2018-11-11 02:40:24 +01:00
Simon Sapin 4f9e2bcf36 Bug 1506391 - `cargo fix --edition`. r=emilio 2018-11-11 02:40:21 +01:00
Simon Sapin 078d2c6545 Bug 1506391 - Use 2018-style paths in code generated by Mako. r=emilio 2018-11-11 02:40:19 +01:00
Simon Sapin 271e888fb3 Bug 1506391 - Use 2018-style paths in code generated by style_derive. r=emilio 2018-11-11 02:40:17 +01:00
Brindusan Cristian d67cc09fb1 Backed out 7 changesets (bug 1506391) for Btup bustages.
Backed out changeset b8216171101c (bug 1506391)
Backed out changeset 03d2309b737d (bug 1506391)
Backed out changeset 7b63f3149852 (bug 1506391)
Backed out changeset be88680421db (bug 1506391)
Backed out changeset 3840ce1ebfb0 (bug 1506391)
Backed out changeset 94517e21621c (bug 1506391)
Backed out changeset 32bde6f52a32 (bug 1506391)
2018-11-11 01:08:20 +02:00