Commit Graph

102 Commits

Author SHA1 Message Date
Boris Zbarsky
7cb30ff9c6 Bug 801819. Remove nsIDOMCSS2Properties and the classinfo bits for CSS declarations. r=peterv,dbaron 2012-10-30 17:14:06 -04:00
Emmanuele Bassi
13034b2dd7 Bug 784466 - [css3-animations] Drop declarations in keyframe rules that have !important. r=dbaron 2012-10-16 09:21:35 -07:00
Boris Zbarsky
529cae9883 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
1aa9d15695 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
e5eb83ac5a 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
997db4d142 Bug 791906: Replace NSPR integer limit constants with stdint ones; r=ehsan 2012-09-28 01:57:33 -05:00
Randell Jesup
eedf93a21d Bug 773151: Convert nsCAutoString->nsAutoCString CLOSED TREE r=bsmedberg 2012-09-01 22:35:17 -04:00
Boris Zbarsky
31276eb444 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
8b4fc28fc2 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
0fd9123eac 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
0923bf00ef Bug 780618 - Move all error codes to nsError.h; r=ehsan 2012-07-27 17:03:27 +03:00
Boris Zbarsky
f21609d807 Bug 753517 part 2.75. Fix the QI impls to not lie. r=bustage 2012-08-06 01:24:43 -04:00
Boris Zbarsky
1b8d2356ea 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
ab8c73b485 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
bb5cc2f15d Bug 765588. Make CSSFontFaceStyleDecl an nsICSSDeclaration. r=dbaron 2012-08-05 22:14:47 -04:00
Cameron McCormack
b2484ca0f4 Bug 778600 - Indent closing brace when listing GroupRules. r=dbaron 2012-08-04 17:07:03 +10:00
Cameron McCormack
d7f2d311ed Bug 649740 - Implement @supports. r=dbaron,bz 2012-08-02 10:32:12 +10:00
Aryeh Gregor
e806eeab4f Bug 777292 part 2 - Change all nsnull to nullptr 2012-07-30 17:20:58 +03:00
Joshua Cranmer
4b8f318e78 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
e9cea4305c Bug 765163 - Implement code generator for simple DOM events, r=jst,khuey 2012-07-20 19:42:08 +03:00
Emmanuele Bassi
0eecac73f7 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
b2ead13822 Bug 765590 - CSSNameSpaceRule.type should be 10, not 0. r=dbaron 2012-06-21 12:58:19 -07:00
Gervase Markham
ca171eec44 Bug 716478 - update licence to MPL 2. 2012-05-21 12:12:37 +01:00
John Daggett
127ee0627d Bug 718539. Update font-feature-settings to latest spec syntax. r=dbaron 2012-04-26 15:24:26 +09:00
Boris Zbarsky
ad5fde345e Bug 723446. Be a little more careful changing declarations on keyframe rules. r=dbaron 2012-02-02 11:59:39 -05:00
Nicholas Nethercote
2806f8e46a Bug 671299 (part 3) - Add style sheet memory reporters. r=dbaron. 2012-01-02 18:19:14 -08:00
Boris Zbarsky
2788f777bb 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
fdce3db512 Bug 712299 - don't require manual syncing of font data; r=bz 2011-12-20 11:49:16 -05:00
Jeff Walden
f16def0c00 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
19f38bafe5 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
572b6a6160 Bug 659963: consistently use infallible malloc in the CSS parser. r=dbaron 2011-05-28 15:38:48 -07:00
Ehsan Akhgari
2a602a5685 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
d8e503c38b 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)
6469811981 Bug 664924 - Remove MOZ_CSS_ANIMATIONS ifdefs. r=dbaron 2011-06-20 16:47:09 -07:00
L. David Baron
54e4f6cd4e Add missing break (Bug 398962) r=bzbarsky 2011-06-12 18:52:32 -07:00
Craig Topper
12e260dad8 Bug 648925 - Part 5: Make nsCSSKeyframeRule use inherited AddRef/Release from Rule. r=bzbarsky 2011-05-06 00:33:57 -07:00
Craig Topper
17b6db1001 Bug 648925 - Part 4: DeCOMtaminate GetDOMRule and GetDOMRuleWeak. r=bzbarsky 2011-04-07 23:36:09 -07:00
Craig Topper
94aa5754fd Bug 648925 - Part 3: Factor some common method bodies into css::Rule. r=bzbarsky 2011-04-11 19:46:35 -07:00
Craig Topper
6cca47869f Bug 648925 - Part 2: Make several css::Rule methods non-virtual and inline. r=bzbarsky 2011-04-07 20:51:25 -07:00
Craig Topper
cc15a2a6e3 Bug 648925 - Part 1: Change uses of nsICSSRule to css::Rule. r=bzbarsky 2011-04-07 18:23:46 -07:00
L. David Baron
babad15001 Audit for places in style rule code that need to check for a null sheet. (Bug 634373) r=bzbarsky 2011-05-02 18:43:44 -07:00
L. David Baron
b712774643 Add support for regexp() function in @-moz-document rule. (Bug 398962) r=bzbarsky 2011-04-28 10:21:37 -07:00
Boris Zbarsky
3d5031fd5d Bug 649163. Stop refcounting the return values from GetCSSParsingEnvironment, where possible. r=dbaron
--HG--
extra : rebase_source : 13d75f3954dd1597d58f7741ac8cfc4de51ebe46
2011-04-27 16:53:49 -04:00
L. David Baron
6d48884578 Allow null media query cache key in some places. (Bug 542058, patch 2) r=bzbarsky 2011-04-21 20:17:31 -07:00
L. David Baron
25d74a36a4 Remove null-checks of nsCSSParser, since construction is infallible. (Bug 542058, patch 1) r=bzbarsky
Note that many callers already skipped the null-checks.
2011-04-21 20:17:31 -07:00
L. David Baron
7e86462271 ifdef CSS animations so that the feature can be backed out by flipping the switches in configure.in and then reverting the changes to the following four files appropriately: nsIDOMCSS2Properties.idl, nsIDOMCSSRule.idl, property_database.js, test_transitions_computed_values.html. (Bug 435442, patch 15) r=bzbarsky 2011-04-11 23:18:44 -07:00
L. David Baron
f80131c3b4 Implement parsing and storage of @keyframes rule. (Bug 435442, patch 5) r=bzbarsky 2011-04-11 23:18:43 -07:00
L. David Baron
0de989d5b1 Fix style rule inheritance macros. (Bug 435442, patch 4) r=bzbarsky 2011-04-11 23:18:43 -07:00
L. David Baron
b149cd157b Clean up handling of CSSOM modifications to rules that are non-child descendants of a sheet. (Bug 435442, patch 3) r=bzbarsky
This fixes handling of a number of cases:
 1. Modifications to a style rule inside a group rule now trigger
    GetRuleCascades.
 2. A sheet that has been (potentially) modified is reliably marked as
    such, and thus never cloned.
2011-04-11 23:18:43 -07:00
Craig Topper
4d575fe7cd Bug 645956 - Part 5: Remove NS_NewCSSCharsetRule, r=bzbarsky 2011-03-22 23:20:09 -07:00