Commit Graph

53 Commits

Author SHA1 Message Date
Andi-Bogdan Postelnicu
88cc63910d Bug 1453795 - DOM - Initialize member fields in classes/ structures. r=peterv
--HG--
extra : rebase_source : 249fc26e50bded4e94f5effa4308af0f1e54b908
2018-06-16 17:21:46 +03:00
Petru Gurita
b54c9e5044 Bug 1445216 - remove useless initialization of variable atFirstColumn in nsPlainTextSerializer::Write. r=bz
The `atFirstColumn` variable is set on both branches of an 'if' before it's read.

MozReview-Commit-ID: 2HezoWgnOb1

--HG--
extra : rebase_source : 74e0d2d7685c69ddcbf2313ce14e4886d904432b
2018-06-26 23:23:43 +03:00
Sebastian Hengst
0819f35e51 Backed out 4 changesets (bug 525063) on request from Andi. a=backout
Backed out changeset 516c4fb1e4b8 (bug 525063)
Backed out changeset 6ff8aaef2866 (bug 525063)
Backed out changeset bf13e4103150 (bug 525063)
Backed out changeset d7d2f08e051c (bug 525063)
2018-04-13 16:01:28 +03:00
Tristan Bourvon
a3a77c0312 Bug 525063 - Initialize uninitialized class attributes in m-c. r=ehsan 2018-04-10 21:11:02 +02:00
Jonathan Watt
384c345f21 Bug 1448294 - Clean up naming of 'styleContext' variables after the big nsStyleContext rename. r=emilio
Reviewers: emilio

Bug #: 1448294

Differential Revision: https://phabricator.services.mozilla.com/D796

MozReview-Commit-ID: KJq2i9nrg7y
2018-03-25 20:49:58 +02:00
Narcis Beleuzu
47581f78e2 Backed out 2 changesets (bug 1448294, bug 1448337) for wpt and reftest failures on /mathml
Backed out changeset 180051cfe357 (bug 1448294)
Backed out changeset c188176f3289 (bug 1448337)
2018-03-25 21:31:08 +03:00
Jonathan Watt
21bff4e120 Summary: Bug 1448294 - Clean up naming of 'styleContext' variables after the big nsStyleContext rename. r=emilio
Reviewers: emilio

Bug #: 1448294

Differential Revision: https://phabricator.services.mozilla.com/D796
2018-03-22 13:49:21 +00:00
Emilio Cobos Álvarez
e341b20ec4 Bug 1447483: Merge nsStyleContext and ServoStyleContext, rename to ComputedStyle. r=jwatt on a CLOSED TREE
MozReview-Commit-ID: JPopq0LudD
2018-03-22 20:06:24 +01:00
Emilio Cobos Álvarez
5dd797f154 Back out changeset b683bb3f22a1 (Bug 1447483) for not landing with all the files. r=me on a CLOSED TREE
This reverts commit 1808914126bb9f9e4a82d2c3d7ac961885fe7d62.

MozReview-Commit-ID: 5skESBseEvo
2018-03-22 20:05:22 +01:00
Emilio Cobos Álvarez
ca5ac79cca Bug 1447483: Merge nsStyleContext and ServoStyleContext, rename to ComputedStyle. r=jwatt
MozReview-Commit-ID: JPopq0LudD
2018-03-22 19:48:42 +01:00
Nicholas Nethercote
8ac9830be0 Bug 1444031 - Rename Is{Static,Dynamic,HTML5}Atom. r=froydnj
By removing the "Atom" suffix, which is redundant.

MozReview-Commit-ID: 4MCX9Icfjrw

--HG--
extra : rebase_source : c3c759a508a8938b59d36dbb20448d2964b98c91
2018-03-07 15:17:34 +11:00
Emilio Cobos Álvarez
7dffe29d8f Bug 1432490: Make nsComputedDOMStyle::GetStyleContext / GetStyleContextNoFlush not take a presShell. r=bz
Everyone calls them with the shell of the current composed document, and this
allows the multi-presShell stuff to just be in UpdateCurrentStyleSources /
DoGetStyleContextNoFlush.

The only reason we need to use OwnerDoc()->GetShell() instead of the composed
doc in GetStyleContext / GetStyleContextNoFlush is Element::GetBindingURL, which
does expect to get the binding URL for stuff outside of the composed doc (and
changing that gave me a useless browser).

That's technically a behavior change on the cases that used to pass nullptr, but
I think all callers are fine with that. I could also just add a special function
for that particular case, it may be worth it.

MozReview-Commit-ID: 2XlnkgdgDCK
2018-02-25 02:23:59 +01:00
Nathan Froyd
1dc8c21c65 Bug 1435911 - use a static const char array in nsPlainTextSerializer::DoOpenContainer; r=farre
We never modify this array, so it might as well live in read-only
memory.
2018-02-07 12:49:43 -05:00
Masatoshi Kimura
8b05ff3704 Bug 1427023 - Remove nsCRT::strncmp. r=erahm 2018-01-09 23:49:37 +09:00
Jonathan Kew
1a613e00cb Bug 1424898 - patch 2 - De-virtualize nsIWordBreaker and rename to mozilla::intl::WordBreaker. r=m_kato
--HG--
rename : intl/lwbrk/nsSampleWordBreaker.cpp => intl/lwbrk/WordBreaker.cpp
rename : intl/lwbrk/nsIWordBreaker.h => intl/lwbrk/WordBreaker.h
2017-12-13 22:17:38 -06:00
Henri Sivonen
009840a99b Bug 1409951 - Use a stack to end serializer contexts instead of recomputing them. r=smaug
MozReview-Commit-ID: FOd8AUmtYyA
2017-12-01 10:45:25 -05:00
Nicholas Nethercote
d225f7151b Bug 1400460 - Rename nsIAtom as nsAtom. r=hiro.
(Path is actually r=froydnj.)

Bug 1400459 devirtualized nsIAtom so that it is no longer a subclass of
nsISupports. This means that nsAtom is now a better name for it than nsIAtom.

MozReview-Commit-ID: 91U22X2NydP

--HG--
rename : xpcom/ds/nsIAtom.h => xpcom/ds/nsAtom.h
extra : rebase_source : ac3e904a21b8b48e74534fff964f1623ee937c67
2017-10-03 09:05:19 +11:00
Sylvestre Ledru
4e9cf83ee8 Bug 1378712 - Remove all trailing whitespaces r=Ehsan
MozReview-Commit-ID: Kdz2xtTF9EG

--HG--
extra : rebase_source : 7235b3802f25bab29a8c6ba40a181a722f3df0ce
2017-07-06 14:00:35 +02:00
Henri Sivonen
432653453a Bug 1261841 part 2 - Use encoding_rs instead of uconv. r=emk,mystor.
MozReview-Commit-ID: 15Y5GTX98bv
2017-06-13 13:23:23 +03:00
Ehsan Akhgari
7f656414b1 Bug 1370737 - Track seen preformatted elements in the document encoder to maintain stack balance correctly irrespective of element visibility; r=bzbarsky 2017-06-13 00:30:36 -04:00
Makoto Kato
8109941e51 Bug 1359707 - Preferences::GetBool(PREF_ALWAYS_INCLUDE_RUBY) should use AddBoolVarCache. r=smaug
When profiling nsDocumentEncoder::EncodeToStringWithMaxLength for text/plain, 25% is Preferences::GetBool into nsPlainTextSerializer::Init.  So we should use AddBoolVarCache for it.

MozReview-Commit-ID: 9CVd4OZzzr5

--HG--
extra : rebase_source : 6b860927b64109ae41a07a161f47612df2f176b7
2017-04-27 12:44:24 +09:00
Makoto Kato
5de0b5ae57 Bug 1358979 - nsPlainTextSerializer should be cycle collection. r=smaug
nsPlainTextSerializer holds Element, so it should use cycle collection class.

MozReview-Commit-ID: ELykrDQaCei

--HG--
extra : rebase_source : b711fe051297f3cfbee603cd2f785dbc21dfc59b
2017-04-24 19:17:17 +09:00
Brian Birtles
33041d1214 Bug 1315874 - Drop 'ForElement' from GetStyleContextForElementXXX methods; r=heycam
In the next patch we want to add a method called
GetUnanimatedStyleContextForElementNoFlush but that's much too long. Instead it
seems better to just drop 'ForElement' from all these methods since it should be
fairly obvious we are getting the style context for an element given that the
first argument is an element.

MozReview-Commit-ID: JQKaEuCKV2F

--HG--
extra : rebase_source : 3ba51f3b00d1ec7bc91102629d9c0abb88992fef
2017-04-05 14:39:23 +09:00
Jorg K
cadd291ee3 Bug 456053 - Don't trim trailing space of quoted lines. r=masayuki 2016-09-29 07:10:00 +02:00
Nicholas Nethercote
b71747b2ac Bug 1299727 - Rename NS_WARN_IF_FALSE as NS_WARNING_ASSERTION. r=erahm.
The new name makes the sense of the condition much clearer. E.g. compare:

  NS_WARN_IF_FALSE(!rv.Failed());

with:

  NS_WARNING_ASSERTION(!rv.Failed());

The new name also makes it clearer that it only has effect in debug builds,
because that's standard for assertions.

--HG--
extra : rebase_source : 886e57a9e433e0cb6ed635cc075b34b7ebf81853
2016-09-01 15:01:16 +10:00
Chris Peterson
d634a99cad Bug 1277106 - Part 4: Remove MOZ_UTF16() macro. r=Waldo 2016-07-19 21:07:53 -07:00
Chris Peterson
b175c9fdd5 Bug 1277106 - Part 2: Expand MOZ_UTF16() strings to u"" string literals. r=Waldo 2016-07-20 22:03:25 -07:00
Jorg K
4897ff0e7a Bug 1274837 - don't crash by accessing string beyond its length. r=masayuki 2016-05-23 06:35:00 +02:00
Jorg K
435ec5d98e Bug 233705 - remove mDontWrapAnyQuotes, mWrapToWindow and pref wrap_to_window_width. r=ehsan 2016-04-04 23:54:00 +02:00
Jorg K
6b710fa7ee Bug 1225864 - New flag OutputDisallowLineBreaking to disallow line breaking. r=masayuki. 2015-11-27 15:27:00 +01:00
Nathan Froyd
01583602a9 Bug 1207245 - part 6 - rename nsRefPtr<T> to RefPtr<T>; r=ehsan; a=Tomcat
The bulk of this commit was generated with a script, executed at the top
level of a typical source code checkout.  The only non-machine-generated
part was modifying MFBT's moz.build to reflect the new naming.

CLOSED TREE makes big refactorings like this a piece of cake.

 # The main substitution.
find . -name '*.cpp' -o -name '*.cc' -o -name '*.h' -o -name '*.mm' -o -name '*.idl'| \
    xargs perl -p -i -e '
 s/nsRefPtr\.h/RefPtr\.h/g; # handle includes
 s/nsRefPtr ?</RefPtr</g;   # handle declarations and variables
'

 # Handle a special friend declaration in gfx/layers/AtomicRefCountedWithFinalize.h.
perl -p -i -e 's/::nsRefPtr;/::RefPtr;/' gfx/layers/AtomicRefCountedWithFinalize.h

 # Handle nsRefPtr.h itself, a couple places that define constructors
 # from nsRefPtr, and code generators specially.  We do this here, rather
 # than indiscriminantly s/nsRefPtr/RefPtr/, because that would rename
 # things like nsRefPtrHashtable.
perl -p -i -e 's/nsRefPtr/RefPtr/g' \
     mfbt/nsRefPtr.h \
     xpcom/glue/nsCOMPtr.h \
     xpcom/base/OwningNonNull.h \
     ipc/ipdl/ipdl/lower.py \
     ipc/ipdl/ipdl/builtin.py \
     dom/bindings/Codegen.py \
     python/lldbutils/lldbutils/utils.py

 # In our indiscriminate substitution above, we renamed
 # nsRefPtrGetterAddRefs, the class behind getter_AddRefs.  Fix that up.
find . -name '*.cpp' -o -name '*.h' -o -name '*.idl' | \
    xargs perl -p -i -e 's/nsRefPtrGetterAddRefs/RefPtrGetterAddRefs/g'

if [ -d .git ]; then
    git mv mfbt/nsRefPtr.h mfbt/RefPtr.h
else
    hg mv mfbt/nsRefPtr.h mfbt/RefPtr.h
fi

--HG--
rename : mfbt/nsRefPtr.h => mfbt/RefPtr.h
2015-10-18 01:24:48 -04:00
Andrew McCreight
9e8f4b219e Bug 1152551, part 2 - Fix mode lines in dom/. r=jst 2015-05-03 15:32:37 -04:00
Nathan Froyd
4c7234747e Bug 1143651 - don't use CallQueryInterface when the compiler can do the cast for us; r=ehsan 2015-03-12 13:20:29 -04:00
Mike Hommey
b077d9624d Bug 1134920 - Use moz_xmalloc/moz_xrealloc/free instead of nsMemory::Alloc/Realloc/Free. r=nfroyd 2015-04-01 13:51:45 +09:00
Xidorn Quan
2e4cc674a2 Bug 1130891 part 2 - Add option in document encoder for including ruby annotation in plain text. r=roc
--HG--
extra : source : 236d9b1182fd33574db4d8901b4b0abeb6f3f150
2015-03-10 17:11:55 +11:00
Ehsan Akhgari
08c9b036ed Bug 1125963 - Part 2: Rename mPreFormatted to mPreFormattedMail in order to clarify the meaning of this member
This member is set to true when Gecko detects the DOM structure
created by the Thunderbird mail code.
2015-03-04 00:54:40 -05:00
Ehsan Akhgari
3cf3794589 Bug 1125963 - Part 1: Fix serialization of the pre-wrap elements that Thunderbird relies on; r=bzbarsky
This ensures that the plaintext serializer doesn't use the preformatted
text code path if we have encountered a pre-wrap element that
Thunderbird uses (which means setting white-space: pre-wrap and width:
NNch on the body element.)

It also ensures that we use 0 as the wrap column number passed down to
the plaintext serializer, instead of -1, which this code seems to be
unable to handle properly.
2015-03-04 00:50:17 -05:00
Andrea Marchesini
ef86fe9f3e Bug 1134280 - Get rid of Tag() - patch 3 - nsContentUtils::IsHTMLBlock should work with nsIContent inste nsIAtom, r=smaug 2015-03-03 11:09:00 +00:00
Andrea Marchesini
77d676cf4b Bug 1134280 - Get rid of Tag() - patch 2.3 - dom/base and docshell - Fix all the occurrences, m=smaug, r=surkov 2015-03-03 11:09:00 +00:00
Andrea Marchesini
2c4f63331f Bug 1134280 - Get rid of Tag() - patch 1 - Is{HTML,XUL,MathML,SVG}Element and IsAnyOf{HTML,XUL,MathML,SVG}Elements, r=smaug 2015-03-03 11:08:59 +00:00
Ehsan Akhgari
8662c25478 Bug 1119503 - Part 2: Insert a line break between preformatted block boundaries when creating raw output; r=bzbarsky 2015-01-28 09:58:35 -05:00
Ehsan Akhgari
d42ea91901 Bug 1119503 - Part 1: Determine whether an element is a block element based on the style, not the tag; r=bzbarsky
This probably fixes a whole bunch of edge cases where content uses
elements other than div.
2015-01-28 09:58:34 -05:00
Wes Kocher
a092ea34c3 Backed out 5 changesets (bug 1119503) for PGO m-oth failures so I can a=merge today
Backed out changeset 05ee3ae06643 (bug 1119503)
Backed out changeset 5ccef8ecf319 (bug 1119503)
Backed out changeset 8c2129ff8897 (bug 1119503)
Backed out changeset ff9012ee428a (bug 1119503)
Backed out changeset af9f4a6a7b78 (bug 1119503)
2015-01-27 16:04:59 -08:00
Ehsan Akhgari
7262a9f23c Bug 1119503 - Part 2: Insert a line break between preformatted block boundaries when creating raw output; r=bzbarsky 2015-01-27 13:25:08 -05:00
Ehsan Akhgari
4f31d37801 Bug 1119503 - Part 1: Determine whether an element is a block element based on the style, not the tag; r=bzbarsky
This probably fixes a whole bunch of edge cases where content uses
elements other than div.
2015-01-27 13:25:06 -05:00
Ehsan Akhgari
aaa0af1db9 Bug 1123062 - Fall back to looking at the tag for determining if an element is preformatted when there is no style information available; r=bzbarsky 2015-01-24 15:02:07 -05:00
Olli Pettay
2f7cd0debc Bug 1121473, define the list of void tags only in one place, r=hsivonen 2015-01-19 13:17:22 +02:00
Ehsan Akhgari
cd67e85c8d Bug 1113238 - Part 1: Make our plaintext and HTML serializers aware of CSS preformatted styles; r=bzbarsky
This code is super-hairy, but I think this is the minimum amount of changes
that we need.

nsPlainTextSerializer::IsInPre() before this patch is completely broken, and
I changed it to maintain a stack of bools representing whether the elements
that we saw as we were traversing the tree are preformatted or not.

nsXHTMLContentSerializer maintains this information using a counter, which is
broken in case pre and non-preformatted elements are stacked underneath each
other, but I'm not sure why this code is using a counter and I didn't want to
change it drastically, so for now I'm just making it look at the element's
style first as opposed to its tag name.

Follow-up work may include exploring whether nsXHTMLContentSerializer should
use a stack similar to nsPlainTextSerializer, and also audit this code for
more places where things are hardcoded based on tag names where we should be
really looking at the style.
2015-01-16 15:56:40 -05:00
Ryan VanderMeulen
b606c36f31 Backed out 4 changesets (bug 1113238) for mochitest-dt failures.
Backed out changeset 8439a009837d (bug 1113238)
Backed out changeset 34b89a4f9dea (bug 1113238)
Backed out changeset ce0ed9dc4d6d (bug 1113238)
Backed out changeset 9dd632bab2aa (bug 1113238)

CLOSED TREE
2015-01-13 13:50:12 -05:00
Ehsan Akhgari
28346b9dfe Bug 1113238 follow-up: Fix a non-unified build bustage on a CLOSED TREE 2015-01-13 12:19:19 -05:00