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

221 Коммитов

Автор SHA1 Сообщение Дата
Cameron McCormack 0a20585745 Bug 1418899 - Part 4: Move image layer filling function out of nsRuleNode. r=cjku
MozReview-Commit-ID: 2FXGFEkpIKE

--HG--
extra : rebase_source : 280c85f0e53e6426289580a345685898888ed266
2017-11-20 13:53:58 +08:00
Cameron McCormack 630cd9c74f Bug 1418899 - Part 3: Use a single image layer array filling function. r=cjku
We were accidentally using the background one for the mask layers list anyway,
and I don't think the overhead of filling the arrays for the two properties
mask layers don't use is a problem.

MozReview-Commit-ID: 7LDiYGrnUd5

--HG--
extra : rebase_source : 573d70e0e8c4d110ca6da2846e6fd2887b1fded2
2017-11-20 13:44:22 +08:00
Cameron McCormack 3991f1ba0d Bug 1418899 - Part 2: Move some font-related static methods out of nsRuleNode. r=TYLin
MozReview-Commit-ID: 3l9L6bHr0PJ

--HG--
extra : rebase_source : 4d60e21f70a0e8b7a54b009ca6f5d6c2c90a80bd
2017-11-20 12:43:21 +08:00
Cameron McCormack d8a0eb82de Bug 1418899 - Part 1: Remove some unused method declarations on nsRuleNode. r=TYLin
MozReview-Commit-ID: FOBOjJRJCea

--HG--
extra : rebase_source : ff3bf2cccf2ec21bdbaf61c8112ee97bc3306bfe
2017-11-20 13:09:16 +08:00
Ting-Yu Lin dc7e13b5d5 Bug 1418905 - Move nsRuleNode::ComputeCoordPercentCalc() into nsStyleCoord. r=heycam
MozReview-Commit-ID: GLLseBxhUiP

--HG--
extra : rebase_source : 2940610dbb5e81e463db82459a46a54eb693e5cb
2017-11-20 14:05:19 +08:00
Ting-Yu Lin 320b123d4b Bug 1418905 - Move nsRuleNode::ComputeComputedCalc() into nsStyleCoord. r=heycam
MozReview-Commit-ID: LFxZGzyyii6

--HG--
extra : rebase_source : 516a8ed1a372d483f4c96cd392c1d382b0b4e38a
2017-11-20 13:30:27 +08:00
Daniel Holbert 680815cd6e Bug 1412346 part 5: (automated patch) Switch a bunch of C++ files in layout to use our standard mode lines. r=jfkthame
This patch was generated automatically by the "modeline.py" script, available
here: https://github.com/amccreight/moz-source-tools/blob/master/modeline.py

For every file that is modified in this patch, the changes are as follows:
 (1) The patch changes the file to use the exact C++ mode lines from the
     Mozilla coding style guide, available here:
https://developer.mozilla.org/en-US/docs/Mozilla/Developer_guide/Coding_Style#Mode_Line

 (2) The patch deletes any blank lines between the mode line & the MPL
     boilerplate comment.

 (3) If the file previously had the mode lines and MPL boilerplate in a
     single contiguous C++ comment, then the patch splits them into
     separate C++ comments, to match the boilerplate in the coding style.

MozReview-Commit-ID: EuRsDue63tK

--HG--
extra : rebase_source : 3356d4b80ff6213935192e87cdbc9103fec6084c
2017-10-27 10:33:53 -07:00
Emilio Cobos Álvarez d389330c2e Bug 1403592: Never flush the user font set when getting font metrics from style resolution. r=Manishearth
In this case, the caller doesn't go through all the PreTraverseSync stuff (we
don't really want it to do so), via GetComputedStyleNoFlush.

It makes sense to not flush the user font set that case, we'll schedule a
restyle properly if / when needed.

Since the set should be flushed otherwise, let's just not flush it from the
styling code.

MozReview-Commit-ID: LLHfxemJ8QQ
2017-09-28 10:12:50 +02:00
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