Commit Graph

94 Commits

Author SHA1 Message Date
Makoto Kato
6f543bc32b Bug 1358979 - nsPlainTextSerializer should be cycle collection. r=smaug
nsPlainTextSerializer holds Element, so it should use cycle collection class.

MozReview-Commit-ID: ELykrDQaCei
2017-04-24 19:17:17 +09:00
Makoto Kato
15c2c64faf Bug 1358979 - nsDocumentEncoder with RequiresReinitAfterOutput should reset some strong pointers. r=smaug
We should release strong pointers into nsDocumentEncoder with RequiresReinitAfterOutput option to avoid holding dom node.

Also, mStream and mUnicodeEncoder will release into EncodeToStream, so it is unnecessary to clear it.

MozReview-Commit-ID: Ll8jFmMj4Ps
2017-04-24 18:14:53 +09:00
Makoto Kato
0a23a58b46 Bug 1352882 - Part 1. Add releasing nsIDocument option to recycle nsIDocumentEncoder. r=smaug
Editor uses weak reference for nsIDocument.  But nsDocumentEncoder has strong reference of nsIDocument. So to recycle nsIDocumentEncoder, editor wants the option that nsIDocumentEncoder releases nsIDocument into nsDocumentEncoder after EncodeTo* is called.

MozReview-Commit-ID: K3E9XhgD8FY
2017-04-17 19:49:52 +09:00
Mats Palmgren
1efd2a1407 Bug 1341137 part 2 - Provide a way to add ranges to Selection objects that aren't associated with a shell/nsFrameSelection. r=smaug 2017-02-25 11:33:34 +01:00
Wes Kocher
bdadad6845 Backed out 3 changesets (bug 1341137) for wpt failures in addRange-00.html a=backout
Backed out changeset 343d11a33afe (bug 1341137)
Backed out changeset ac44e1e713e1 (bug 1341137)
Backed out changeset 6f32de880c77 (bug 1341137)

MozReview-Commit-ID: 26CQIfTXLRI
2017-02-24 16:28:17 -08:00
Mats Palmgren
9b1659cfc1 Bug 1341137 part 2 - Provide a way to add ranges to Selection objects that aren't associated with a shell/nsFrameSelection. r=smaug 2017-02-25 00:26:18 +01:00
L. David Baron
6eb5c8ff40 Bug 1320815 - DeCOMtaminate nsIFrame::IsSelectable by returning boolean instead of nsresult. r=xidorn
MozReview-Commit-ID: EBxBcEgIvp7
2016-11-28 15:31:29 -08:00
Jorg K
82d11230ae Bug 1263357 - When the caret is placed after visible line break, associate caret with frame on the next line instead. r=mats 2016-10-14 14:21:00 -04:00
Michael Layzell
5b51c96616 Bug 1297802 - Remove unused RefPtr<> and COMPtr<> types in dom/, r=baku
MozReview-Commit-ID: CLUJZdbN7sW
2016-08-29 11:40:02 -04:00
Masayuki Nakano
df276e50d4 Bug 1185307 part.2 Replace upcast from nsISelection to mozilla::dom::Selection with nsISelection::AsSelection() r=smaug
MozReview-Commit-ID: Gs3oiAgJFG9
2016-06-17 22:32:49 +09:00
Jorg K
d6dae8e151 Bug 1230163 - White-space copy issue: Add conditional compile also for SeaMonkey. r=ehsan 2016-02-09 06:47:00 +01:00
Birunthan Mohanathas
bfee0fb40c Bug 1235261 - Part 1: Rename nsAutoTArray to AutoTArray. r=froydnj 2016-02-02 17:36:30 +02:00
Phil Ringnalda
d871b9515f Back out 7 changesets (bug 1235261) for cpptest failures in TestTArray
CLOSED TREE

Backed out changeset d66c3f19a210 (bug 1235261)
Backed out changeset 467d945426bb (bug 1235261)
Backed out changeset 32b61df13142 (bug 1235261)
Backed out changeset c50bb8ed4196 (bug 1235261)
Backed out changeset 0ff0fa6fe81f (bug 1235261)
Backed out changeset df70e89669da (bug 1235261)
Backed out changeset 064969357fc9 (bug 1235261)
2016-01-31 10:10:57 -08:00
Birunthan Mohanathas
245cd6a02f Bug 1235261 - Part 1: Rename nsAutoTArray to AutoTArray. r=froydnj 2016-01-31 17:12:12 +02:00
Ting-Yu Lin
60711ad8f1 Bug 1227927 Part 3 - Use ranged-based for-loop to rewrite some simple loops in part 2. r=mats 2016-01-29 22:42:15 +08:00
Ting-Yu Lin
122e5b9aeb Bug 1227927 Part 2 - Remove nsIFrame::GetFirstPrincipalChild(). r=mats 2016-01-29 22:42:14 +08:00
Ehsan Akhgari
aa41cc5e4d Bug 1240372 - Don't OOM crash in nsDocumentEncoder::EncodeToStringWithMaxLength() when the string buffer allocation fails; r=bzbarsky 2016-01-20 17:55:47 -05:00
Jorg K
a86bc70f24 Bug 1214377 - Hack to solve Thunderbird's need to detect style pre-wrap. rs=ehsan on a CLOSED TREE 2015-11-26 09:21:00 +01:00
Carsten "Tomcat" Book
fa797984a8 Backed out changeset e925caf848fa (bug 1214377) for wrong reviewer in commit 2015-12-01 10:31:32 +01:00
Jorg K
cf1e20c7f2 Bug 1214377 - Hack to solve Thunderbird's need to detect style pre-wrap. r=roc 2015-11-26 09:21:00 +01:00
Birunthan Mohanathas
6129a0880a Bug 1217307 - Remove some unnecessary null checks in dom/base/. r=njn 2015-11-19 09:13:49 +02:00
Jorg K
63eaee5e59 Bug 1214377 - Hack to solve Thunderbird's need to detect style pre-wrap. r=roc a=me 2015-11-06 11:42:29 -08:00
Wes Kocher
06bf36a7bb Backed out changeset b3d28572da60 (bug 1214377) for breaking thunderbird builds a=backout 2015-11-06 11:30:00 -08:00
Jorg K
947adf9f4f Bug 1214377 - Hack to solve Thunderbird's need to detect style pre-wrap. r=roc 2015-10-13 13:21:00 +02:00
Nathan Froyd
4e6d8f6705 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
2015-10-18 01:24:48 -04:00
Ehsan Akhgari
51a1729c29 Bug 1143570 - Part 1: Use an nsBlockInFlowLineIterator to determine whether a BR frame is visible or not; r=roc 2015-06-09 15:58:55 -04:00
Andrew McCreight
92010d3e4c Bug 1152551, part 2 - Fix mode lines in dom/. r=jst 2015-05-03 15:32:37 -04:00
Ehsan Akhgari
de579779ae Bug 1151873 - Stop forcing text/plain-only content being copied to the clipboard when an ancestor of the selected node has significant whitespace; r=roc
When fixing bug 116083, I didn't understand the purpose of the original
code correctly.  Setting mIsTextWidget to true will force a text/plain
MIME type, and therefore disabling the copying of any HTML content.  I
don't know why this path in the code used to exist, but it is basically
the cause of this bug, so we should remove it.
2015-04-09 09:45:33 -04:00
Xidorn Quan
4570c138a4 Bug 1130891 part 2 - Add option in document encoder for including ruby annotation in plain text. r=roc 2015-03-10 17:11:55 +11:00
Andrea Marchesini
0ffd16daf3 Bug 1134280 - Get rid of Tag() - patch 4 - Get rid of nsDocumentEncoder::IsTag, r=smaug 2015-03-03 11:09:00 +00:00
Andrea Marchesini
ae571f51bb 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
6b10d5e43e 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
a199f8e68c Bug 1125956 - Hack around the broken assumptions of Thunderbird about the HTML copy encoder by disabling the plaintext encoding detection logic; r=roc 2015-03-02 16:06:09 -05:00
Ting-Yu Lin
0150330dad Bug 1136065 - Remove GetRangeCount() in Selection.h. r=ehsan
We replace GetRangeCount() with the identical function RangeCount() to
avoid any confusion.
2015-02-25 17:08:00 +01:00
Mats Palmgren
664a207be2 Bug 1123505 - part 1, Reset mStart/EndDepth before serializing each range. Use mStartDepth of the first range and mEndDepth of the last range for multi-range Selections. r=smaug 2015-02-02 22:34:17 +00:00
Mike Hommey
715db83e04 Bug 1126593 - Add a global fallible instance, so that using fallible works directly, everywhere. r=njn 2015-02-02 09:56:13 +09:00
Ehsan Akhgari
80ac1541ec Bug 611103 - Part 3: Handle the edge case where the br element appears immediately after another br; r=bzbarsky
The test for bug 1119503 examines this edge case.
2015-01-24 15:01:34 -05:00
Ehsan Akhgari
e893209d10 Bug 611103 - Part 2: Handle the edge case where the BR element is the only child of a block element; r=bzbarsky
The test for bug 1119503 examines this edge case.
2015-01-22 23:16:32 -05:00
Ehsan Akhgari
1742ac4ab1 Bug 611103 - Don't depend on the editor in nsDocumentEncoder; r=bzbarsky 2015-01-22 17:54:55 -05:00
Ryan VanderMeulen
a971c28b1b 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
01d6ecd6c8 Bug 1113238 - Part 3: Flush the styles before determining whether an element is preformatted; r=bzbarsky
This ensures that calls to nsComputedDOMStyle::GetStyleContextForElementNoFlush()
in the part 1 of this series give us the correct results.
2015-01-13 12:04:46 -05:00
Ehsan Akhgari
e0c81ab40a Bug 1113796 - Use the WhiteSpaceOrNewlineIsSignificant() helper method; r=roc 2014-12-20 10:27:25 -05:00
Ehsan Akhgari
e449126221 Bug 116083 - Correctly handle the whitespace in all preformatted elements; r=roc
Previously this code only handled the special case of a <body> element that
had an explicit style attribute, which doesn't really make sense.  Now we
do the right thing based on the computed white-space style.
2014-12-01 06:38:11 -05:00
Birunthan Mohanathas
e9068bbc4f Bug 946065 - Part 12: Move content/base/ to dom/ and flatten subdirectories. r=peterv 2014-10-25 20:25:22 +03:00