Граф коммитов

470 Коммитов

Автор SHA1 Сообщение Дата
Aryeh Gregor f9deaf9072 Bug 700538 part 4 - Remove now-redundant nsHTMLEditor::IsNodeInActiveEditor; r=ehsan 2012-05-06 10:53:11 +03:00
Aryeh Gregor 00baa8ca2e Bug 700538 part 1 - Name some nsEditor methods more consistently; r=ehsan 2012-05-01 13:01:28 +03:00
Aryeh Gregor b7de2dce5b Bug 751547 - Unify action enums in editor/; r=ehsan 2012-05-05 21:52:29 +03:00
Ms2ger 16926821ff Bug 751323 - Cleanup nsHTMLEditRules::RemoveEmptyNodes(); r=ehsan 2012-05-05 11:00:06 +02:00
Ms2ger e3aad134ae Bug 749329 - Cleanup TypeInState; r=ehsan 2012-05-05 11:00:06 +02:00
Ms2ger e1087c279b Bug 750063 - Allow passing null to nsTextEditRules::CreateMozBR's outparam; r=ehsan 2012-05-05 11:00:05 +02:00
Aryeh Gregor bc4da0f5d0 Bug 748313 part 1 - Remove unused argument to nsHTMLEditor::IsTextPropertySetByContent; r=ehsan 2012-05-03 10:09:44 +03:00
Aryeh Gregor 116fb0ea91 Bug 748303 part 3 - Convert (Tag)CanContain(Tag) to nsIAtom*; r=ehsan 2012-05-01 09:34:52 +03:00
Aryeh Gregor 8a9e41f864 Bug 748303 part 1 - Clean up various nsHTMLEditRules methods; r=ehsan 2012-05-01 09:34:52 +03:00
Aryeh Gregor d9de0b261d Bug 743819 - Only re-spellcheck new nodes on insertions, not everything; r=ehsan 2012-04-25 08:56:32 +03:00
Mike Conley 4488d2a79a Bug 746993 - Fix editor caret behaviour when pressing RETURN after a BR node. r=ehsan, a=tracking-firefox 2012-04-20 12:57:17 -04:00
Ms2ger 6f0823bf85 Bug 742884 - Part c: Cleanup nsHTMLEditRules::GetListState; r=ehsan 2012-04-14 15:08:26 +02:00
Ms2ger 5a121505c1 Backing out bf0a78471e5e:dc7022e2d807 for inexplicable windows crashes. 2012-04-14 17:52:34 +02:00
Ms2ger 49a4e967e0 Bug 742884 - Part c: Cleanup nsHTMLEditRules::GetListState; r=ehsan 2012-04-14 15:08:26 +02:00
Ms2ger 631d559863 Bug 738771 - Outparamdel nsEditor::GetDocument(); r=ehsan 2012-03-24 09:19:14 +01:00
Daniel Holbert b5e26d1834 Bug 458167 patch 6: s/it's/its/ in comments within editor. r=ehsan 2012-02-15 01:18:24 -08:00
Ms2ger caccff631a Bug 724270 - Part b: Use nsINode in GenerateCSSDeclarationsFromHTMLStyle / GetCSSEquivalentToHTMLInlineStyleSet and callers; r=ehsan 2012-02-10 11:04:47 +01:00
Ms2ger af253c7658 Bug 724269 - Add nsHTMLCSSUtils::IsCSSEditableProperty(nsIContent*); r=ehsan 2012-02-10 11:04:47 +01:00
Ms2ger c088e2f143 Bug 724264 - Consolidate code that checks whether an element has a non-_moz_dirty attribute; r=ehsan 2012-02-10 11:04:46 +01:00
Ms2ger c03cad943c Bug 724261 - Use nsINode in nsHTMLEditRules::RelativeChangeIndentationOfElementNode; r=ehsan 2012-02-10 11:04:46 +01:00
Ms2ger 2286afda86 Bug 723232 - nsHTMLEditRules::RelativeChangeIndentationOfElementNode removes divs with any one attribute; r=ehsan 2012-02-10 11:04:46 +01:00
Ms2ger cc7b4d5813 Bug 724260 - Add nsHTMLEditRules::IsInListItem(nsINode* aNode); r=ehsan 2012-02-10 11:04:46 +01:00
Ms2ger bf385b0569 Bug 724259 - Add nsHTMLEditor::IsNodeInActiveEditor(nsINode* aNode); r=ehsan 2012-02-10 11:04:46 +01:00
Ms2ger 816256030a Bug 721460 - Don't use GetIsCSSEnabled internally; r=ehsan 2012-02-01 11:54:22 +01:00
David Zbarsky 0e922b0c94 Bug 682611 - Part 3: Remove ns(I)RangeUtils; r=smaug 2012-01-28 16:42:14 +01:00
Ms2ger 60f6c34d94 Bug 718170 - Part b: Use nsINode in IsVisTextNode; r=ehsan 2012-01-25 08:50:05 +01:00
Ms2ger 9acebd55d1 Bug 718170 - Part a: Use nsINode in IsEmptyNodeImpl; r=ehsan 2012-01-25 08:50:05 +01:00
Ms2ger 447f5e2d30 Bug 716630 - Kill editor's warnings; r=ehsan 2012-01-11 09:22:16 +01:00
David Zbarsky 52afb07fb3 Bug 682611 - Part 2: Remove nsIRange; r=smaug 2012-01-10 15:19:54 +01:00
David Zbarsky d8b868d007 Bug 682611 - Part 1: Merge nsIDOMRange and nsIDOMNSRange; r=Ms2ger r=smaug 2012-01-10 15:19:54 +01:00
Ms2ger 939ebfccd6 Bug 709523 - Part g: Remove nsHTMLEditRules::{Will,Did}DeleteRange; r=ehsan a=edmorley 2011-12-11 21:03:49 +01:00
Fabien Cazenave 3986a2889c Bug 684187 - Use dom::Element instead of nsIDOMElement for nsEditor::mRootElement; r=ehsan 2011-12-03 22:50:15 +01:00
Ehsan Akhgari 1deb9f1504 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 ac54b41b01 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
Ehsan Akhgari e41321f5dc Bug 414178 - Do not allow to inject a list outside of the active editing host; r=roc 2011-09-13 11:39:40 -04:00
Fabien Cazenave 1ca191be2b Bug 570144 - After pressing Enter, editable DIVs in list items are duplicated; r=ehsan 2011-09-12 15:25:38 -04:00
Fabien Cazenave 8bead8d204 Bug 290026 - Outdent of List does not work properly; r=ehsan 2011-09-02 12:21:33 -04:00
Fabien Cazenave d14a08954f Bug 291780 - List outdent is not working properly; r=ehsan 2011-09-02 12:19:09 -04:00
Fabien Cazenave 23d76d95be Bug 677752 - [contentEditable] indent and justify* fail on editable nodes that have only one child; r=ehsan
Issue #1: indent/justify* can create non-valid fragments.
When applying a block-level formatting to a text node, Gecko creates a div or
blockquote block around the text node and sets the corresponding "align" or
"style" attribute. This patch checks that the active editing host can contain
such a block-level element.

Issue #2: indent/justify* can modify the active editing host.
On the first child of the editable element, the selection is extended outside of
the active editing host -- which causes a few issues for our test cases.
In this patch, this issue is "solved" by modifying
`nsHTMLEditRules::GetPromotedPoint' for block-level operations.


** About the tests **

Sorry for the long explanation but I prefer to be as sharp as possible when I
have to modify existing unit tests.

This patch raises 34 unit test "failures" which are improvements.
Two test files are concerned and have been modified accordingly:
  * test_htmleditor_keyevent_handling
  * test_richtext2.html

One test has been clarified (no real modification):
  * test_bug414526.html

Of course, a specific unit test has been added, see `test_bug677752.html'.


** editor/libeditor/html/tests/test_htmleditor_keyevent_handling.html **
Outdenting now works properly, which results in 4 `FAIL'.

  * 7372 ERROR TEST-UNEXPECTED-FAIL
      | non-tabbable HTML editor: Shift+Tab after Tab on UL
      - got "<ul><li id=\"target\">ul list item</li></ul>",
      expected "<ul><ul><li id=\"target\">ul list item</li></ul></ul>"

  * 7379 ERROR TEST-UNEXPECTED-FAIL
      | non-tabbable HTML editor: Shift+Tab on UL
      - got "ul list item",
      expected "<ul><li id=\"target\">ul list item</li></ul>"

  * 7415 ERROR TEST-UNEXPECTED-FAIL
      | non-tabbable HTML editor: Shift+Tab after Tab on OL -
      got "<ol><li id=\"target\">ol list item</li></ol>",
      expected "<ol><ol><li id=\"target\">ol list item</li></ol></ol>"

  * 7422 ERROR TEST-UNEXPECTED-FAIL
      | non-tabbable HTML editor: Shfit+Tab on OL
      - got "ol list item",
      expected "<ol><li id=\"target\">ol list item</li></ol>"


** editor/libeditor/html/tests/browserscope/test_richtext2.html **
The 15 tests that now pass result in 15 `FAIL' and 15 `UNEXPECTED_PASS'.
Here's an overview of what we had before the patch:

  * Section A - Apply Formatting Tests: +10 points
                    before patch: 21/31 (Selection:  9/31)
                     after patch: 28/31 (Selection: 12/31)

      FB:BQ_TEXT-1_SI    EXECUTION EXCEPTION
      FB:BQ_TEXT-1_SI    EXECUTION EXCEPTION
      FB:BQ_BR.BR-1_SM   EXECUTION EXCEPTION
      FB:BQ_BR.BR-1_SM   EXECUTION EXCEPTION
      IND_TEXT-1_SI      EXECUTION EXCEPTION
      IND_TEXT-1_SI      EXECUTION EXCEPTION
      JC_TEXT-1_SC       editing host is modified
      JF_TEXT-1_SC       editing host is modified
      JL_TEXT-1_SC       editing host is modified
      JR_TEXT-1_SC       editing host is modified

  * Section AC - Apply Formatting Tests, using styleWithCSS: +5 points
                    before patch:  7/18 (Selection:  5/18)
                     after patch: 12/18 (Selection:  5/18)

      IND_TEXT-1_SI      editing host is modified
      JC_TEXT-1_SC       editing host is modified
      JF_TEXT-1_SC       editing host is modified
      JL_TEXT-1_SC       editing host is modified
      JR_TEXT-1_SC       editing host is modified


** editor/libeditor/html/tests/test_bug414526.html **
This test has been clarified to get more explicit report messages -- the test
themselves haven't been changed. A `todo_is' test has been added.
This test is the one that shows that `IsNodeInActiveEditor' can't be modified,
and that limiting the range promotion for block-level operations is preferrable.
2011-08-23 15:10:14 -04:00
Fabien Cazenave 64ad15bc03 Bug 680279 - Splitting Gmail rich-text list with Enter misplaces the caret; r=ehsan
The patch for bug 674861 has introduced a regression.
When a list is splitted, a new paragraph should inserted before the new list.
2011-08-19 18:14:04 -04:00
Fabien Cazenave eea2ee0d9c Bug 674212 - Modifying text of a contenteditable DOM Node removes spellcheck underlinings; r=ehsan 2011-08-17 17:12:46 -04:00
Vidar Haarr 5be8851b93 Bug 232691 - Replace nsString emptyString; with EmptyString() in nsHTMLEditRules; r=ehsan 2011-08-13 14:59:48 +02:00
Ms2ger 9c02645e9c Bug 677340 - Return already_AddRefed instead of nsCOMPtr from various functions in editor/; r=ehsan 2011-08-11 15:29:59 +02:00
Fabien Cazenave 44ac1642a0 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
Fabien Cazenave 0befe25f5a 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
Michael Wu d0689ff033 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 c7e701acba 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
Fabien Cazenave 9c778459dc 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
Fabien Cazenave f2ed25782c 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
Ehsan Akhgari af5f0657e3 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