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

8 Коммитов

Автор SHA1 Сообщение Дата
Xidorn Quan 7f4096ebd9 Bug 1171842 - Use jump table instead of nested if statements for peeking compute function of style struct. r=dbaron
--HG--
extra : source : c16172954389dff27f9fee7d4bacc949de662a4c
2015-06-12 14:32:46 +12:00
Kearwood (Kip) Gilbert 4100987cc3 Bug 1140623 - Correct mochitest failures that occur when the layout.css.scroll-snap.enabled preference is enabled (V3 Patch). r=cam
- CSS scroll snapping related attributes are now sorted correctly
- Now passes mochitests with CSS scroll snapping enabled:
  - layout/style/test/test_bug657143.html
  - layout/style/test/test_compute_data_with_start_struct.html
  - layout/style/test/test_property_syntax_errors.html
  - layout/style/test/test_style_struct_copy_constructors.html
  - layout/style/test/test_value_computation.html

--HG--
extra : rebase_source : fe217c528da6806b245c935597855022b3ea2d4b
2015-03-13 18:00:00 +01:00
Xidorn Quan d4289c7714 Bug 1139283 - Move some properties from nsStyleDisplay to nsStylePosition. r=dbaron
The moved properties are:
* clip
* transform-style
* transform-origin
* backface-visibility
* perspective
* perspective-origin
* will-change

--HG--
extra : source : 42bbf0328b450d1094250159fe9f7f0d07622290
2015-03-08 18:43:22 +11:00
Nathan Froyd 096d149883 Bug 1135075 - move generation of nsStyleStructList.h to GENERATED_FILES; r=mshal
We can't completely eliminate the Makefile.in here, because we still
need the INSTALL_TARGETS bits to export the generated header, but we can
at least get rid of a lot of the Makefile.in.
2015-02-20 09:51:28 -05:00
Xidorn Quan fe4b058303 Bug 1122781 part 1 - Declare and statically check dependencies of style structs. r=dbaron
When a cyclic dependency is introduced, build will stop at generating style struct list.
For example, if you make Visibility depend on Font while Font also depend on Visibility, it would print lines like:

ERROR: Cannot resolve style struct dependencies
Resolved items: Variables Color Quotes UserInterface UIReset Table XUL
There exist cyclic dependencies in the following structs: Font List Text Visibility TableBorder SVG Background Position TextReset Display Content Margin Padding Border Outline SVGReset Column

--HG--
extra : source : bebfb64bb4a82ff51b21978998f1a0871a1c5cad
2015-02-07 13:25:21 +11:00
Cameron McCormack c42a6189e5 Bug 773296 - Part 8: Resolve and compute CSS variables. r=dbaron
We add a new class CSSVariableResolver whose job is to take the
inherited computed variables and the specified variable declarations and
to perform cycle removal and resolution of the variables, storing the
result in the CSSVariableValues object on an nsStyleVariables.  We use
CSSVariableResolver in nsRuleNode::ComputeVariablesData.

The variable resolver does this:

  1. Asks the CSSVariableValues and CSSVariableDeclarations objects
     to add their variables to it.
  2. Calls in to a new nsCSSParser function
     EnumerateVariableReferences that informs the resolver which
     other variables a given variable references, and by doing so,
     builds a graph of variable dependencies.
  3. Removes variables involved in cyclic references using Tarjan's
     strongly connected component algorithm, setting those variables
     to have an invalid value.
  4. Calls in to a new nsCSSParser function ResolveVariableValue
     to resolve the remaining valid variables by substituting variable
     references.

We extend nsCSSParser::ParseValueWithVariables to take a callback
function to be invoked when encountering a variable reference.  This
lets EnumerateVariableReferences re-use ParseValueWithVariables.

CSSParserImpl::ResolveValueWithVariableReferences needs different
error handling behaviour from ParseValueWithVariables, so we don't
re-use it.

CSSParserImpl::AppendImpliedEOFCharacters is used to take the
value returned from nsCSSScanner::GetImpliedEOFCharacters while
resolving variable references that were declared using custom
properties that encountered EOF before being closed properly.

The SeparatorRequiredBetweenTokens helper function in nsCSSParser.cpp
implements the serialization rules in CSS Syntax Module Level 3:

https://dvcs.w3.org/hg/csswg/raw-file/3479cdefc59a/css-syntax/Overview.html#serialization
2013-12-12 13:09:41 +11:00
Cameron McCormack 81af48d662 Bug 773296 - Part 4: Add style struct to store CSS variables. r=dbaron
This adds an nsStyleVariables on which computed variable values
will be stored.  We don't actually have any properties assigned to
nsStyleVariables; eCSSPropertyExtra_Variables which we added earlier
isn't a real property.  To avoid compiler errors for gVariableFlags
being a zero length array, we stick a dummy entry in there.

nsRuleNode::ComputeVariablesData does nothing for the moment.

nsStyleVariable nsChangeHint calculations always return 0, as later
we will compare the actual properties that reference variables to
see what changes are required for them.
2013-12-12 13:09:40 +11:00
Cameron McCormack 883a291a54 Bug 873368 - Automatically generate nsStyleStructList.h. r=dbaron,ted 2013-07-16 14:32:25 +10:00