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

46 Коммитов

Автор SHA1 Сообщение Дата
Cameron McCormack 904f671b03 Bug 1222745 - Restore eRestyleResult_StopWithStyleChange optimization for shared style contexts by comparing rule nodes for inherited style data changes. r=dbaron 2015-11-17 15:09:55 +11:00
L. David Baron 4c8c0044c6 Bug 1221436 patch 4 - Use the same pointer to store the owning rule and the nsHTMLCSSStyleSheet on css::Declaration, since we never need both. r=heycam
The pointer to nsHTMLCSSStyleSheet was added in patch 1 (which was
needed before patch 2), but it was only patch 2 that created the
invariant that we'd only have one pointer or the other, and never both.
Thus this needs to be done separately, after patch 1.

--HG--
extra : commitid : 4KGy9sevepg
2015-11-09 15:57:17 +08:00
L. David Baron f6a21597aa Bug 1221436 patch 1 - Have a pointer back from the css::Declaration for style attributes to the nsHTMLCSSStyleSheet. r=heycam
This is needed for patch 2, since we need a replacement for the
mechanism to get from rules to the style attribute sheet
(nsHTMLCSSStyleSheet) that works instead for declarations rather than
rules.

This pointer will be merged with the owning rule pointer in patch 4, but
we can't do that until after patch 2.

--HG--
extra : commitid : CzWSnFhsbcq
2015-11-09 15:57:16 +08:00
L. David Baron a511f77fef Bug 978833 patch 18 - Eliminate StyleRule::RuleMatched and call Declaration::SetImmutable directly for style rules (like for @page and keyframe rules). r=heycam
This is just simplification (plus the addition of an assertion).

--HG--
extra : commitid : 8jnKsQbG74s
2015-11-05 16:44:10 +08:00
L. David Baron 4ed7c0f036 Bug 978833 patch 7 - Fuse allocation of ImportantStyleData with Declaration. r=heycam
Note that this adds a new public API to css::Declaration; the equivalent
API is removed from css::StyleRule and nsCSSPageRule in patch 13.  But
the removal and addition need to be on opposite sides of patch 12.

This fused allocation is no larger than having a pointer, and it removes
having to worry about cycles.

--HG--
extra : commitid : EOrsMKswNMP
2015-11-05 16:44:09 +08:00
L. David Baron ed0b078c21 Bug 978833 patch 6 - Move ImportantStyleData from StyleRule.{h,cpp} to Declaration.{h,cpp} r=heycam
This is needed for patch 7.

Note that this removes an unused "friend class StyleRule;" declaration.

--HG--
extra : commitid : Fjns3SwV7M1
2015-11-05 16:44:09 +08:00
L. David Baron 8a5bc09609 Bug 978833 patch 4 - Add pointer back from css::Declaration to css::Rule. r=heycam
This is used in patch 12, in nsStyleSet::AssertNoCSSRules and in
inDOMUtils::GetCSSStyleRules.

--HG--
extra : commitid : 8oiNdCdLIV6
2015-11-05 16:44:08 +08:00
L. David Baron 3a0f427640 Bug 978833 patch 3 - Make css::Declaration implement nsIStyleRule. r=heycam
We switch to using this implementation instead of the one in
css::StyleRule in patch 12.

(Yes, implementing QueryInterface for a CID is ugly, but it's the same
thing StyleRule does.  Unfortunately now we'll need to have it in both
places.)

--HG--
extra : commitid : 9O6Z3E868cq
2015-11-05 16:44:08 +08:00
L. David Baron 867d3273b6 Bug 978833 patch 2 - Make css::Declaration reference-counted. r=heycam
This is done in preparation for making it implement nsIStyleRule, which
happens in patch 3, and which is used in patch 12.

--HG--
extra : commitid : 56cV7yfXq59
2015-11-05 16:44:08 +08:00
Nicholas Nethercote 242708cf72 Bug 1127201 (attempt 2, part 1) - Replace most NS_ABORT_IF_FALSE calls with MOZ_ASSERT. r=Waldo.
--HG--
extra : rebase_source : 488e401ff87e31a2074c4108c4df0572d9536667
2015-02-09 14:34:50 -08:00
Andrew McCreight d3826daa16 Back out Bug 1127201 (part 2) for various problems. 2015-02-06 15:04:32 -08:00
Nicholas Nethercote d34f0301b8 Bug 1127201 (part 2) - Convert all NS_ABORT_IF_FALSE calls to MOZ_ASSERT. r=Waldo.
--HG--
extra : rebase_source : 99182e70335d2b5ff95f8c528ae992d37294be3a
2015-02-04 20:05:36 -08:00
Ehsan Akhgari 4354953b4f Bug 1118486 - Part 1: Use `= delete` instead of MOZ_DELETE directly; r=Waldo
Most of this patch (with the exception of dom/bindings/Codegen.py) was
generated by the following bash script:

#!/bin/bash

function convert() {
echo "Converting $1 to $2..."
find . ! -wholename "*nsprpub*" \
       ! -wholename "*security/nss*" \
       ! -wholename "*/.hg*" \
       ! -wholename "*/.git*" \
       ! -wholename "obj-*" \
         -type f \
      \( -iname "*.cpp" \
         -o -iname "*.h" \
         -o -iname "*.cc" \
         -o -iname "*.idl" \
         -o -iname "*.ipdl" \
         -o -iname "*.ipdlh" \
         -o -iname "*.mm" \) | \
    xargs -n 1 sed -i -e "s/\b$1\b/$2/g"
}

convert MOZ_DELETE '= delete'
2015-01-08 23:19:05 -05:00
Cameron McCormack ddd94333b7 Bug 649145 - Store properties on nsCSSCompressedDataBlocks in declaration order. r=dbaron 2014-12-19 14:32:34 +11:00
Cameron McCormack 281ddc537e Bug 985838 - Change custom property name prefix from "var-" to "--" and allow identifiers to begin with "--". r=dbaron 2014-04-02 14:32:16 +11:00
Cameron McCormack 6564f6830a Bug 731271 - Part 4: Add ability for nsCSSValues to serialize themselves in their original syntactic form. r=dbaron 2013-09-16 09:35:49 +10:00
Cameron McCormack f46f8c1436 Bug 955913 - Look up custom property names in a Declaration correctly. r=dbaron 2014-01-02 16:33:57 +11:00
Cameron McCormack 5e31fc11d0 Bug 773296 - Part 23: Support variables in CSSStyleDelcaration methods. r=dbaron
This adds support for custom properties on the remainder of the
CSSStyleDeclaration methods.

A shorthand that was specified using a variable reference is serialized
to its originally specified value, rather than by concatenating the
serializations of its longhand components.

A shorthand that was not specified using a variable references but which
has a component longhand that was is serialized to the empty string.
2013-12-12 13:09:46 +11:00
Cameron McCormack 64924811c6 Bug 773296 - Part 5: Map variables on a Declaration to nsRuleData. r=dbaron
This adds a CSSVariableDeclarations object to nsRuleData and adds a
MapRuleInfoInto function to CSSVariableDeclarations so the can copy
variable declarations into a nsRuleData's object.  We call that from
Declaration::Map{Normal,Important}RuleInfoInto.

We make HasImportantData return true if we have important variables
but no important non-custom properties on a declaration, since that
is used to determine whether we have a rule node for important
declarations.  This means MapImportantRuleInfoInto can no longer
assume that mImportantData is non-null.
2013-12-12 13:09:41 +11:00
Cameron McCormack a8cf86e4b7 Bug 773296 - Part 2: Parse CSS variable declarations and store them on Declaration objects. p=ebassi,heycam r=dbaron
Patch co-authored by Emmanuele Bassi <ebassi@gmail.com>

This defines a CSSVariableDeclarations class that holds a set of
variable declarations.  This is at the specified value stage, so values
can either be 'initial', 'inherit' or a token stream (which is what you
normally have).  The variables are stored in a hash table.  Although
it's a bit of a hack, we store 'initial' and 'inherit' using special
string values that can't be valid token streams (we use "!" and ";").

Declaration objects now can have two CSSVariableDeclarations objects
on them, to store normal and !important variable declarations.  So that
we keep preserving the order of declarations on the object, we inflate
mOrder to store uint32_ts, where values from eCSSProperty_COUNT onwards
represent custom properties.  mVariableOrder stores the names of the
variables corresponding to those entries in mOrder.

We also add a new nsCSSProperty value, eCSSPropertyExtra_variable, which
is used to represent any custom property name.
nsCSSProps::LookupProperty can return this value.

The changes to nsCSSParser are straightforward.  Custom properties
are parsed and checked for syntactic validity (e.g. "var(a,)" being
invalid) and stored on the Declaration.  We use nsCSSScanner's
recording ability to grab the unparsed CSS string corresponding to
the variable's value.
2013-12-12 13:09:40 +11:00
Trevor Saunders 99d8dc50c9 bug 659722 - remove _IMPL_NS_LAYOUT r=bz 2013-03-16 00:31:38 -04:00
Catalin Iacob 6f4758d23e Bug 798914 (part 5) - Use newly introduced mozilla::MallocSizeOf instead of nsMallocSizeOfFun. r=njn.
--HG--
extra : rebase_source : fc472490dd978d165f02f77ed37f07aed6e5bb61
2013-06-23 14:03:39 +02:00
John Daggett 9e4257c826 Bug 833624. Bump up size of int's in mOrder to allow more than 256 CSS properties. r=dbaron 2013-01-24 02:24:27 +09:00
Boris Zbarsky 688a8b41eb Bug 753517 part 3. Expose the API needed for Paris bindings on nsDOMCSSDeclaration and nsICSSDeclaration. r=dbaron,peterv 2012-08-23 21:08:08 -07:00
Ehsan Akhgari e368dc9c85 Bug 579517 - Part 1: Automated conversion of NSPR numeric types to stdint types in Gecko; r=bsmedberg
This patch was generated by a script.  Here's the source of the script for
future reference:

function convert() {
echo "Converting $1 to $2..."
find . ! -wholename "*nsprpub*" \
       ! -wholename "*security/nss*" \
       ! -wholename "*/.hg*" \
       ! -wholename "obj-ff-dbg*" \
       ! -name nsXPCOMCID.h \
       ! -name prtypes.h \
         -type f \
      \( -iname "*.cpp" \
         -o -iname "*.h" \
         -o -iname "*.c" \
         -o -iname "*.cc" \
         -o -iname "*.idl" \
         -o -iname "*.ipdl" \
         -o -iname "*.ipdlh" \
         -o -iname "*.mm" \) | \
    xargs -n 1 sed -i -e "s/\b$1\b/$2/g"
}

convert PRInt8 int8_t
convert PRUint8 uint8_t
convert PRInt16 int16_t
convert PRUint16 uint16_t
convert PRInt32 int32_t
convert PRUint32 uint32_t
convert PRInt64 int64_t
convert PRUint64 uint64_t

convert PRIntn int
convert PRUintn unsigned

convert PRSize size_t

convert PROffset32 int32_t
convert PROffset64 int64_t

convert PRPtrdiff ptrdiff_t

convert PRFloat64 double
2012-08-22 11:56:38 -04:00
Aryeh Gregor d0ad5a7d0c Bug 777292 part 2 - Change all nsnull to nullptr 2012-07-30 17:20:58 +03:00
Gervase Markham 82ff7027aa Bug 716478 - update licence to MPL 2. 2012-05-21 12:12:37 +01:00
Jonathan Watt 3864018bdb Bug 721920 - Honor the 'lang' and 'xml:lang' attributes in SVG as we do in HTML. r=bz. 2012-02-19 20:49:34 +00:00
Nicholas Nethercote 0709e1673b Bug 671299 (part 3) - Add style sheet memory reporters. r=dbaron. 2012-01-02 18:19:14 -08:00
Jeff Walden 62f48d8793 Bug 711647 - Add MOZ_DELETE to a bunch of deliberately-not-implemented methods across the tree. r=dbaron
--HG--
extra : rebase_source : 507006c0f099da6851b585d2062267d285978ad7
2011-12-16 14:42:07 -05:00
Ehsan Akhgari 92064e6d3f Bug 690892 - Replace PR_TRUE/PR_FALSE with true/false on mozilla-central; rs=dbaron
Landing on a CLOSED TREE
2011-10-17 10:59:28 -04:00
Michael Wu d2b70213ac Bug 675553 - Switch from PRBool to bool on a CLOSED TREE , r=bsmedberg,khuey,bz,cjones
--HG--
rename : tools/trace-malloc/bloatblame.c => tools/trace-malloc/bloatblame.cpp
2011-09-28 23:19:26 -07:00
L. David Baron 4e3e6d8813 Fix css3-animations handling of properties that are not present in all keyframes to match WebKit and generally be more sensible. (Bug 649400) r=bzbarsky
This inverts the relationship between segments and properties in the
animation data structures:  now each property has a set of segments,
since the segments differ between properties.

Furthermore, we now handle inability to interpolate between values by
dropping the entire property rather than dropping a single segment.
2011-04-22 18:36:23 -07:00
Ehsan Akhgari 39981a468e Bug 613130 - Don't sanitize style nodes and attributes in the sanitizing parser if we have not found any unsafe properties; r=roc,bzbarsky a=blocking-final+ 2010-11-24 13:31:52 -05:00
Zack Weinberg 2b0421048a Bug 576044 (11/12): Make all assertions fatal in Declaration.h, Declaration.cpp, nsCSSDataBlock.h, nsCSSDataBlock.cpp, nsCSSValue.h, nsCSSValue.cpp, nsCSSProps.h, and nsCSSProps.cpp. r=dbaron a2.0=dbaron 2010-08-19 15:33:44 -04:00
Zack Weinberg fa13062b84 Bug 576044 (8/12): remove the last MoveValue call from the CSS parser. r=dbaron a2.0=dbaron 2010-08-19 15:33:44 -04:00
Zack Weinberg f66c604171 Bug 576044 (7/12): cleanup pass on css/Declaration.{h,cpp} and nsCSSDataBlock.{h,cpp}. r=dbaron a2.0=dbaron 2010-08-19 15:33:44 -04:00
Zack Weinberg f892a0765b Bug 576044 (6/12): remove vestiges of nsCSSType. r=dbaron a2.0=dbaron 2010-08-19 15:33:44 -04:00
Zack Weinberg 19e2c4da92 Bug 338679: mark style declarations immutable if they are stringified. r=bzbarsky a=dbaron 2010-08-02 15:40:35 -07:00
Zack Weinberg 24feb13867 Bug 569719 part 16: Don't refcount declarations and data blocks; don't have style rules hold direct pointers to data blocks. r+a=dbaron 2010-07-23 11:00:52 -07:00
Zack Weinberg 4f39493716 Bug 569719 part 15: Always copy the entire css::Declaration before changing it in any way. r=dbaron 2010-07-23 11:00:49 -07:00
Zack Weinberg 143a4b55b1 Bug 569719 part 11: take the fast path in ParseProperty for !important replacing !important, as well as normal replacing normal. r=dbaron 2010-07-23 11:00:39 -07:00
Zack Weinberg b184cb662d Bug 569719 part 9: remove return value from css::Declaration methods that always return NS_OK, and change GetCSSDeclaration to return a css::Declaration instead of an nsresult. r=dbaron 2010-07-23 11:00:34 -07:00
Zack Weinberg 785d0ccdde Bug 569719 part 7: Add AppendToString methods to nsCSSRect and friends as well, replacing Declaration::AppendStorageToString. r=dbaron 2010-07-23 11:00:29 -07:00
Zack Weinberg b0de4806b7 Bug 569719 part 6: Move Declaration::AppendCSSValueToString into nsCSSValue. r=dbaron 2010-07-23 11:00:27 -07:00
Zack Weinberg 2f4426c2f1 Bug 569719 part 2: Move headers for the former nsCSSLoader and nsCSSDeclaration into mozilla/css/. r=dbaron
--HG--
rename : layout/style/nsCSSDeclaration.cpp => layout/style/Declaration.cpp
rename : layout/style/nsCSSDeclaration.h => layout/style/Declaration.h
rename : layout/style/nsCSSLoader.cpp => layout/style/Loader.cpp
rename : layout/style/nsCSSLoader.h => layout/style/Loader.h
2010-06-28 15:49:35 -07:00