Commit Graph

114 Commits

Author SHA1 Message Date
Cameron McCormack
eb835df7de Bug 921731 - Part 1: Add new eCSSUnit_Unset unit for nsCSSValues. r=bzbarsky 2013-10-04 04:49:17 +10:00
Ehsan Akhgari
37bbcfc9c9 Bug 919355 - Part 2: Don't #include nsDeviceContext.h in Units.h; r=roc 2013-09-23 07:55:35 -04:00
Ehsan Akhgari
86a457baf2 Bug 916610 - Minimize the #includes in layout/style; r=roc 2013-09-15 21:06:52 -04:00
Robert O'Callahan
33cdb42706 Bug 910989. Remove nsTHashtable::Init, fallible allocation, and MT hashtables. r=ehsan,bsmedberg
--HG--
extra : rebase_source : 0787130b1814c74bfb38dc178de94022f0b2e64e
2013-09-02 20:41:57 +12:00
Daniel Holbert
398fec2b87 Bug 907547: Update nsCSSValue::BufferFromString documentation to indicate that it's infallible, and remove callers' unneeded null-checks. r=bz 2013-08-21 12:31:38 -07:00
John Daggett
4e3a388690 Bug 875250 - implement CSS parsing of text-orientation, text-combine-horizontal properties. r=dholbert 2013-08-19 19:26:44 +09:00
Ms2ger
df8525f77d Bug 901323 - Don't include nsContentUtils.h unnecessarily; r=jlebar 2013-08-14 08:56:21 +02:00
Ehsan Akhgari
5ee21d6d3f Bug 895322 - Part 1: Replace the usages of MOZ_STATIC_ASSERT with C++11 static_assert; r=Waldo
This patch was mostly generated by running the following scripts on the codebase, with some
manual changes made afterwards:

# static_assert.sh
#!/bin/bash
# Command to convert an NSPR integer type to the equivalent standard integer type

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 "*.cc" \
         -o -iname "*.mm" \) | \
    xargs -n 1 `dirname $0`/assert_replacer.py #sed -i -e "s/\b$1\b/$2/g"
}

convert MOZ_STATIC_ASSERT static_assert
hg rev --no-backup mfbt/Assertions.h \
                   media/webrtc/signaling/src/sipcc/core/includes/ccapi.h \
                   modules/libmar/src/mar_private.h \
                   modules/libmar/src/mar.h


# assert_replacer.py
#!/usr/bin/python

import sys
import re

pattern = re.compile(r"\bMOZ_STATIC_ASSERT\b")

def replaceInPlace(fname):
  print fname
  f = open(fname, "rw+")
  lines = f.readlines()
  for i in range(0, len(lines)):
    while True:
      index = re.search(pattern, lines[i])
      if index != None:
        index = index.start()
        lines[i] = lines[i][0:index] + "static_assert" + lines[i][index+len("MOZ_STATIC_ASSERT"):]
        for j in range(i + 1, len(lines)):
          if lines[j].find("                 ", index) == index:
            lines[j] = lines[j][0:index] + lines[j][index+4:]
          else:
            break
      else:
        break
  f.seek(0, 0)
  f.truncate()
  f.write("".join(lines))
  f.close()

argc = len(sys.argv)
for i in range(1, argc):
  replaceInPlace(sys.argv[i])

--HG--
extra : rebase_source : 4b4a4047d82f2c205b9fad8d56dfc3f1afc0b045
2013-07-18 13:59:53 -04:00
Catalin Iacob
4f03e5bb1a 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
L. David Baron
94e83383a2 Bug 511803 patch 2: Convert all eCSSUnit_Function storage to use nsCSSKeyword. This leads to one behavior change, which is case canonicalization for font-variant-alternates function values. r=bzbarsky
--HG--
rename : layout/style/test/test_bug721136.html => layout/style/test/test_specified_value_serialization.html
2013-05-23 09:08:29 +08:00
John Daggett
18ea34f1e4 Bug 549861 - reland font-variant subproperties with DOM-peer review. r=khuey 2013-05-20 11:59:20 +09:00
Ms2ger
c80e8cd5c6 Backout bug 549861 (changesets 27fb48df15ce:7ecd4e3863b4) for insufficient review. 2013-05-19 20:23:19 +02:00
John Daggett
54f6e3ae74 Bug 549861. Changes based on review comments for parsing of font-variant-alternates. r=dbaron 2013-05-13 18:45:38 +09:00
John Daggett
633de7d681 Bug 549861. Implement CSS parsing of font-variant-alternates. r=dbaron 2013-05-13 18:45:37 +09:00
John Daggett
7b0b7f608c Bug 549861. Parse simple font-variant subproperties. r=dbaron 2013-05-13 18:45:36 +09:00
Nathan Froyd
eba34f22d7 Bug 858131 - rewrite FloatingPoint.h to be C++-only instead of C-compatible C++; r+original-author=Waldo 2013-05-01 16:55:13 -04:00
Aryeh Gregor
d183f6f9bc Bug 859817 - Make nsStringBuffer::Alloc return already_AddRefed; r=bz 2013-04-22 14:13:22 +03:00
Ms2ger
a2173990cc Bug 845374 - Part l: Stop including nsIDocument.h in nsContentUtils.h and fix two nits; r=khuey 2013-03-17 08:55:15 +01:00
Kyle Huey
a2581f4219 Bug 816498: Fix some things about background attribute handling that are still broken. r=bz
As filed the bug is about table backgrounds failing to print.  The root cause of this is that we load images from the original document, because print/print-preview documents (which are static clones of the original) cannot do loads.  This results in an entry in the css::ImageValue's request table under the original document, but entry under the printing document.  Then we do layout, try to get the request, and fail, and nothing is displayed.  The solution to this is to force us to clone the request for the printing document if we're loading off the original document.  I manually verified that this does not regress Bug 560235.

While writing a test for this, we discovered another problem.  The reftest print code does not actually use the printing codepath.  Instead it takes an existing document, tears down its presshell, and creates a new presshell for printing.  Fixing the above bug did not make the reftest print test pass because ImageLoader does not deal properly with presshell destruction/recreation.  It assumes that when the presshell is destroyed all of the css::ImageValues can be cleared of their entries for that document.  This fails for ImageValues for mapped attributes because they are held alive by the content tree.  When a new presshell for this document is then created there is no entry for the document and thus no image request to paint.  The fix for this is to only clear the frame to request and request to frame mapping hashtables and not to clear the document's entry on the ImageValue when the presshell is destroyed.  The destruction of the ImageLoader (which is held from a strong reference on the document) is when those entries are removed.  The final change is to change css::ImageValue's hashtable from holding a strong reference to the keys (which are documents) to holding raw pointer references.  This is safe because we clear the relevant entry when the corresponding ImageLoader dies, and is needed to prevent a reference cycle that was being broken by presshell destruction.

--HG--
rename : layout/reftests/backgrounds/table-background-ref.html => layout/reftests/backgrounds/table-background-print-ref.html
rename : layout/reftests/backgrounds/table-background.html => layout/reftests/backgrounds/table-background-print.html
2013-02-23 06:59:43 -08:00
Cameron McCormack
572084f298 Bug 828805 - Implement SVG paint-order property. r=bz,roc 2013-01-13 10:27:53 +11:00
Jeff Muizelaar
b4e2a8d95a Bug 801061. Switch from imgIRequest to imgRequestProxy. r=joe
This doesn't switch all of the users yet, but is a step in the right
direction.

--HG--
extra : rebase_source : 91b4fef3f67586179c119208d000cf7629e04963
2012-10-12 08:43:01 -04:00
Jet Villegas
3398141cef Bug 806068 part 1: Add support for unprefixed "initial" keyword in CSS (retaining prefixed keyword as an alias, for now). r=dholbert 2012-10-30 16:40:33 +01:00
Jacek Szpot
0b35b0e3d8 Bug 792180 - Replace NS_{UN,}LIKELY with MOZ_{UN,}LIKELY; r=ehsan 2012-10-26 15:32:10 +02:00
Mats Palmgren
5d8d5869e1 Bug 798853, style system. r=roc,dbaron 2012-10-22 15:53:31 +02:00
Seth Fowler
f07bf4e48c Bug 503720: Implement vw/vh/vmin/vmax. r=dbaron 2012-10-19 16:21:06 -07:00
Randell Jesup
eedf93a21d Bug 773151: Convert nsCAutoString->nsAutoCString CLOSED TREE r=bsmedberg 2012-09-01 22:35:17 -04:00
Kyle Huey
1a68eab98d Bug 783162: Make mapped attributes hold the image alive. r=bz
The nsCSSValue in nsGenericHTMLElement::MapBackgroundInto is a temporary.  This causes a problem after Bug 697230 landed, because the nsCSSValue::Image we put into that value is destroyed once we're done doing style stuff.  Previously the nsImageLoader would grab the request off the nsCSSValue::Image and hold it alive.  Bug 697230 changed the behavior here; now when the nsCSSValue::Image is destroyed it tells the image loader to drop the request.  The result is that all the references to the request are dropped and the frame is never told it has a background.

The solution is to keep the nsCSSValue::Image alive longer.  This patch adds two new types of nsAttrValue.  The first is an nsCSSValue::URL.  A ParseBackgroundAttribute method is added on nsGenericHTMLElement that the relevant elements (body/td/th/table/tr/tbody/thead/tfoot) call that parses background into an nsCSSValue::URL.  The second is an nsCSSValue::Image.  nsGenericHTMLElement::MapBackgroundInto attempts to convert the nsCSSValue::URL into an nsCSSValue::Image by kicking off the image load.  The result is that image loads are only started when the element is actually visible.  This also mirrors the way background-image works.  This also allows us to fix two longstanding bugs in this code.  Since MapBackgroundInto doesn't have a pointer to the actual element, it relied on grabbing the principal of the document.  Now we can grab the principal of the node in ParseBackgroundAttribute.  MapBackgroundInto also has no way to get at the element's base URI (to honor xml:base), which is now possible in ParseBackgroundAttribute.

nsCSSValue::[Image|URL] have also been moved to be mozilla::css::[Image|URL]Value.  nsAttrValue.h is included in external linkage code, so it can't include nsCSSValue.h to get the declarations of nsCSSValue::[Image|URL], and nested classes can't be forward declared.  Moving the classes to a namespace solves the problem.

Finally some old inoperative quirks mode code was removed.  This code has done nothing since Bug 273078 was landed in 2004.
2012-08-24 10:50:49 -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
Kyle Huey
0cc1c18795 Bug 697230: Part 1 - Centralize style image observers. r=bz 2012-08-13 15:04:19 -07:00
Simon Montagu
4ae7b52fd9 Implement the new CSS property value unicode-bidi: isolate-override. Bug 774335, r=dbaron 2012-08-07 01:42:46 -07:00
Aryeh Gregor
e806eeab4f Bug 777292 part 2 - Change all nsnull to nullptr 2012-07-30 17:20:58 +03:00
David Zbarsky
71be33bfa0 Bug 773500 Part 1:Store z-component of transform-origin as 0 rather than null when it is omitted. r=dbaron 2012-07-21 19:48:19 -04:00
Masatoshi Kimura
780a1d99a0 Bug 752187 - Part 11: Implement serializing unprefixed gradients. r=dbaron 2012-07-07 10:27:09 -04:00
Masatoshi Kimura
162441c196 Bug 752187 - Part 9: Implement unprefixed radial-gradient parsing. r=dbaron 2012-07-07 10:27:08 -04:00
Masatoshi Kimura
05280fd9ca Bug 752187 - Part 6: Rename mIsToCorner to mIsLegacySyntax. r=dbaron 2012-07-07 10:27:08 -04:00
Gervase Markham
ca171eec44 Bug 716478 - update licence to MPL 2. 2012-05-21 12:12:37 +01:00
Mats Palmgren
d68c6d758f Bug 615112 - Use correct type for a string length. r=bz 2012-05-04 02:14:01 +02:00
John Daggett
127ee0627d Bug 718539. Update font-feature-settings to latest spec syntax. r=dbaron 2012-04-26 15:24:26 +09:00
Kyle Huey
50f43dd111 Back out Bug 679230 due to Android reftest failures. 2012-04-07 10:36:49 -07:00
Kyle Huey
7a78607b88 Bug 697230: Part 1 - Centralize style image observers. r=bz 2012-04-07 08:58:41 -07:00
Zack Weinberg
15a9a210d0 Bug 729142 - Convert layout/style to MOZ_STATIC_ASSERT. r=dbaron 2012-02-23 08:19:00 -08:00
Jesse Ruderman
91db7e7d83 Bug 726465 - Add eCSSUnit_Turn case to nsCSSValue::SizeOfExcludingThis. r=bz 2012-02-12 17:51:58 -08:00
Boris Zbarsky
b5877864ea Bug 716628. Implement support for 'turn' unit in CSS. r=dbaron 2012-02-04 00:01:23 -05:00
Nicholas Nethercote
2806f8e46a Bug 671299 (part 3) - Add style sheet memory reporters. r=dbaron. 2012-01-02 18:19:14 -08:00
William Chen
1a42df4570 Bug 497995: Part 1 - Implement border-image revisions in latest css3-background spec. r=dbaron
--HG--
extra : rebase_source : 5a6cdac6a4b1353170f23f39dd2a209374e72531
2011-12-22 18:34:45 -05:00
Masatoshi Kimura
b62835cb59 Bug 685400 - add "to" syntax and "magic corner" feature to CSS linear gradient. r=dbaron
--HG--
rename : layout/reftests/css-gradients/linear-ref.html => layout/reftests/css-gradients/linear-1-ref.html
rename : layout/reftests/css-gradients/linear.html => layout/reftests/css-gradients/linear-1b.html
rename : layout/reftests/css-gradients/linear-diagonal-1-ref.html => layout/reftests/css-gradients/linear-diagonal-1c.html
rename : layout/reftests/css-gradients/linear-diagonal-2-ref.html => layout/reftests/css-gradients/linear-diagonal-2c.html
rename : layout/reftests/css-gradients/linear-diagonal-3-ref.html => layout/reftests/css-gradients/linear-diagonal-3c.html
rename : layout/reftests/css-gradients/linear-diagonal-4-ref.html => layout/reftests/css-gradients/linear-diagonal-4c.html
rename : layout/reftests/css-gradients/linear-keywords-ref.html => layout/reftests/css-gradients/linear-keywords-1-ref.html
rename : layout/reftests/css-gradients/linear-keywords.html => layout/reftests/css-gradients/linear-keywords-1b.html
2011-10-22 21:41:11 +02:00
Zack Weinberg
572b6a6160 Bug 659963: consistently use infallible malloc in the CSS parser. r=dbaron 2011-05-28 15:38:48 -07:00
Simon Montagu
5aadea5d7b Support for unicode-bidi: -moz-isolate and -moz-plaintext in style system. Bug 613149, r=dbaron 2011-10-18 14:51:57 +02: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