Before I will fix some justify* command's bug, I would like to clean up HTMLEditRules::RemoveAlignment to get rid of nsIDOM* into this method.
MozReview-Commit-ID: 4UATycS5iBl
--HG--
extra : rebase_source : 7079a774b4b8359aeffbdbdf2efe0b45bd92c173
This patch is generated by the following sed script:
find . ! -wholename '*/.hg*' -type f \( -iname '*.html' -o -iname '*.xhtml' -o -iname '*.xul' -o -iname '*.js' \) -exec sed -i -e 's/\(\(text\|application\)\/javascript\);version=1.[0-9]/\1/g' {} \;
MozReview-Commit-ID: AzhtdwJwVNg
--HG--
extra : rebase_source : e8f90249454c0779d926f87777f457352961748d
When selected nodes are <span style="font-weight: normal;">A</span>, toggle bold inserts new span element into parent node like <span style="font-weight: bold;"><span style="font-weight: normal;">A</span><span>. So bold isn't applied correctly.
IsCSSEquivalentToHTMLInlineStyleSet might return false even if style is applied. Because it returns true that style isn't default value. Since "font-weight: normal" is default property, it isn't removed.
So when style is already applied even if it is default value, we should remove it.
MozReview-Commit-ID: LgImkHRp9Ff
--HG--
extra : rebase_source : dd4d894495754a81abaf5a2aede1132056920beb
extra : histedit_source : 72d196cd9f90296eb00b97c1538704c714cc871c
Editor may need to create some new transaction during handling a mousedown event. Therefore, editor needs to finish pending composition transaction. So, mousedown event handler should commit composition first.
MozReview-Commit-ID: 2BaoYwB7wLS
--HG--
extra : rebase_source : 1babc2fd37ff08a1316a62943adc2a7a36d8ca53
RemoveEmptyNodes doesn't check whether parent node is null. So we shouldn't add null to skip list.
Also, although this crash depends on clang, if debug build, it will hit the assertion on all compiler.
MozReview-Commit-ID: GgiczVExlIn
--HG--
extra : rebase_source : 5ec0119a80d86dfeac5e970cdf540997cca24c34
Additionally, this patch removes unnecessary name space wrapper of IsCtrlShiftPressed(). Perhaps, it was necessary when mozilla::EditorEventListener was nsEditorEventListener.
MozReview-Commit-ID: EHzt7aRtYgQ
--HG--
extra : rebase_source : d38d73226de8f5563ad66de10f8f8ed701d766a1
Currently, we use alias NS_VK_* for WidgetKeyboardEvent::mKeyCode. Similarly, we should create alias enum for nsIDOMKeyEvent::DOM_KEY_LOCATION_*. Then, we can reduce the length and avoid to include nsIDOMKeyEvent in some cpp files.
MozReview-Commit-ID: 5cs4zQ061Lc
--HG--
extra : rebase_source : e6a6edd27718b9e3d4a40b07902d029791876999
HTMLEditRules can access both mTextEditor and mHTMLEditor, but we should use mHTMLEditor only on HTMLEditRules for readability.
MozReview-Commit-ID: HfzwAD554XQ
--HG--
extra : rebase_source : 7d722915a41eb878e2cd2ff711ac4925bd91d1d8
Items in mActionListeners may be removed during a call of a method of another item. Therefore, all items should be copied to different array before each loop referring mActionListeners.
MozReview-Commit-ID: FA2xXdJ9SoR
--HG--
extra : rebase_source : 054a58f5a82df6911d42b17fdb3f11738ceab2af
GetIsDocumentEditable is implemnted in EditorBase, TextEditor, and HTMLEditor. This is virtual method, we won't use EditorBase::GetIsDocumentEditable. Also, TextEditor::GetIsDocumentEditable and HTMLEditor::GetIsDocumentEditable are same implementation. So we should merge this to EditorBase.
MozReview-Commit-ID: 62euqUaYAuY
--HG--
extra : rebase_source : 1a3025aeddc61d0ae3e0de334472ee8393893114
So, EditorEventListener should grab mEditorBase in smaller scope as far as possible. And each event listener method shouldn't access mEditorBase directly at calling its method since it might be changed to another instance.
MozReview-Commit-ID: IUCl5gbh4ut
--HG--
extra : rebase_source : 217d881923193a25db0649fc1f1a87bd43fa4d99
EditorEventListener doesn't check if mEditorBase is available even after it's removed from the editor. If it becomes nullptr, i.e., it's detached from editor, it shouldn't continue to handle event.
This patch changes some methods' nsIDOM*Event argument to WidgetEvent since it's simpler.
MozReview-Commit-ID: CI3U4pfVxtb
--HG--
extra : rebase_source : 7135c4615f6a1dd8bb4b6698261c75a9f8c70930