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

195 Коммитов

Автор SHA1 Сообщение Дата
Jonathan Kew 1c18c32f59 Bug 1321022 pt 4.2 - Fix up some nits in existing font-feature-settings code as per review comments on the new font-variation-settings code. r=dholbert 2016-12-03 12:18:39 +00:00
Jonathan Kew cd6fcd068a Bug 1321022 pt 4 - Implement CSS parsing of the font-variations-setting property, storing the value into nsFont. r=dholbert 2016-12-03 12:18:36 +00:00
Hiroyuki Ikezoe 1ef4ddc756 Bug 1289701 - Find the root style context by walkng up the style context tree instead of calling ResolveStyleFor or getting it from root element's primary frame. r=dbaron
The only call site of CalcLengthWith() with a null style context is
CalcLengthWithInitialFont(). CalcLengthWithInitialFont() calls
CalcLengthWith() with a valid nsStyleFont and aUseProvidedRootEmSize
true, so we can get the rem unit font size from the nsStyleFont when called
from CalcLengthWithInitialFont().

MozReview-Commit-ID: A9LKfQEozaB
2016-11-30 07:46:27 +09:00
Manish Goregaokar 72b2c59e0f Bug 1300731 - stylo: Implement mask-image; r=heycam
MozReview-Commit-ID: DyGNnP07tZm

--HG--
extra : rebase_source : eadea6aa867eeeade198d30fa339f695bab10745
2016-09-06 18:20:30 +08:00
Nicholas Nethercote b71747b2ac Bug 1299727 - Rename NS_WARN_IF_FALSE as NS_WARNING_ASSERTION. r=erahm.
The new name makes the sense of the condition much clearer. E.g. compare:

  NS_WARN_IF_FALSE(!rv.Failed());

with:

  NS_WARNING_ASSERTION(!rv.Failed());

The new name also makes it clearer that it only has effect in debug builds,
because that's standard for assertions.

--HG--
extra : rebase_source : 886e57a9e433e0cb6ed635cc075b34b7ebf81853
2016-09-01 15:01:16 +10:00
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
Wes Kocher f09e8fef1a Merge inbound to central, a=merge 2016-08-26 16:20:50 -07:00
Mats Palmgren ddcd7a20ef Bug 1279182 - [css-grid] Resolve a <percentage> grid-gap of an indefinite CB size to zero. r=dholbert 2016-08-26 15:16:56 +02:00
Manish Goregaokar 71b464a2fc Bug 1297064 - stylo: Add bindings for filling nsStyleImageLayers lists; r=heycam
MozReview-Commit-ID: Bstgf23gMRu

--HG--
extra : rebase_source : 7c98dcbd2cc1ae730ce788e9db0071c1595ceb6b
2016-08-22 18:31:41 +05:30
Nathan Froyd d9759d258f Bug 1295192 - part 1 - remove CPP_THROW_NEW on layout struct operator new overloads that forward to nsPresShell::AllocateByObjectID; r=dholbert
Structs in our style system use an arena-style allocation system,
managed by the presshell to which they belong.  All of the relevant
overloads that forward allocation requests to the presshell declare
themselves as CPP_THROW_NEW, which indicates that they do not throw
exceptions.  The C++ specification states that operator new overloads
that declare themselves to not throw exceptions require a null check on
their return value.  However, the relevant presshell allocation method,
AllocateByObjectID, is infallible and will never return a null pointer.

The callers of all of these methods are therefore doing useless
(compiler-generated) null checks.  Let's get rid of those useless checks
by removing the CPP_THROW_NEW annotations.  This change declares these
methods will return non-null pointers and throw exceptions in case of
errors--but as we don't use exceptions, and AllocateByObjectID will
abort on OOM, everything works out OK.
2016-08-17 15:28:45 -04:00
Jonathan Chan b35975ec17 Bug 1293739 - Part 2: Rename nsCSSPropertySet to nsCSSPropertyIDSet. r=dholbert
The previous patch in this series renamed nsCSSProperty to nsCSSPropertyID.
This patch renames nsCSSPropertySet to nsCSSPropertyIDSet accordingly.

This patch is generated by the following commands (note: if you're running
using OS X's sed, which accepts slightly different flags, you'll have to
specify an actual backup suffix in -i, or use gsed from Homebrew):

  hg stat -c \
  | cut -c 3-  \
  | tr '\n' '\0' \
  | xargs -0 -P 8 gsed --follow-symlinks 's/\bnsCSSPropertySet\b/nsCSSPropertyIDSet/g' -i''

Then:

  hg mv layout/style/nsCSSPropertySet.h layout/style/nsCSSPropertyIDSet.h

... and finally, manually renaming nsCSSPropertySet in the include guard in
nsCSSPropertyIDSet.h.

(NOTE: Re-landing this patch on a CLOSED TREE to correctly-address the merge bustage that closed the tree.)

MozReview-Commit-ID: ASUNs7FWbKP

--HG--
rename : layout/style/nsCSSPropertySet.h => layout/style/nsCSSPropertyIDSet.h
2016-08-16 18:46:58 -07:00
Jonathan Chan 4b87f11bd9 Bug 1293739 - Part 1: Rename nsCSSProperty to nsCSSPropertyID. r=dholbert
This patch is generated by the following commands (note: if you're running
using OS X's sed, which accepts slightly different flags, you'll have to
specify an actual backup suffix in -i, or use gsed from Homebrew):

  hg stat -c \
  | cut -c 3-  \
  | tr '\n' '\0' \
  | xargs -0 -P 8 gsed --follow-symlinks 's/\bnsCSSProperty\b/nsCSSPropertyID/g' -i''

Then:

  hg mv layout/style/nsCSSProperty.h layout/style/nsCSSPropertyID.h

... and finally, manually renaming nsCSSProperty in the include guard in
nsCSSProperty.h.

MozReview-Commit-ID: ZV6jyvmLfA

--HG--
rename : layout/style/nsCSSProperty.h => layout/style/nsCSSPropertyID.h
2016-08-16 18:37:48 -07:00
Gregory Szorc 1794619188 Backed out changesets dcdb85fc5517, 702bca0deee2, 9cKX8gC1ATA (bug 1293739) for build bustage; a=bustage
The merge from inbound to central conflicted with the merge from
autoland to central, it appears. Per tree rules, the commit from the
autoland repo wins and the inbound commit gets backed out.

CLOSED TREE

--HG--
extra : amend_source : 927e1cdfa8e55ccbd873d404d905caf6871c8c4f
extra : histedit_source : 07095868c3f767258e1d7d2645193bf4811b13bb%2Ca49ae5a28bf6e67298b6208ee9254c25a2539712
2016-08-16 17:50:40 -07:00
Wes Kocher 48b8d407c8 Merge inbound to central, a=merge
a=release to get around the webidl hook for a comment-only change

--HG--
extra : amend_source : f7e57101e1a25d3cf3536a256898ec2a21c54b38
2016-08-16 17:05:30 -07:00
Wes Kocher 57773cd69e Backed out 4 changesets (bug 1295192) for being a possible cause of crashtest assertions CLOSED TREE
Backed out changeset 7f10779fe019 (bug 1295192)
Backed out changeset e683dce4197a (bug 1295192)
Backed out changeset 67d12eaa8074 (bug 1295192)
Backed out changeset 44f143a01f78 (bug 1295192)
2016-08-16 11:22:04 -07:00
Daisuke Akatsuka 095d7039ae Bug 1277433 - Part 1: Use discrete animation for appropriate CSS Alignment properties. r=dholbert,heycam
MozReview-Commit-ID: BHtzuwJOuB5

--HG--
extra : rebase_source : 975720e6ce68743ab8915a62f8f8cda48ee69340
2016-08-16 14:29:21 +09:00
Nathan Froyd fa4f709cfd Bug 1295192 - part 1 - remove CPP_THROW_NEW on layout struct operator new overloads that forward to nsPresShell::AllocateByObjectID; r=dholbert
Structs in our style system use an arena-style allocation system,
managed by the presshell to which they belong.  All of the relevant
overloads that forward allocation requests to the presshell declare
themselves as CPP_THROW_NEW, which indicates that they do not throw
exceptions.  The C++ specification states that operator new overloads
that declare themselves to not throw exceptions require a null check on
their return value.  However, the relevant presshell allocation method,
AllocateByObjectID, is infallible and will never return a null pointer.

The callers of all of these methods are therefore doing useless
(compiler-generated) null checks.  Let's get rid of those useless checks
by removing the CPP_THROW_NEW annotations.  This change declares these
methods will return non-null pointers and throw exceptions in case of
errors--but as we don't use exceptions, and AllocateByObjectID will
abort on OOM, everything works out OK.
2016-08-16 17:05:39 -04:00
Jonathan Chan 4ffd49c097 Bug 1293739 - Part 2: Rename nsCSSPropertySet to nsCSSPropertyIDSet. r=dholbert
The previous patch in this series renamed nsCSSProperty to nsCSSPropertyID.
This patch renames nsCSSPropertySet to nsCSSPropertyIDSet accordingly.

This patch is generated by the following commands (note: if you're running
using OS X's sed, which accepts slightly different flags, you'll have to
specify an actual backup suffix in -i, or use gsed from Homebrew):

  hg stat -c \
  | cut -c 3-  \
  | tr '\n' '\0' \
  | xargs -0 -P 8 gsed --follow-symlinks 's/\bnsCSSPropertySet\b/nsCSSPropertyIDSet/g' -i''

Then:

  hg mv layout/style/nsCSSPropertySet.h layout/style/nsCSSPropertyIDSet.h

... and finally, manually renaming nsCSSPropertySet in the include guard in
nsCSSPropertyIDSet.h.

MozReview-Commit-ID: ASUNs7FWbKP

--HG--
rename : layout/style/nsCSSPropertySet.h => layout/style/nsCSSPropertyIDSet.h
2016-08-09 16:28:21 -07:00
Jonathan Chan 9c62a2c11c Bug 1293739 - Part 1: Rename nsCSSProperty to nsCSSPropertyID. r=dholbert
This patch is generated by the following commands (note: if you're running
using OS X's sed, which accepts slightly different flags, you'll have to
specify an actual backup suffix in -i, or use gsed from Homebrew):

  hg stat -c \
  | cut -c 3-  \
  | tr '\n' '\0' \
  | xargs -0 -P 8 gsed --follow-symlinks 's/\bnsCSSProperty\b/nsCSSPropertyID/g' -i''

Then:

  hg mv layout/style/nsCSSProperty.h layout/style/nsCSSPropertyID.h

... and finally, manually renaming nsCSSProperty in the include guard in
nsCSSProperty.h.

MozReview-Commit-ID: ZV6jyvmLfA

--HG--
rename : layout/style/nsCSSProperty.h => layout/style/nsCSSPropertyID.h
2016-08-09 16:28:19 -07:00
Ting-Yu Lin fe89202517 Bug 1289052 - Move nsRuleNode methods as static functions to .cpp file. r=heycam
MozReview-Commit-ID: 7tG2NlvQzGz

--HG--
extra : rebase_source : dc44ac14f3cdbb73c1425b078a63394da2f96e81
2016-07-25 17:26:44 +08:00
Hiroyuki Ikezoe 7b1125457a Bug 1282076 - Store all non-inherited structs which are stored on the rule node on the style context if we have animation data. r=heycam 2016-07-21 06:12:41 +09:00
Emilio Cobos Álvarez e6ed33b04e Bug 1283242: style: Whitespace cleanup and remove dead code. r=bobbyholley+313730
gNewCount and gSharedCount aren't even declared.

--HG--
extra : rebase_source : 3c7d79a360ad6eef2e884de513ee45a289d4cd0a
2016-06-29 11:27:42 +00:00
Ting-Yu Lin d06693b2f0 Bug 1274835 - Refactor code to process basic shape from clip-path. r=heycam
This can be used in the implementation of shape-outside.

MozReview-Commit-ID: C7bd4D2Kwpm

--HG--
extra : rebase_source : fefdd869b1ede3c518e496d8b25ffa5953a7145d
2016-05-22 20:41:19 +08:00
Cameron McCormack 0718df89c3 Bug 1261754 - Part 8: Move box-shadow from nsStyleBorder to a new nsStyleEffects struct. r=dholbert 2016-04-12 15:52:42 +10:00
Cameron McCormack 6883fc4b42 Bug 1261754 - Part 3: Move quotes from nsStyleQuotes to nsStyleList and delete nsStyleQuotes. r=dholbert 2016-04-12 15:52:40 +10:00
Bobby Holley 3836b7c35b Bug 1258017 - Redesign and simplify rule tree GC. r=dbaron
The basic idea here is as follows:
* Rule nodes are reference-counted, but releasing them adds them to a linked
  list rather than freeing them. This allows for the reuse that motivated the
  original GC scheme.
* We get rid of the marking, and instead rely on the reference count.
* Sweeping no longer requires a complicated traversal. We just pop items
  off the free list until it's empty. When a child is destroyed, its parent
  may go onto the free list.
* We remove special handling for the root node, and use a regular reference-counted
  edge from the style set.
* The free list automatically asserts that it's empty (meaning all nodes have been
  freed) in its destructor, which runs when the style set is destroyed.
* We get rid of the list of style context roots on the style set. We still need
  a count though, because of the HasCachedStyleData check.
2016-03-28 08:59:22 -07:00
Bobby Holley 69d08c6cad Bug 1258017 - Use an nsCOMPtr to hold onto the nsIStyleRule. r=dbaron 2016-03-28 08:59:20 -07:00
Nicholas Nethercote a2f068b2ad Bug 1253085 - Remove the |PLDHashTable*| argument from PLDHash{HashKey,MatchEntry}. r=froydnj.
This is easy because it's never needed.

--HG--
extra : rebase_source : 78830dab41c40a1544fa55fc69ca9c1c6709d767
2016-03-16 15:33:44 +11:00
Nicholas Nethercote ac9a8bf77c Bug 1181444 (part 1.5) - Remove dead PLDHashOperator declarations. r=froydnj.
--HG--
extra : rebase_source : 82888ad8037a6024508b042030469fac5a8f5fa4
2016-01-28 14:08:19 -08:00
L. David Baron d7a6acad77 Bug 1216431 patch 8 - Fix whitespace error I made when addressing review comments.
--HG--
extra : transplant_source : %AFBD%1Bh4%86%D5gtK%9F%24%09%FE%B7%3F%23%F6%D0
2015-10-30 10:00:01 +09:00
L. David Baron 8acc13bdfa Bug 1216431 patch 6 - Back out bug 1209603 patch 8. r=heycam
This requires a little bit of gymnastics since it has to add the inverse
of tests, since the is-a-reset-struct tests originally added in patch 8
were made unconditional in patch 9, and with this backout we now want to
execute the code only for inherited structs.

This also doesn't back out the cleanup to use NS_STYLE_INHERIT_BIT() for
constants rather than nsCachedStyleData::GetBitForSID.

This backs out the part of bug 1209603 whose speed I was concerned about.

--HG--
extra : commitid : 6BWdXCpywlU
extra : rebase_source : 15597857a721a3a399432c8454ecfc7b789e5e2d
2015-10-23 08:57:36 +09:00
L. David Baron 93a9119fd5 Bug 1216431 patch 4 - Don't trigger computation of new structs via testing of conditions for conditionally-stored structs on the rule node. r=heycam
This is the replacement fix for bug 1209603.

--HG--
extra : commitid : EKsTIfcAu4h
extra : rebase_source : bdb8678c0c7854b91681cc0dde9199cf7b3ce17c
2015-10-23 08:57:35 +09:00
L. David Baron 98f6eaaddc Bug 1216431 patch 3 - Cache structs that are stored with conditions on the rule node all the time, rather than only when freshly computed. r=heycam
This is another case similar to the problem fixed in bug 1209603 patch 9.

This should make things faster by caching structs on the style context
more reliably.

--HG--
extra : commitid : GdalxPoI0wr
extra : rebase_source : 103e678a237f723b386b517d478e70214a75467e
2015-10-23 08:57:35 +09:00
Cameron McCormack 9b05852073 Bug 1208951 - Part 3: Expose nsCSSValue -> nsTimingFunction computation function. r=birtles 2015-10-22 19:22:37 +11:00
L. David Baron bf8dc97f0b Bug 1209603 patch 9 - Cache inherited style structs on the style context when we found already-cached data in the rule tree. r=heycam
This means we obey the invariant that if we've requested an inherited
struct on a context, that struct will be cached on the style context.  I
believe bug 527977 intended to do make us obey this invariant, but it
missed the case where nsRuleNode::GetStyle* found cached data already on
the rule node, and the case where nsRuleNode::WalkRuleTree found a
usable struct higher in the rule tree.

Without this change, patch 10 will not function correctly for inherited
structs when we encounter this case, and will cause assertions in
dom/base/test/test_bug560780.html due to triggering style change hints
on text nodes that inherited a color struct from a parent on whose rule
node the struct was stored.  (It may also have caused some of the other
test failures.)

This should be a clear performance improvement, since the path that's
being slowed down by the added work in this patch will, with the patch,
now only execute once because of that work.

--HG--
extra : commitid : 5hueOZihqNx
2015-10-19 20:42:29 -07:00
L. David Baron 4a3869c519 Bug 1209603 patch 8 - Record in mBits when we have gotten a reset style struct that is cached on the rule node. r=heycam
I'm a little worried about the performance of the change to
nsRuleNode::GetStyle*, which sets a bit on the style context every time
a struct getter goes through it.  It's not obvious how that compares to
the performance benefit from patch 10.

--HG--
extra : commitid : J2XERgJ7mh2
2015-10-19 20:42:29 -07:00
L. David Baron 442ad165f3 Bug 1209603 patch 7 - Add assertions that we don't ask the rule node for data when we have cached data on the style context. r=heycam
These document an invariant that I depend on in the next patch.

--HG--
extra : commitid : HPQbuHOVq3o
2015-10-19 20:42:28 -07:00
Cameron McCormack 2f1046d287 Bug 1216043 - Rename nsStyleSheet::sheetType and make it an enum class. r=dbaron
The only substantive change here, apart from a few variables changing in
size from uint16_t to uint8_t, is FontFaceSet's use of SheetType::Unknown
(0xFF) instead of 0 for FontFaceRecords for script-created FontFaces.
2015-10-20 10:16:20 +11:00
Cameron McCormack be6487a748 Bug 1203766 - Part 1: Generate nsPresArena::ObjectIDs with a preprocessor-included file. r=bzbarsky 2015-09-17 12:08:19 +10:00
Cameron McCormack 3585bedd89 Bug 1181011 - Don't use cached rule node structs for animations within pseudo-elements. r=dbaron a=abillings 2015-07-27 16:43:44 +10:00
Cameron McCormack 56634d96ba Bug 804975 - Part 3: Support conditional cached reset structs on rule nodes. r=dbaron 2015-06-23 11:48:18 +10:00
Cameron McCormack 225f3dd70d Bug 804975 - Part 2: Add a RuleNodeCacheConditions class and use it instead of a boolean canStoreInRuleTree during style computation. r=dbaron 2015-06-23 11:48:18 +10:00
Nicholas Nethercote e6ec6218c6 Bug 1171282 - Avoid some unnecessary |operator new| null-checks in layout/. r=dholbert.
AllocateByObjectID() is infallible. Therefore the |operator new| of nsFrameList,
nsLineBox and nsRuleNode are too, as is nsRuleNode::CreateRootNode().

The patch also removes a couple of comments duplicated in both .h and .cpp
files.

--HG--
extra : rebase_source : 0b9e195fd547fdd53ddad7bb461ff5f5c2016fce
2015-06-03 23:45:11 -07:00
Nicholas Nethercote e849e6588b Bug 1170416 (part 3) - Remove the PLDHashTable2 typedef. r=froydnj.
--HG--
extra : rebase_source : 9510ea47204fffa163cac43aeaaac6ae1ad80419
2015-05-19 16:46:17 -07:00
Cameron McCormack ff106a4844 Bug 1147766 - Part 2: Replace FixedStyleStructArray with mozilla::RangedArray. r=dbaron 2015-05-23 12:50:44 +10:00
Cameron McCormack 93417eae1e Backed out changeset a6fa096f9853 and ec1c41143ff6 (bug 1147766) since I messed up the warning fix. 2015-05-23 15:51:14 +10:00
Cameron McCormack 343eb90c2c Bug 1147766 - Part 2: Replace FixedStyleStructArray with mozilla::RangedArray. r=dbaron 2015-05-23 12:50:44 +10:00
Phil Ringnalda d63c42b6f0 Back out 2 changesets (bug 1147766) for -Werror bustage
CLOSED TREE

Backed out changeset 10d6fcd9a4e0 (bug 1147766)
Backed out changeset 5754455de846 (bug 1147766)
2015-05-22 20:24:08 -07:00
Cameron McCormack b338e51cf4 Bug 1147766 - Part 2: Replace FixedStyleStructArray with mozilla::RangedArray. r=dbaron 2015-05-23 12:50:44 +10:00
Nicholas Nethercote 0fd018143a Bug 1166586 (part 1) - Remove all uses of PL_NewDHashTable() and PL_DHashTableDestroy(). r=froydnj.
They're not needed now that there is (temporarily) PLDHashTable2, which has an
initializing constructor and a destructor.

--HG--
extra : rebase_source : 78d3eeb326935ad7a19e3bdf9b2092eb2a4208a7
2015-05-04 22:59:24 -07:00