gecko-dev/layout
Masayuki Nakano b808917841 Bug 1449564 - part 1: Disable object resizer and inline table editor in default r=m_kato
Gecko supports resizers of <img> elements and <table>, <td>, <th> elements and
has UI to remove existing table row or column in default.  However, the other
browsers don't have such UI and web apps need to disable this feature with
calling both:
document.execCommand("enableObjectResizing", false, false);
document.execCommand("enableInlineTableEditing", false, false);
for avoiding conflicting with their own features to edit such elements.

Therefore, it doesn't make sense to keep enabling them in default only on
Gecko.  If web apps want to keep using these features, they should call:
document.execCommand("enableObjectResizing", false, true);
document.execCommand("enableInlineTableEditing", false, true);
at initializing the editor.

And also this patch fixes bugs of
document.queryCommandState("enableObjectResizing") and
document.queryCommandState("enableInlineTableEditing").  They always return
false even after calling document.execCommand(..., false, true) since
nsSetDocumentStateCommand::GetCommandStateParams() sets bool value as
STATE_ATTRIBUTE.  However, nsHTMLDocument::QueryCommandValue() which is the
caller referring STATE_ATTRIBUTE doesn't treat it as bool value.  And also
those commands are related to state of document.  Therefore, they should be
return as bool value of STATE_ALL instead.  Then,
nsHTMLDocument::QueryCommandState() returns the state as expected.  Note that
those commands are supported only by Gecko.  So, we don't need to worry about
the compatibility.

Finally, this patch rewrites 2 existing tests to check basic behavior of
resizers and appearance of resizers.

Note that this patch does not add new tests to test inline table editor
since it's difficult to test the behavior with current API.  Perhaps, we
should add an API to nsIHTMLEditor to retrieve each anonymous elements in
another bug since it requires to add wrapping API of SpecialPowers.

MozReview-Commit-ID: 1FhYo5vcV60

--HG--
rename : editor/libeditor/tests/test_objectResizing.html => editor/libeditor/tests/test_resizers_appearance.html
rename : editor/libeditor/tests/test_bug640321.html => editor/libeditor/tests/test_resizers_resizing_elements.html
extra : rebase_source : a707de5a64ef1f8ce974cdf1be093d1b4f61c7bc
2018-04-02 17:26:46 +09:00
..
base Bug 1449564 - part 1: Disable object resizer and inline table editor in default r=m_kato 2018-04-02 17:26:46 +09:00
build Bug 1484137 - Remove the XPCOM component registration for content iterator classes; r=qdot 2018-08-17 14:51:12 -04:00
doc Bug 1483090 - Rename StyleUserInterface to StyleUI. r=emilio 2018-08-14 08:37:37 +00:00
forms Bug 1397768 part 1: Make 'display: flex/grid' in a button take up all the available space. r=dholbert 2018-08-17 07:36:50 -07:00
generic Bug 1449564 - part 1: Disable object resizer and inline table editor in default r=m_kato 2018-04-02 17:26:46 +09:00
inspector Bug 1479450: Convert GetStringValue to use Servo. r=xidorn 2018-07-31 12:05:00 +02:00
ipc Bug 1483090 - Rename StyleUserInterface to StyleUI. r=emilio 2018-08-14 08:37:37 +00:00
mathml Bug 1483394: Remove unneeded #includes of nsContentUtils.h in /layout. r=TYLin 2018-08-15 07:04:43 +00:00
media
painting Bug 1483394: Remove unneeded #includes of nsContentUtils.h in /layout. r=TYLin 2018-08-15 07:04:43 +00:00
printing Bug 1482665 Part 5 - Remove nsDeviceContext::AppUnitsPerCSSInch() and replace it with mozilla::AppUnitsPerCSSInch(). r=dholbert 2018-08-13 14:29:30 -07:00
reftests Bug 1465616 - Add failing fixed-position async-zoom reftests. r=botond 2018-08-03 14:20:53 -04:00
style Merge inbound to mozilla-central. a=merge 2018-08-18 12:46:20 +03:00
svg Merge mozilla-central to mozilla-inbound on a CLOSED TREE 2018-08-16 01:22:36 +03:00
tables Bug 1482665 Part 2 - Remove nsPresContext::AppUnitsPerCSSPixel() and replace it with mozilla::AppUnitsPerCSSPixel(). r=dholbert 2018-08-13 14:29:28 -07:00
tools Bug 1482893 - Enable unstructured logging before calling adb in reftests, r=gbrown. 2018-08-18 10:47:12 -07:00
xul Merge mozilla-central to mozilla-inbound on a CLOSED TREE 2018-08-16 01:22:36 +03:00
moz.build