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

213 Коммитов

Автор SHA1 Сообщение Дата
Emilio Cobos Álvarez 1a47c01765 Bug 1384542: Move GetParent and IsLinkContext to GeckoStyleContext. r=heycam
MozReview-Commit-ID: C19yGcphixX
2017-07-31 14:32:59 +02:00
Kevin Hsieh 60a08a4706 bug 1363349 (part 1) - refactor CSSCalc.h to share code better, via a templated ReduceCalcOps class r=dholbert
MozReview-Commit-ID: IvU2StpKHLm

--HG--
extra : rebase_source : 28eded78186364632c9429e0aff2950945249fe1
2017-07-12 18:13:07 -07:00
Cameron McCormack 93c4d245a2 Bug 1353312 - Don't use conditions when caching a struct with no rules. r=dbaron
MozReview-Commit-ID: 2Q1xWcDY10T
2017-07-05 23:23:10 -04:00
Manish Goregaokar 02ab46c24d Bug 1373018 - Part 8: stylo: Move nsStyleContext::SetStyle to GeckoStyleContext; r=bholley
MozReview-Commit-ID: ycXu95whnG

--HG--
extra : rebase_source : 852051aa074cc8ed8f11f0d68c26fe4f0a6962b6
2017-06-10 22:27:45 -07:00
Manish Goregaokar f588139b16 Bug 1367275 - Part 5: stylo: Support -moz-min-font-size-ratio; r=xidorn
MozReview-Commit-ID: xRxkFJodeK
2017-05-27 13:23:15 -07:00
Manish Goregaokar 08fe0e004f Bug 1358634 - Handle fallback to default variable font in case of nonexistant generic ; r=heycam
MozReview-Commit-ID: GHUfkmJNgqG
2017-05-05 12:26:00 -07:00
Manish Goregaokar 9511e12b7f Bug 1349417 - Part 2: stylo: Add basic system font support, use for font-size and font-family; r=xidorn
MozReview-Commit-ID: 4ZMR83GkAZN
2017-04-21 15:40:44 -07:00
Manish Goregaokar 876120ea51 Bug 1349417 - Part 1: stylo: Factor out system font computation into nsRuleNode::ComputeSystemFont; r=xidorn
MozReview-Commit-ID: KfzzCodvLXd
2017-04-21 15:40:40 -07:00
Carsten "Tomcat" Book 4bbc6ddafb Backed out changeset 3586e7877b9e (bug 1349417) for hazard failures 2017-04-19 08:32:06 +02:00
Carsten "Tomcat" Book 1f45312241 Backed out changeset 98094a8c0d46 (bug 1349417) 2017-04-19 08:31:50 +02:00
Manish Goregaokar 57e9997915 Bug 1349417 - Part 2: stylo: Add basic system font support, use for font-size and font-family; r=xidorn
MozReview-Commit-ID: 4ZMR83GkAZN
2017-04-18 21:36:45 -07:00
Manish Goregaokar 4ecbd1c393 Bug 1349417 - Part 1: stylo: Factor out system font computation into nsRuleNode::ComputeSystemFont; r=xidorn
MozReview-Commit-ID: KfzzCodvLXd
2017-04-18 21:33:43 -07:00
Iris Hsiao 2f57ea5bb4 Backed out 3 changesets (bug 1349417) for build bustage
Backed out changeset e6a9aaf8c102 (bug 1349417)
Backed out changeset fbdddabe4c8d (bug 1349417)
Backed out changeset c1ead1f0ab71 (bug 1349417)
2017-04-19 11:03:13 +08:00
Manish Goregaokar 7e8d2f0775 Bug 1349417 - Part 2: stylo: Add basic system font support, use for font-size and font-family; r=xidorn
MozReview-Commit-ID: 4ZMR83GkAZN
2017-04-18 19:31:00 -07:00
Manish Goregaokar ff8c1a3788 Bug 1349417 - Part 1: stylo: Factor out system font computation into nsRuleNode::ComputeSystemFont; r=xidorn
MozReview-Commit-ID: KfzzCodvLXd
2017-04-18 19:30:48 -07:00
Manish Goregaokar 0f5f58cb55 Bug 1341724 - Part 1: stylo: Refactor nsRuleNode::GetMetricsFor; r=heycam
MozReview-Commit-ID: G709Er7GXwe
2017-04-10 17:06:12 +08:00
Jeremy Chen c41d8342dd Bug 1347819 - change nsFont::languageOverride to store uint32_t directly. r=jfkthame
Since font-language-override can only have a single three-letter tag, and it is
eventually converted to uint32_t while creating gfxFontStyle, we should be able
to move the conversion ahead, to an earlier stage.

In this patch, we move the ParseFontLanguageOverride to nsRuleNode, so we could
do the nsString-to-uint32_t conversion during computing time.

MozReview-Commit-ID: LA4Bv3wV7K

--HG--
extra : rebase_source : 48059a9913d58363f78dea59b1b7811d9f038352
2017-03-23 21:59:55 +08:00
Manish Goregaokar 5b55368eda Bug 1330041 - Basic handling framework for presentation attributes in Stylo, with handling for font-size and color; r=bz,emilio
This introduces a basic framework for servo's style system to be able
to query the style of presentation attributes which it can then insert
into the cascade. It uses that framework to implement the size and
color attributes on <font>.

There are a number of improvements that can be done on top of this:

 - Implement all other properties
 - Abstractify the ruledata parameter of the mappers using templates or virtual dispatch so that it can be a Servo decl block instead
 - Implement aforementiond abstraction over Servo decl blocks (this obsoletes the code in the first item above, so it might just be better to skip that and directly do this)
 - Replace uses of nsHTMLStyleSheet with an abstract base class containing common elements between Servo and Gecko

I'd prefer for these to be done in separate steps.

MozReview-Commit-ID: GO60qfeZOfl

--HG--
extra : rebase_source : 516d369a8627e413983361aaf85ccb7132b0a06c
2017-01-19 15:56:53 -08:00
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