Commit graph

38 commits

Author SHA1 Message Date
Emilio Cobos Álvarez
79c2c447fc
style: fix tidy. 2020-06-04 05:01:54 +02:00
sefeng
54d869c111 style: Push/Pop dialog to top layer when needed.
This patch completes the top layer requirement for showModal()
Spec: https://html.spec.whatwg.org/multipage/interactive-elements.html#dom-dialog-showmodal

Differential Revision: https://phabricator.services.mozilla.com/D74922
2020-06-04 01:50:36 +02:00
Emilio Cobos Álvarez
0c4bba6b52 style: Unprefix -moz-read-write / -moz-read-only.
And remove some duplicated tests from WPT.

Differential Revision: https://phabricator.services.mozilla.com/D75231
2020-06-04 01:50:36 +02:00
Emilio Cobos Álvarez
d8cb4c4647 style: Prototype :focus-visible behind a flag.
The heuristic is that we show focus outlines for unknown or key focus, and not
for mouse / touch.

This is probably not the final heuristic we take, but this allows people to play
with it and file bugs.

Once this is mature enough we should remove :-moz-focusring in favor of
:focus-visible.

Differential Revision: https://phabricator.services.mozilla.com/D63861
2020-04-16 16:35:07 +02:00
Emilio Cobos Álvarez
a454f6233d Rename nsIDocument to mozilla::dom::Document.
Summary: Really sorry for the size of the patch. It's mostly automatic
s/nsIDocument/Document/ but I had to fix up in a bunch of places manually to
add the right namespacing and such.

Overall it's not a very interesting patch I think.

nsDocument.cpp turns into Document.cpp, nsIDocument.h into Document.h and
nsIDocumentInlines.h into DocumentInlines.h.

I also changed a bunch of nsCOMPtr usage to RefPtr, but not all of it.

While fixing up some of the bits I also removed some unneeded OwnerDoc() null
checks and such, but I didn't do anything riskier than that.

Bug: 1517241
Reviewed-by: smaug
2019-01-07 00:32:51 +01:00
Jan Andre Ikenmeyer
1d6fe65401
Update MPL license to https (part 4) 2018-11-19 14:47:27 +01:00
Emilio Cobos Álvarez
8e5c853fca
style: Appease tidy. 2018-07-01 01:01:46 +02:00
Olli Pettay
b68e4c2352
style: Implement :defined pseudo-class for custom elements.
Bug: 1331334
Reviewed-by: emilio
2018-07-01 00:08:33 +02:00
Edgar Chen
4c778b34e6 style: Remove :unsolved pseudo-class
This is the servo part changes of https://bugzilla.mozilla.org/show_bug.cgi?id=1417829.
2018-01-10 17:20:06 +08:00
Bastien Orivel
29b4eec141 Bump bitflags to 1.0 in every servo crate 2017-10-30 23:36:06 +01:00
Cameron McCormack
d58c967efa style: Record DocumentState dependencies. 2017-10-20 13:13:13 +08:00
Gecko Backout
11c64178d8 Backed out changeset e64e659c077d: servo PR #18809 and revendor for reftest failures, e.g. in layout/reftests/bugs/392435-1.html. r=backout on a CLOSED TREE
Backs out https://github.com/servo/servo/pull/18809
2017-10-19 21:26:51 +00:00
Bastien Orivel
e8e2d0a4b2 Update bitflags to 1.0 in every servo crate
It still needs dependencies update to remove all the other bitflags
versions.
2017-10-19 15:01:17 +02:00
Nicholas Nethercote
4506f0d30c Replace all uses of the heapsize crate with malloc_size_of.
Servo currently uses `heapsize`, but Stylo/Gecko use `malloc_size_of`.
`malloc_size_of` is better -- it handles various cases that `heapsize` does not
-- so this patch changes Servo to use `malloc_size_of`.

This patch makes the following changes to the `malloc_size_of` crate.

- Adds `MallocSizeOf` trait implementations for numerous types, some built-in
  (e.g. `VecDeque`), some external and Servo-only (e.g. `string_cache`).

- Makes `enclosing_size_of_op` optional, because vanilla jemalloc doesn't
  support that operation.

- For `HashSet`/`HashMap`, falls back to a computed estimate when
  `enclosing_size_of_op` isn't available.

- Adds an extern "C" `malloc_size_of` function that does the actual heap
  measurement; this is based on the same functions from the `heapsize` crate.

This patch makes the following changes elsewhere.

- Converts all the uses of `heapsize` to instead use `malloc_size_of`.

- Disables the "heapsize"/"heap_size" feature for the external crates that
  provide it.

- Removes the `HeapSizeOf` implementation from `hashglobe`.

- Adds `ignore` annotations to a few `Rc`/`Arc`, because `malloc_size_of`
  doesn't derive those types, unlike `heapsize`.
2017-10-18 22:20:37 +11:00
Matt Brubeck
efc3683cc7 Fix commonmark Markdown warnings in docs, part 1
Fixes warnings from rust-lang/rust#44229 when `--enable-commonmark` is
passed to rustdoc.

This is mostly a global find-and-replace for bare URIs on lines by
themselves in doc comments.
2017-10-17 11:24:57 -07:00
Nicholas Nethercote
32548e5312 Overhaul MallocSizeOf and related things.
This patch makes the MallocSizeOf stuff in Stylo work more like the HeapSizeOf
stuff already in Servo, except better. In particular, it adds deriving support
for MallocSizeOf, which will make it easier to improve coverage.

The patch does the following.

- Combines servo/components/style/stylesheets/memory.rs and the heapsize crate
  into a new crate, malloc_size_of.

- Forks the heapsize_derive crate, calling it malloc_size_of, so that
  MallocSizeOf can be derived.

- Both the new crates have MIT/Apache licenses, like heapsize, in case they are
  incorporated into heapsize in the future.

- Renames the methods within MallocSizeOf and the related traits so they are
  more concise.

- Removes MallocSizeOfWithGuard.

- Adds `derive(MallocSizeOf)` to a lot of types, in some cases replacing an
  equivalent or almost-equivalent hand-written implementation.

- Adds stuff so that Rc/Arc can be handled properly.
2017-09-12 12:37:51 +10:00
Matt Brubeck
17f4d0c5d9 Bug 1348489 - stylo: Implement :-moz-window-inactive. 2017-06-30 09:31:01 -07:00
Boris Zbarsky
0527190c8f Add pseudo-classes to match on the state of the "dir" attribute.
Fixes the servo parts of Gecko bug 1373798 <https://bugzilla.mozilla.org/show_bug.cgi?id=1373798>
2017-06-19 22:09:03 -04:00
Wes Kocher
10917ce73f Revert "Add pseudo-classes to match on the state of the "dir" attribute." for preventing me from backing out a gecko-side patch
This reverts commit e4660c2b5b.
2017-06-19 15:44:00 -07:00
Boris Zbarsky
e4660c2b5b Add pseudo-classes to match on the state of the "dir" attribute.
Fixes the servo parts of Gecko bug 1373798 <https://bugzilla.mozilla.org/show_bug.cgi?id=1373798>
2017-06-19 14:44:12 -04:00
Boris Zbarsky
cd29916c99 Fix dynamic updates when :dir matching changes in stylo.
This is the servo part of https://bugzilla.mozilla.org/show_bug.cgi?id=1364280
2017-05-15 12:31:49 -04:00
Cameron McCormack
bc685fde68 style: Support :-moz-autofill and :-moz-autofill-preview in Gecko. 2017-05-12 17:36:37 +08:00
Cameron McCormack
c0ab74324a style: Fix IN_LOADING_STATE value. 2017-05-11 16:01:40 +08:00
Emilio Cobos Álvarez
a6277d5513
Bug 1350140: stylo: Implement all the remaining state pseudo-classes. r=heycam
Also implements :link, :visited, and :any-link more efficiently, and stops
matching :-moz-read-only in everything that is not read-write, which is kind of
dumb, and probably creates some artifacts.

MozReview-Commit-ID: 6BQqi7nAWdT
Signed-off-by: Emilio Cobos Álvarez <emilio@crisal.io>
2017-03-29 11:52:53 +02:00
Boris Zbarsky
5a5a6cd876 Implement :required/:optional support for stylo.
Servo side of https://bugzilla.mozilla.org/show_bug.cgi?id=1349659
2017-03-22 20:20:17 -04:00
Boris Zbarsky
5415e8aa4c Use less fragile and more readable numbering for ElementState. 2017-03-22 16:23:16 -04:00
Nazım Can Altınova
d23cbd37b8
Stylo: Add support for -moz-* pseudo-classes for alt text 2017-03-18 19:46:53 +03:00
Nazım Can Altınova
bd7c8eb513
Stylo: Add support for :valid/:invalid/:-moz-ui-valid pseudo-classes 2017-03-16 13:44:50 +03:00
Xidorn Quan
381651fd10 Change order of element state bits 2017-01-06 10:04:49 +11:00
Emilio Cobos Álvarez
eb90004f5a
style: Avoid missing docs in element_state. 2016-12-31 23:24:17 +01:00
Jansen Jan
55f0e56224 Add support for fullscreen #10102 2016-12-09 11:45:50 +01:00
Steve Melia
04f5369577 Issue 7720: Add target selector and update when scrolling to fragment 2016-08-03 13:23:10 +01:00
Ms2ger
79e0d18a1d Add some documentation to the style crate. 2016-06-27 17:33:14 +02:00
Simon Sapin
00b6210519 Make the style crate almost build on stable Rust.
`discriminant_value` will need to be replaced with something else later.
2016-06-22 15:44:13 +02:00
Anthony Ramine
ff899dc703 Implement :placeholder-shown (fixes #10561) 2016-06-03 14:45:14 +02:00
Matt Brubeck
1e23d90631 Upgrade to bitflags 0.6.0 and selectors 0.5.6
Types generated by `bitflags!` are now private by default.  This PR marks them
`pub` where necessary.
2016-04-30 10:14:03 -07:00
Yoav Alon
9bf909ac2f added support for :read-only and :read-write pseudo-classes
partial fix for https://github.com/servo/servo/issues/10732
2016-04-27 01:38:58 +03:00
Emilio Cobos Álvarez
a1c830f1c1 Update rust-selectors
This commits updates rust-selectors to use the generic parser, and as
such it moves the element state into the style crate.
2016-02-03 02:11:31 +01:00