Commit Graph

833 Commits

Author SHA1 Message Date
Ms2ger
9414376b01 Bug 677101, part b - Remove nsContentUtils.h includes from headers; r=volkmar 2011-08-11 15:29:50 +02:00
Fabien Cazenave
d46ef85530 Bug 442186 - execCommand justify* fails on first line of contenteditable; r=ehsan
Given the way GetPromotedPoint / IsNodeInActiveEditor are designed, when the
selection is in the first child element of the active editing host the
selection is extended outside of editor node.

As a result, `GetNodesFromSelection' (which is called at the beginning of
`WillAlign') returns two nodes:
1. an empty text node, which is enclosed in a <div style="text-align: ***">;
2. the first child element, which is destroyed when it's a <div>;

Proposed solution:
#1 can be avoided by checking that the node is editable in `WillAlign';
#2 can be avoided by not dropping <div> blocks in `RemoveAlignment'.
This is an opportunity to simplify `RemoveAlignment' a bit.
2011-08-10 19:03:34 -04:00
Ian Neal
081ca4e9b3 Test for Bug 291780 - List outdent is not working properly r=ehsan 2011-08-10 00:14:58 +01:00
Ian Neal
49689844b3 Test for Bug 290026 - Outdent of List does not work properly r=ehsan 2011-08-10 00:14:53 +01:00
Ehsan Akhgari
6690ac6ddf Merge the latest green changeset on mozilla-inbound to mozilla-central 2011-08-09 08:09:13 -04:00
Jan Varga
5020b003ce Bug 617528 Part 2 - Core implementation r=smaug
--HG--
rename : content/html/content/test/test_bug418756.html => content/html/content/test/test_checked.html
2011-08-08 19:31:32 +02:00
Michael Wu
ccaba60ed1 Bug 676465 - Replace PRBool with boolean in IDL files, r=bsmedberg 2011-08-06 22:03:32 -07:00
Marco Bonardo
b92ca56a08 Merge last green changeset from mozilla-inbound to mozilla-central 2011-08-03 10:46:22 +02:00
Kyle Huey
fc7ab154c4 Bug 675627: Fix unrecognized directive error in nsIURIRefObject.idl and make this error fatal in the future. r=bsmedberg 2011-08-01 14:26:13 -04:00
Henri Sivonen
0176915bb7 Bug 596182 - Make fragment parsers global. Remove resulting dead code. r=Olli.Pettay, r=bzbarsky. 2011-08-01 10:48:24 +03:00
Henri Sivonen
147c3287ec Bug 482909 part 2 - Implement an HTML/SVG/MathML sanitizer independently of parsers or serializers. r=bzbarsky. 2011-07-29 14:48:04 +03:00
Michael Wu
6a28121ce1 Bug 671417 - Incorrect use of PRBool when other types are more appropriate or vice versa, r=bz,ehsan,dwitte,joe,vlad,luke,mak,roc 2011-07-26 23:43:37 -07:00
Fabien Cazenave
5dd43c9b97 Bug 674861 - contentEditable lists should not be splittable; r=ehsan
In design mode, pressing [Return] twice in a list (ol, ul, dl) splits the list
and inserts a paragraph. When the list is the active editing host, it should not
be split.
2011-08-02 15:04:43 -04:00
Fabien Cazenave
0999dbd2e1 Bug 620319 - crash [@ nsHTMLEditor::GetInlinePropertyBase] if !aAttribute; r=ehsan
Adds a null check to avoid dereferencing a null pointer.

--HG--
extra : rebase_source : 75b97cafad2318af60956d88d12da51a00224949
2011-07-26 18:09:12 -04:00
Fabien Cazenave
bf28416694 Bug 620283 - crash [@ nsHTMLEditor::RemoveStyleInside] if !aAttribute; r=ehsan
Adds a null check to avoid dereferencing a null pointer.

--HG--
extra : rebase_source : ba8bfcabbc2f17b0b0cea1d90dbed54a8471bad9
2011-07-26 18:08:55 -04:00
Fabien Cazenave
9e280efb90 Bug 460740 - [contentEditable] invalid results when pressing Enter in a bunch of different cases; r=ehsan
In some situations, pressing Enter in a contentEditable node fails:
 * in an editable paragraph, list item or header, pressing Enter
   creates another editable block;
 * in an inline editable node, pressing Enter does nothing.

That's because nsHTMLEditRules::WillInsertBreak doesn't check for the active
editing host. This patch should fix it.
2011-07-26 17:38:23 -04:00
Jonathan Kamens
e4101fc489 Bug 489202 - selection moves to top when html containing meta, link, or style elements is pasted or inserted; r=ehsan 2011-07-26 13:59:50 -04:00
Michael Wu
706be3a5e8 Bug 671185 - Incorrect return of NS_ERROR_* codes in functions returning PRBool, r=mak,ehsan,taras,biesi,pike,khuey,dholbert,josh,bjacob,bsmith 2011-07-25 21:57:58 -07:00
Fabien Cazenave
2c92600954 Bug 688599 - do not expand selection for deletion outside of the active editing host; r=ehsan
When a selection in an inline element is to be deleted, it is first expanded to
the parent block in order not to leave any empty inline element. This patch
ensures that the selection cannot be expanded outside of the contentEditable
element (active editing host).
2011-07-25 17:11:46 -04:00
Ehsan Akhgari
cadef9ec48 Merge mozilla-central and mozilla-inbound 2011-07-24 12:52:51 -04:00
Joel Maher
344f4a7302 Bug 666654 - split eventutils.js functions that are chrome only into chromeutils.js. r=ted, a=test-only 2011-07-23 09:02:40 -04:00
Ms2ger
2a3176b2ee Bug 666665 - Remove isindex content code; r=sicking+hsivonen 2011-07-23 11:45:38 +02:00
Fabien Cazenave
81bff8a94d Bug 449243 - contentEditable: insert <p> instead of <br>; r=ehsan
In editable elements, create a paragraph instead of a <br> node
when [Return] is pressed:
 * once in a header node (<h[1..6]>);
 * twice in a list item node (<li>).
2011-07-22 12:19:17 -04:00
Joel Maher
c3a05191bb Bug 666649 - remove enablePrivilege from various places in the harness and chrome tests. r=ted, a=test-only 2011-07-21 16:21:25 -04:00
Mounir Lamouri
2e1dfaef9e Bug 669310 - Fixes various includes and forward declarations. f=Ms2ger r=jst 2011-07-20 12:18:54 -07:00
Ehsan Akhgari
ee5215c7a6 Revert to changeset e0ce7821fce1 because the latest push broke all of the builds DONTBUILD 2011-07-19 16:25:54 -04:00
Mounir Lamouri
5937d63965 Bug 669310 - Fixes various includes and forward declarations. f=Ms2ger r=jst 2011-07-19 11:22:43 -07:00
Mounir Lamouri
b088e154d6 Backed out bug 669310, bug 668013, bug 667887 and bug 669886 due to build bustage. 2011-07-19 10:49:48 -07:00
Mounir Lamouri
d2f5a3b4c3 Bug 669310 - Fixes various includes and forward declarations. f=Ms2ger r=jst 2011-07-18 17:05:10 -07:00
arno renevier
ba6b969048 Bug 417418 - do not treat context click as double click anymore in editor; r=ehsan 2011-07-18 14:42:56 -04:00
Ehsan Akhgari
13c7a908e4 Backout changeset 65e0d40a57b7 (bug 417418) because of unit test failure 2011-07-18 16:29:22 -04:00
arno renevier
89a10e6166 Bug 417418 - do not treat context click as double click anymore in editor; r=ehsan 2011-07-18 14:42:56 -04:00
Ehsan Akhgari
a6b5feed16 Bug 671672 - Reduce a bunch of console spam in debug builds caused by the HTML editor; r=roc 2011-07-14 17:06:37 -04:00
Ehsan Akhgari
7a8be63dc3 Bug 434998 - Enable the usage of the execCommand API for <xul:editor> elements; r=roc 2011-07-15 08:17:56 -04:00
Ehsan Akhgari
4a9dec68d7 Bug 414526 - Backspace at the beginning of a contenteditable element or delete at the end of one should not affect the rest of the contenteditable elements on the page; r=roc
The main fix here involves the introduction of the nsHTMLEditor::IsNodeInActiveEditor
API.  This API returns true if the current selection in the document falls
inside the active editable section.  The patch adds a bunch of checks using
this API to various places in the code to make sure that editing operations do
not escape their editing host.

There are also some unrelated fixes to range promotion code which fix the
bugs that have existed in that code before, but because of the lack of this
check were not uncovered before.

This patch also removes the nsTextEditUtils::InBody API which only made sense
in designMode documents, and was insufficient for contenteditable elements.
2011-07-14 11:25:07 -04:00
Ms2ger
36c532ffa2 Bug 670235 - Remove nsIDOMWindowInternal; r=sicking 2011-07-15 12:31:34 +02:00
Ms2ger
7a41ef9f3e Bug 670499 - Make nsEditor::CreateEventListeners return void; r=ehsan 2011-07-15 12:18:35 +02:00
Simon Montagu
ae37ce037d Undefine caret bidi level during reflow instead of on text entry. Bug 664087, r=roc 2011-07-05 08:42:32 +03:00
Jonas Sicking
5491caaaf4 Bug 661297 Part 1: Remove Add/RemoveEventListenerByIID API. r=smaug 2011-08-08 11:26:26 -07:00
Ehsan Akhgari
c6e514aa14 Bug 549262 - Enable the (shift-)space shortcut key for scrolling up/down in pages containing editable elements; r=roc
--HG--
extra : rebase_source : 99706dd2e678052b345b011ea76f17370ad1a227
2010-09-06 16:59:41 -04:00
Ehsan Akhgari
beba2dbb1d Bug 439808 - Make sure that deleting a selection works in inline contenteditable elements which have a non-editable parent block; r=roc
--HG--
extra : rebase_source : 74d3df996b904032696000daa532d217140d3b2d
2011-06-29 21:01:59 -04:00
Jonas Sicking
cc14f402b6 Bug 663461 Part 1: Remove Add/RemoveEventListenerByIID from editor. r=smaug 2011-06-27 16:34:54 -07:00
Wolfgang Germund
db7ef51c94 Bug 664095 - Remove the override stylesheets when the editor is detached from the document as opposed to when it's destroyed for compatibility with the expected behavior from Composer; r=ehsan 2011-06-24 13:55:43 -04:00
Jonas Sicking
5e5e6bd544 Bug 658714 Part 10: Remove nsIDOM3EventTarget/nsIDOMEventGroup. r=smaug 2011-06-23 19:18:02 -07:00
Jonas Sicking
864793d608 Bug 658714 Part 9: Don't use EventGroups for system-group. r=smaug 2011-06-23 19:18:02 -07:00
Jonas Sicking
26f99e3cdb Bug 658714 Part 7: DeCOMtaminate nsEventListenerManager. r=smaug 2011-06-23 19:18:01 -07:00
Jonas Sicking
6a04ff1d9f Bug 658714 Part 6: Fixups after search'n'replace s/nsPIDOMEventTarget/nsIDOMEventTarget/. r=smaug 2011-06-23 19:18:01 -07:00
Jonas Sicking
e3f6b769a1 Bug 658714 Part 5: Search'n'replace nsPIDOMEventTarget to nsIDOMEventTarget. r=smaug 2011-06-23 19:18:00 -07:00
Jonas Sicking
8fed9108b1 Bug 658714 Part 1: Merge nsPIDOMEventTarget into nsIDOMEventTarget. r=smaug,bent 2011-06-23 19:17:58 -07:00
Ehsan Akhgari
38dc29243c Merge the last green changeset on mozilla-inbound to mozilla-central 2011-06-20 16:06:04 -04:00