Commit Graph

170 Commits

Author SHA1 Message Date
L. David Baron
e70474e604 Bug 841896: Rename CSSKeyframesRule.insertRule to appendRule to match spec change.
Note that this does not change the IID of nsIDOMMozCSSKeyframesRule
since neither the method signature nor semantics have changed; only the
name is different.
2013-02-15 21:38:34 -08:00
L. David Baron
a6ce971075 Bug 765599: Make CSS insertRule methods throw SYNTAX_ERR when given an empty rule or more than one rule. r=bzbarsky
This implements the proposed spec clarification in
http://lists.w3.org/Archives/Public/www-style/2013Feb/0229.html which
makes us compatible with WebKit on the insertRule tests in this patch.

I confirmed that the test reports 7 failures without the patch, but
passes with the patch.  (I'm a little disturbed by the way our
testharness.js integration elides runs of successive passes.)
2013-02-09 22:56:49 -08:00
Boris Zbarsky
eac6d60297 Bug 837031. When unlinking a keyframe rule, make sure to DropReference on its declaration. r=smaug 2013-02-06 14:24:04 +00:00
Boris Zbarsky
005824e1db Bug 774980. Hook up nsCSSKeyframeRule to cycle collection. r=smaug 2013-01-18 23:32:12 -05:00
Trevor Saunders
83bcbe0d6b bug 822289 - remove NS_IMPL_CYCLE_COLLECTION_CLASS and friends r=mccr8 2013-01-12 07:40:33 -05:00
Brendan Dahl
da1c0a3d9e Bug 827591 - Be more careful changing declarations on page rules. r=dbaron 2013-01-09 10:33:09 -08:00
Trevor Saunders
2d1d432957 bug 798567 - convert css values to webidl r=bz 2012-10-01 12:49:41 -04:00
Cameron McCormack
169d8c6267 Bug 816431 - Add unprefixed CSSRule.KEYFRAME{,S}_RULE constants. r=bz 2012-11-29 18:57:32 +11:00
Cameron McCormack
557949bf7e Bug 815021 - Implement MediaRule.conditionText setter. r? 2012-11-27 16:30:31 +11:00
Cameron McCormack
76405ff947 Bug 814907 - Add new CSS GroupingRule and ConditionRule interfaces. r=bz 2012-11-27 16:30:30 +11:00
L. David Baron
43366dc10f Bug 813373, patch 3: Make sure all style rules have non-empty List implementations. r=bzbarsky 2012-11-20 11:55:14 -08:00
Benoit Jacob
986ee1a065 Bug 807437 - Eliminate redundant Traverse/Unlink CC macros - part 1: automatic changes - r=mccr8 2012-11-15 02:32:40 -05:00
Benoit Jacob
06bfb63973 Bug 806279 - CC macros refactoring: part 2: generic BEGIN_ macros folding in the NATIVE case - r=mccr8,smaug 2012-11-15 02:32:39 -05:00
Brendan Dahl
6adcd0523c Bug 115199 - CSS2 @page rule style support. r=dbaron 2012-08-31 14:21:28 -07:00
Ryan VanderMeulen
9cb0f91d55 Backed out changesets 0b6b3d2856a4 and 30776e402787 (bug 115199) for reftest failures. 2012-11-13 20:19:18 -05:00
Brendan Dahl
ec5ca0d279 Bug 115199 - CSS2 @page rule style support. r=dbaron 2012-08-31 14:21:28 -07:00
Boris Zbarsky
a14a96d2cf Bug 801819. Remove nsIDOMCSS2Properties and the classinfo bits for CSS declarations. r=peterv,dbaron 2012-10-30 17:14:06 -04:00
Emmanuele Bassi
c8c63750f6 Bug 784466 - [css3-animations] Drop declarations in keyframe rules that have !important. r=dbaron 2012-10-16 09:21:35 -07:00
Boris Zbarsky
7f699883ea Bug 795221 part 3. Implement cycle collection for GroupRule objects. r=smaug,dbaron
--HG--
rename : content/html/content/crashtests/795221-1.html => content/html/content/crashtests/795221-2.html
2012-10-07 22:39:09 -04:00
Boris Zbarsky
fd9c6f7979 Bug 795221 part 1. Implement cycle collection for nsCSSStyleSheet objects, so we don't leak through them. r=smaug,dbaron
Each nsCSSStyleSheet has a pointer to a nsCSSStyleSheetInner.  The
nsCSSStyleSheetInner is shared across multiple stylesheets, in
general.  The nsCSSStyleSheetInner owns the rules and the child
stylesheets.

What this means is that a given rule object is effectively owned by
multiple sheets.  However, cycles can only form through rule objects
that have been JS-wrapped, and if we're JS-wrapping a rule object that
means we have ensured that it's owned by only one stylesheet.
Therefore, we only traverse and unlink mInner if it's uniquely owned
by our sheet.

Similarly, if our child sheets or any of their rules have been
JS-wrapped, that means that we must have an mInner that we own
outright.
2012-10-07 22:39:08 -04:00
Kyle Huey
43e58e33c8 Bug 760331: Coalesce data for inline style across nodes. r=bz
This patch enables sharing of an nsAttrValue's MiscContainer between nodes for style rules.  MiscContainers of type eCSSStyleRule are now refcounted (with some clever struct packing to ensure that the amount of memory allocated for MiscContainer remains unchanged on 32 and 64 bit).  This infrastructure can be used to share most MiscContainer types in the future if we find advantages to sharing other types than just eCSSStyleRuley.  A cache mapping strings to MiscContainers has been added to nsHTMLCSSStyleSheet.  MiscContainers can be shared between nsAttrValues when one nsAttrValue is SetTo another nsAttrValue or when there is a cache hit in this cache.  This patch also adds the ability to tell a style rule that it belongs to an nsHTMLCSSStyleSheet, with appropriate accessor functions to separate that from the existing case of belonging to an nsCSSStyleSheet.

The primary use case is to reduce memory use for pages that have lots of inline style attributes with the same value.  This can happen easily with large pages that are automatically generated.  An (admittedly pathological) testcase in Bug 686975 sees over 250 MB of memory savings with this change.  Reusing the same MiscContainer for multiple nodes saves the overhead of maintaining separate copies of the string containing the serialized value of the style attribute and of creating separate style rules for each node.  Eliminating duplicate style rules enables further savings in layout through style context sharing.  The testcase sees the amount of memory used by style contexts go from over 250 MB to 10 KB.

Because the cache is based on the text value of the style attribute, it will not handle attributes that have different text values but are parsed into identical style rules.  We also do not attempt to share MiscContainers when the node's base URI differs from the document URI.  The effect of these limitations is expected to be low.
2012-09-30 09:40:24 -07:00
Isaac Aggrey
481e7dfb0b Bug 791906: Replace NSPR integer limit constants with stdint ones; r=ehsan 2012-09-28 01:57:33 -05:00
Randell Jesup
65539ef89c Bug 773151: Convert nsCAutoString->nsAutoCString CLOSED TREE r=bsmedberg 2012-09-01 22:35:17 -04:00
Boris Zbarsky
052e7b0c56 Bug 753517 part 4. Set up auto-generation of CSS2Properties.webidl from nsCSSPropList.h and enable Paris bindings for CSSStyleDeclaration and CSS2Properties. r=khuey,peterv,dbaron 2012-08-23 21:08:09 -07: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
4e199a1679 Bug 780618 - Move all error codes to nsError.h; r=ehsan 2012-07-27 17:03:27 +03:00
Boris Zbarsky
5142e32171 Bug 753517 part 2.75. Fix the QI impls to not lie. r=bustage 2012-08-06 01:24:43 -04:00
Boris Zbarsky
faa7bcc004 Bug 753517 part 2. Make all CSS declarations wrappercached and make them correctly handle preserved wrappers. r=mccr8,peterv,smaug,dbaron 2012-08-05 22:16:30 -04:00
Boris Zbarsky
c4ec20c33e Bug 753517 part 1. Make GetParentObject() on CSS declarations return a useful nsINode if possible. r=peterv,dbaron 2012-08-05 22:14:52 -04:00
Boris Zbarsky
e62cd1b722 Bug 765588. Make CSSFontFaceStyleDecl an nsICSSDeclaration. r=dbaron 2012-08-05 22:14:47 -04:00
Cameron McCormack
e67e975977 Bug 778600 - Indent closing brace when listing GroupRules. r=dbaron 2012-08-04 17:07:03 +10:00
Cameron McCormack
1528758ac5 Bug 649740 - Implement @supports. r=dbaron,bz 2012-08-02 10:32:12 +10:00
Aryeh Gregor
d0ad5a7d0c Bug 777292 part 2 - Change all nsnull to nullptr 2012-07-30 17:20:58 +03:00
Joshua Cranmer
a1186c1020 Bug 773637 - Kill NS_SCRIPTABLE annotations, Part 1: Remove NS_*PARAM annotations. r=ehsan
--HG--
extra : rebase_source : a0b4bc50fece36d9a90fed61431635948bfa33b5
2012-07-06 15:14:07 -05:00
Olli Pettay
aa64d464e5 Bug 765163 - Implement code generator for simple DOM events, r=jst,khuey 2012-07-20 19:42:08 +03:00
Emmanuele Bassi
4b04164545 Bug 762302 - Unprefix CSS Animation properties and @keyframes rule and provide temporary aliases for -moz-animation and exposed subproperties. r=dbaron 2012-07-08 21:25:10 -04:00
Jignesh Kakadiya
fa3c8cce9f Bug 765590 - CSSNameSpaceRule.type should be 10, not 0. r=dbaron 2012-06-21 12:58:19 -07:00
Gervase Markham
82ff7027aa Bug 716478 - update licence to MPL 2. 2012-05-21 12:12:37 +01:00
John Daggett
4984947d00 Bug 718539. Update font-feature-settings to latest spec syntax. r=dbaron 2012-04-26 15:24:26 +09:00
Boris Zbarsky
a479b4be2a Bug 723446. Be a little more careful changing declarations on keyframe rules. r=dbaron 2012-02-02 11:59:39 -05:00
Nicholas Nethercote
0709e1673b Bug 671299 (part 3) - Add style sheet memory reporters. r=dbaron. 2012-01-02 18:19:14 -08:00
Boris Zbarsky
47e571dfac Bug 716226. When using insertRule on a keyframes rule, set up the child keyframe rule correctly. r=dbaron 2012-01-11 14:36:43 -05:00
Nathan Froyd
ac04893f6b Bug 712299 - don't require manual syncing of font data; r=bz 2011-12-20 11:49:16 -05:00
Jeff Walden
e5f13d7b5f Bug 704687 - Mark final classes as MOZ_FINAL, now that nsDerivedSafe no longer exists again. r=dbaron
--HG--
extra : rebase_source : f6a25c06275e4fbb2e69462118f242d380bdce03
2011-12-19 13:48:15 -05:00
Jeff Walden
df2b7cbc5c Bug 704127 - Implement MOZ_FINAL as a modifier for classes and virtual member functions. r=cjones
--HG--
extra : rebase_source : d95a3b3e726f810f299314358ba8c5e23557698e
2011-11-20 22:21:16 -08:00
Zack Weinberg
954dd90cef Bug 659963: consistently use infallible malloc in the CSS parser. r=dbaron 2011-05-28 15:38:48 -07: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
Matheus Kerschbaum ext:(%2C%20L.%20David%20Baron%20%3Cdbaron%40dbaron.org%3E)
1b406143bc Bug 664924 - Remove MOZ_CSS_ANIMATIONS ifdefs. r=dbaron 2011-06-20 16:47:09 -07:00