Closed Bug 1411687 Opened 7 years ago Closed 7 years ago

getplan.co: Hitting enter when creating tasks does not create multiple tasks

Categories

(Core :: DOM: Editor, defect, P3)

55 Branch
Unspecified
Windows 10
defect

Tracking

()

RESOLVED FIXED
mozilla58
Tracking Status
firefox-esr52 --- unaffected
firefox56 --- wontfix
firefox57 --- wontfix
firefox58 --- fixed

People

(Reporter: miketaylr, Assigned: masayuki)

References

(Depends on 1 open bug, )

Details

(Keywords: regression, Whiteboard: [webcompat])

Attachments

(5 files)

" Aryeh Gregor (:ayg) (no longer with Mozilla) <ayg@aryeh.name> is not currently accepting "needinfo" requests. "


masayuki-san, since you reviewed the patch, can you have a look? Is there a workaround we should be suggesting to sites that are broken due to this change?
Flags: needinfo?(masayuki)
Keywords: regression
Okay, looks like that the cause is, HTMLEditRules::WillInsertBreak() doesn't assume that custom element is an editing host:
https://searchfox.org/mozilla-central/rev/dd47bee6468de7e1221b4d006342ad6b9813d0e5/editor/libeditor/HTMLEditRules.cpp#1566,1574

Although, I have no idea how should we behave in this case...
Assignee: nobody → masayuki
Status: NEW → ASSIGNED
Flags: needinfo?(masayuki)
Comment on attachment 8922774 [details]
Bug 1411687 - part 0: Get rid of HTMLEditor::GetBlockNodeParent(nsIDOMNode*)

https://reviewboard.mozilla.org/r/193914/#review199418
Attachment #8922774 - Flags: review?(m_kato) → review+
Comment on attachment 8922775 [details]
Bug 1411687 - part 1: HTMLEditor::GetBlockNodeParent() and HTMLEditor::GetBlock() should take an ancestor limiter node optionally

https://reviewboard.mozilla.org/r/193916/#review199420
Attachment #8922775 - Flags: review?(m_kato) → review+
Comment on attachment 8922776 [details]
Bug 1411687 - part 2: Rewrite the check to insert a <br> element in HTMLEditRules::WillInsertBreak()

https://reviewboard.mozilla.org/r/193918/#review199422

::: editor/libeditor/HTMLEditRules.cpp:1599
(Diff revision 1)
>    }
> -  ParagraphSeparator separator = mHTMLEditor->GetDefaultParagraphSeparator();
> -  if (!IsBlockNode(*host) ||
> -      // The nodes that can contain p and div are the same.  If the editing
> -      // host is a <p> or similar, we have to just insert a newline.
> -      (!mHTMLEditor->CanContainTag(*host, *nsGkAtoms::p) &&
> +
> +  // Look for the nearest parent block.  However, don't return error even if
> +  // there is no block parent here because in such case, i.e., editing host
> +  // is an inline element, we should insert <br> simply.
> +  nsCOMPtr<Element> blockParent = HTMLEditor::GetBlock(node, host);

RefPtr<Element> if possible
Attachment #8922776 - Flags: review?(m_kato) → review+
Comment on attachment 8922777 [details]
Bug 1411687 - part 3: Add webplatform-test for testing "insertParagraph" command when user-defined element is the editing host

https://reviewboard.mozilla.org/r/193920/#review199424
Attachment #8922777 - Flags: review?(m_kato) → review+
Pushed by masayuki@d-toybox.com:
https://hg.mozilla.org/integration/autoland/rev/63a18c9ef302
part 0: Get rid of HTMLEditor::GetBlockNodeParent(nsIDOMNode*) r=m_kato
https://hg.mozilla.org/integration/autoland/rev/c8b86294e389
part 1: HTMLEditor::GetBlockNodeParent() and HTMLEditor::GetBlock() should take an ancestor limiter node optionally r=m_kato
https://hg.mozilla.org/integration/autoland/rev/eeec327a40fa
part 2: Rewrite the check to insert a <br> element in HTMLEditRules::WillInsertBreak() r=m_kato
https://hg.mozilla.org/integration/autoland/rev/777f76d30950
part 3: Add webplatform-test for testing "insertParagraph" command when user-defined element is the editing host r=m_kato
Real-world web compat issue, but there since Fx55. Any thoughts about whether this is something we should consider for uplift this late in the cycle vs. letting it ride the 58 train?
Flags: needinfo?(masayuki)
Flags: in-testsuite+
Version: 58 Branch → 55 Branch
As usual release cycle, this might be approved. However, 57's uplift rules are really strict. Similar request has already been not granted. So, I think that this cannot be fixed on 57.
Flags: needinfo?(masayuki)
Depends on: 1413625
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: