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

79 Коммитов

Автор SHA1 Сообщение Дата
Emilio Cobos Álvarez 1aed15b692 Bug 1331213: Bootstrap a Gecko-side Device, and track it's dirtiness manually in the per-doc data. r=heycam
The setup is quite different to Servo-land, so add a comment about the different
setup.

Also, check viewport rules when flushing stylesheets. I believe that the
previous behavior is plain wrong, though I haven't taken the time to come up
with a test case.

In any case, it doesn't hurt any of both back-ends.

MozReview-Commit-ID: 46gtTkesOsr
Signed-off-by: Emilio Cobos Álvarez <emilio@crisal.io>
2017-01-17 14:20:03 +01:00
Wes Kocher 105aea2522 Merge m-c to inbound a=merge
MozReview-Commit-ID: G24aq5fbYNd
2017-01-09 16:44:58 -08:00
Cameron McCormack 4a5ea32ba0 Bug 1323665 - Part 1: Adjust some ServoStyleSet assertions. r=xidorn
We're incorrectly asserting that a sheet is applicable when we remove it from
the style set, but we'll actually cause the sheet to be not applicable just
before we remove it from the style set.  (Note how nsStyleSet doesn't assert
this in RemoveStyleSheet.)  Also, we were missing a corresponding assertion
in AddDocStylesSheet.

MozReview-Commit-ID: E5qwxwrA74F

--HG--
extra : rebase_source : 1915553a0aa6f45b347db34feace35802983b05a
2017-01-09 17:42:52 +08:00
Bobby Holley 09ce7e77ed Bug 1325734 - Simplify ElementData and eliminate the concept of consuming styles. r=emilio 2017-01-09 11:50:16 -08:00
Boris Zbarsky 7fd253e340 Bug 1298588 followup whitespace fix to address a missed review comment. DONTBUILD 2017-01-04 23:19:34 -05:00
Boris Zbarsky 85a6ca2630 Bug 1298588 part 10, gecko piece. Pass through useful default styles to apply_declarations(). r=bholley 2017-01-04 14:52:27 -05:00
Boris Zbarsky eebd58fd31 Bug 1298588 part 7, gecko piece. Stop using initial_values in general in Gecko glue code. r=bholley 2017-01-04 14:52:27 -05:00
Boris Zbarsky bd53996269 Bug 1298588 part 6, gecko piece. Stop using initial_values when doing inheritance in Gecko glue code. r=bholley 2017-01-04 14:52:27 -05:00
Boris Zbarsky 9f8934b143 Bug 1298588 part 4, gecko piece. Recreate the default computed values for a document as needed. r=bholley 2017-01-04 14:52:27 -05:00
Boris Zbarsky a3a6e58c68 Bug 1298588 part 2, gecko piece. Pass through an nsPresContext to the PerDocumentStyleData constructor. r=bholley 2017-01-04 14:52:26 -05:00
Daniel Holbert 2c23d97ecd Bug 1326574: Add some needed includes/forward-declarations in layout/style, to preemptively fix unified bustage. r=xidorn
MozReview-Commit-ID: 2vM3aiR87T3

--HG--
extra : rebase_source : 8bff626c7f283b67b5178bae06ab5606b24c0119
2016-12-31 16:10:45 -08:00
Wes Kocher 2903c33754 Merge inbound to central, a=merge
MozReview-Commit-ID: 3AlcRAsPF0s
2016-12-28 16:08:44 -08:00
Cameron McCormack 27d8bc9321 Bug 1326015 - Run AssertTreeIsClean on all style roots. r=xidorn
MozReview-Commit-ID: 1GkRS05tda

--HG--
extra : rebase_source : 5bffe0cdab8b8e14044dc2f02af686e3a83368e8
2016-12-28 16:26:10 +08:00
Bobby Holley 533ab579fc Bug 1324627 - Add a special, explicit path for lazy style resolution and use it for GetComputedStyle. r=heycam 2016-12-28 15:49:12 +08:00
Phil Ringnalda afc1c72dd2 Backed out changeset 5986d8880ad1 (bug 1324627) for a variety of computed style failures
MozReview-Commit-ID: AMTshx423hQ
2016-12-27 21:34:45 -08:00
Bobby Holley dccae432a9 Bug 1324627 - Add a special, explicit path for lazy style resolution and use it for GetComputedStyle. r=heycam
MozReview-Commit-ID: ECnoeHYkpT
2016-12-28 11:33:18 +08:00
Bobby Holley 38fbeaa270 Bug 1325728 - Simplify pseudo-element handling. r=heycam 2016-12-23 19:23:52 -08:00
Bobby Holley 3e1898e903 Bug 1325728 - Use Gecko's existing mechanism to coordinate flushing the Stylist. r=heycam 2016-12-23 19:23:50 -08:00
Cameron McCormack e9a3df412d Bug 1324341 - Part 2: Redo the cascade when CSSOM methods modify style sheets. r=xidorn
MozReview-Commit-ID: AIkwBaUlxD7
2016-12-19 14:30:14 +08:00
Bobby Holley 2207c01808 Bug 1322945 - Change skip_root to unstyled_children_only and use StyleNewChildren in more places. r=heycam
I noticed that our current behavior in ContentRangeInserted is incorrect. Unlike
ContentInserted (where this code lived originally), ContentRangeInserted takes a
start and end element. I'm not sure if we ever take that path for new content that
needs style, but it seemed sketchy. And generally, it seems nice to just always
style new content the same way (though we still need to style NAC by the subtree
root, since it hasn't been attached to the parent yet).

For situations where there is indeed only one unstyled child, the traversal
overhead should be neglible, since we special-case the single-element in
parallel.rs to avoid calling into rayon.

Being more explicit about what we want here also makes us more robust against
the other handful of callpaths that can take us into
nsCSSFrameConstructor::{ContentRangeInserted,ContentAppended}. Currently we
can call StyleNewSubtree on an already-styled element via RecreateFramesForContent,
which triggers an assertion in the servo traversal.

MozReview-Commit-ID: DqCGh90deHH
2016-12-12 18:39:33 -08:00
Cameron McCormack a7c175e671 Bug 1321284 - Part 5: Process document level NAC when restyling. r=bholley
MozReview-Commit-ID: GigSrTHXXte

--HG--
extra : rebase_source : 30d6f5b3b32c921ae15e69b29a9cc3d5372ad8bc
2016-12-01 16:19:50 +08:00
Bobby Holley f8c9d884fc Bug 1317016 - Basic infrastructure for RestyleHint-driven traversal. r=emilio
MozReview-Commit-ID: 7wH5XcILVmX
2016-11-25 10:06:39 -08:00
Cameron McCormack 4406edcd3a Bug 1318238 - Clear all ServoNodeData during style set shutdown. r=bholley
MozReview-Commit-ID: 9MvBTAWeawC
2016-11-18 16:54:10 +08:00
Bobby Holley 062d98f178 Bug 1292729 - Style text nodes on the main thread. r=heycam
MozReview-Commit-ID: CroFtWpuIrO
2016-10-25 20:10:04 -07:00
Xidorn Quan fe470c1653 Bug 1309868 part 3 - Make NonOwningStyleContextSource store const ServoComputedValues. r=heycam
MozReview-Commit-ID: G84fYXLbQyt

--HG--
extra : source : 85ba0fdfc05ec11dd08eba5a1b1f6a9d7e8acd8f
2016-10-18 15:29:03 +11:00
Xidorn Quan 2f49a48a09 Bug 1304302 part 10 - Replace all uses of StyleSheetHandle. r=heycam
This commit is generated by the following commands with some minor
manual adjustment:

find . \( -name '*.h' -or -name '*.cpp' \) -not -path './layout/style/StyleSheet*' -exec sed -i -b \
  -e '/^\(#include\|using\)/s/StyleSheetHandle/StyleSheet/g' \
  -e 's/\(mozilla::\)\?StyleSheetHandle::RefPtr/RefPtr<\1StyleSheet>/g' \
  -e 's/StyleSheetHandle()/nullptr/g' \
  -e 's/->AsStyleSheet()//g' \
  -e 's/StyleSheetHandle/StyleSheet*/g' {} +
sed -i -b 's/sheet->AsVoidPtr()/sheet.get()/' layout/style/Loader.cpp
sed -i -b 's/AsHandle()/this/' layout/style/StyleSheet.cpp

MozReview-Commit-ID: 7abdvlKHukd

--HG--
extra : source : e5682242db07203b5a91810fe1e243c955310588
2016-09-26 22:03:25 +10:00
Manish Goregaokar aad318e17a Bug 1300337 - Replace None_ variants from nsStyleConsts.h with None; r=heycam,TYLin
MozReview-Commit-ID: CxHzbEzjLxT

--HG--
extra : rebase_source : 232f90b8b107f7fb49f47a29a4e493660b8a7d87
2016-09-04 00:16:58 +05:30
Emilio Cobos Álvarez 619cb14d87 Bug 1299066: Make NS_STYLE_DISPLAY_* an enum class. Prefer indexing instead of linear search in the frame constructor r=heycam,bz
The main renaming was generated with the following python script:

```

import sys
import re

CAMEL_CASE_REGEX = re.compile(r"(^|_|-)([A-Z])([A-Z]+)")
DISPLAY_REGEX = re.compile(r"\bNS_STYLE_DISPLAY_([^M][A-Z_]+)\b")

def to_camel_case(ident):
  return re.sub(CAMEL_CASE_REGEX,
                lambda m: m.group(2) + m.group(3).lower(), ident)

def constant_to_enum(constant):
  return "StyleDisplay::" + to_camel_case(constant) + ("_" if constant == "NONE" else "")

def process_line(line):
  return re.sub(DISPLAY_REGEX,
                lambda m: constant_to_enum(m.group(1)), line)

lines = []
with open(sys.argv[1], "r") as f:
  for line in f:
    lines.append(process_line(line))

with open(sys.argv[1], "w") as f:
  for line in lines:
    f.write(line)
```

And the following shell commands:

```
find . -name '*.cpp' -exec python display.py {} \;
find . -name '*.h' -exec python display.py {} \;
```

MozReview-Commit-ID: 91xYCbLC2Vf
2016-09-01 20:41:17 -07:00
Ryan VanderMeulen f2ae8f9bce Merge m-c to autoland. a=merge 2016-08-31 22:34:02 -04:00
Emilio Cobos Álvarez 31bcff5fe1 Bug 1299396: Don't style content that is not an element or a text node in ServoStyleSet::StyleNewSubtree. r=bholley
MozReview-Commit-ID: KmcYPFqt48W

--HG--
extra : rebase_source : 0aff142b7522e853a8948820cd2c88d84afe5fb8
2016-08-31 14:33:46 -07:00
Bobby Holley ff780d017f Bug 1299348 - Remove StylingStarted(). r=emilio
StylingStarted is a kind of nebulous and not-very-useful concept. The concept
that _is_ useful is whether the presshell has been initialized or not, but the
root element may not exist at that point.

So we need to make sure we that we can trigger the initial document style in both
presshell initialized _and_ ContentInserted, which has the nice effect of handling
root element reinsertions.

We also take the opportunity to make StyleDocument assert the existence of a root
element, and align the responsibility for clearing the dirty descendant bits between
document and non-document nodes.
2016-08-31 10:32:42 -07:00
Emilio Cobos Álvarez ec1d8b030d Bug 1292280: Force a full document restyle on ServoStyleSet::StartStyling. r=bholley
Some things like nsDocumentViewer::SetPageMode recreate the presShell, so we
can't rely on the flags being correctly set always.

MozReview-Commit-ID: 4bxNjXGBaJt

--HG--
extra : rebase_source : f40ddb64d261778be2fd051503f7d2747f0c80e8
2016-08-25 13:36:51 -07:00
Bobby Holley 0453dfa721 Bug 1292662 - Use accessors to unset stylo dirty bits. r=heycam
I often find myself wanting to hook them for logging etc, and this makes the
API symmetric with the setters.
2016-08-25 21:36:57 -07:00
Bobby Holley 95e95fe501 Bug 1292662 - Use StyleChildrenIterator in ServoRestyleManger and ServoStyleSet. r=heycam
Most importantly, this causes us to traverse NAC during style context fixup.
2016-08-25 21:36:51 -07:00
Bobby Holley 263669837b Bug 1292279 - Clear up the semantics of our Servo traversal APIs. r=heycam 2016-08-25 21:34:31 -07:00
Xidorn Quan 611f544c5d Bug 1296173 part 2 - Rename the servo binding functions. r=bholley
MozReview-Commit-ID: Gxqx52v3sDQ

--HG--
extra : rebase_source : 98fdf4a1463680b629c4986df2b2b9c3b306c64e
2016-08-23 13:14:27 +10:00
Xidorn Quan 22456d1070 Bug 1296173 part 1 - Change StyleSet manipulation functions to be prefixed by Servo_StyleSet_. r=bholley
MozReview-Commit-ID: C1PPJltyodE

--HG--
extra : rebase_source : 9aef052b0b41d52ec3dbd90baeec5f4067f03a26
2016-08-23 13:10:49 +10:00
Emilio Cobos Álvarez c74f7fc2ae Bug 1292618: followup: Use IsGeneratedContentContainerForBefore/After in ServoStyleSet. r=me
MozReview-Commit-ID: AU8YKQBvXX7
2016-08-22 10:42:18 -07:00
Emilio Cobos Álvarez 66f4488daf Bug 1292618: Specialize ServoStyleSet::ResolveStyleForText to take into account generated nodes. r=heycam
Eventually, we might want to use the same mechanism that Gecko uses directly,
and stop styling text nodes from Servo.

This would have the benefit of removing the "stash the change on the parent"
thing.

MozReview-Commit-ID: IOxNR05jkh
Signed-off-by: Emilio Cobos Álvarez <ecoal95@gmail.com>
2016-08-19 20:24:28 -07:00
Emilio Cobos Álvarez e7bc43ddc7 Bug 1292618: Support basic pseudo-element restyling. r=heycam
:before and :after only, for now.

MozReview-Commit-ID: 9hLFvVhqIrN
2016-08-19 20:24:27 -07:00
Wes Kocher 02f300c352 Backed out 4 changesets (bug 1292618) because it was making merging things difficult a=backout
Backed out changeset 14733a383b4c (bug 1292618)
Backed out changeset 17dfe8bc5f76 (bug 1292618)
Backed out changeset d04597bd1109 (bug 1292618)
Backed out changeset 30f7696fea2d (bug 1292618)
2016-08-19 18:37:09 -07:00
Emilio Cobos Álvarez 84de3367d5 Bug 1292618: Specialize ServoStyleSet::ResolveStyleForText to take into account generated nodes. r=heycam
Eventually, we might want to use the same mechanism that Gecko uses directly,
and stop styling text nodes from Servo.

This would have the benefit of removing the "stash the change on the parent"
thing.

MozReview-Commit-ID: IOxNR05jkh
Signed-off-by: Emilio Cobos Álvarez <ecoal95@gmail.com>
2016-08-19 18:26:38 -07:00
Emilio Cobos Álvarez 6ca7e9e4f1 Bug 1292618: Support basic pseudo-element restyling. r=heycam
:before and :after only, for now.

MozReview-Commit-ID: 9hLFvVhqIrN
Signed-off-by: Emilio Cobos Álvarez <ecoal95@gmail.com>
2016-08-19 18:26:38 -07:00
Phil Ringnalda b4f23026ee Backed out 5 changesets (bug 1292618) for !mImageTracked assertion failures
CLOSED TREE

Backed out changeset 1d767147e160 (bug 1292618)
Backed out changeset e6034e58efe4 (bug 1292618)
Backed out changeset 928dd363efa0 (bug 1292618)
Backed out changeset 8e274c66ae7f (bug 1292618)
Backed out changeset 6c347701d343 (bug 1292618)
2016-08-19 00:23:42 -07:00
Emilio Cobos Álvarez cee263a02e Bug 1292618: Specialize ServoStyleSet::ResolveStyleForText to take into account generated nodes. r=heycam
Eventually, we might want to use the same mechanism that Gecko uses directly,
and stop styling text nodes from Servo.

This would have the benefit of removing the "stash the change on the parent"
thing.

MozReview-Commit-ID: IOxNR05jkh
2016-08-18 22:16:17 -07:00
Emilio Cobos Álvarez 6614524248 Bug 1292618: Support basic pseudo-element restyling. r=heycam
:before and :after only, for now.

MozReview-Commit-ID: 9hLFvVhqIrN
2016-08-18 22:16:16 -07:00
Manish Goregaokar f054dcd843 Bug 1275913 - Use already_addrefed properly when dealing with arcs sent from servo to gecko; r=bholley
MozReview-Commit-ID: 5FDS8J2Fo1G

--HG--
extra : rebase_source : d58c4a9ceeaa64c522bd25452d607e3593eab619
2016-08-16 10:38:46 +05:30
Phil Ringnalda 0ba1763460 Backed out 2 changesets (bug 1275913) for static analysis bustage
CLOSED TREE

Backed out changeset 4420244e8fba (bug 1275913)
Backed out changeset 324554b04f19 (bug 1275913)
2016-08-15 22:27:16 -07:00
Manish Goregaokar 3f96d89612 Bug 1275913 - Use already_addrefed properly when dealing with arcs sent from servo to gecko; r=bholley
MozReview-Commit-ID: 5FDS8J2Fo1G

--HG--
extra : rebase_source : ecbcb3c2eff5a390a24ab97f93899c87a463c791
2016-08-16 10:38:46 +05:30
Bobby Holley c9097e6d3d Bug 1291885 - Use dont_AddRef for already-addrefed ServoComputedValues. r=emilio 2016-08-03 18:31:02 -07:00