Bug 44918 - Cannot make lists quoted on gmail
Summary: Cannot make lists quoted on gmail
Status: NEW
Alias: None
Product: WebKit
Classification: Unclassified
Component: HTML Editing (show other bugs)
Version: 528+ (Nightly build)
Hardware: All All
: P2 Normal
Assignee: Nobody
URL:
Keywords: GoogleBug
Depends on: 19795
Blocks:
  Show dependency treegraph
 
Reported: 2010-08-30 18:19 PDT by Ryosuke Niwa
Modified: 2017-07-18 08:29 PDT (History)
6 users (show)

See Also:


Attachments
demo (298 bytes, text/html)
2010-09-08 00:05 PDT, Ryosuke Niwa
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Ryosuke Niwa 2010-08-30 18:19:03 PDT
Reproductions steps:
1. Goto gmail, and compose.
2. Type in nested lists
3. Quote the entire nested lists by clicking "(quote)

Expected results:
Lists are quoted

Actual results:
Spacing between lists are modified weirdly but lists are not quoted properly.
Comment 1 Julie Parent 2010-09-07 23:57:29 PDT
This is a bug in Gmail's text editor (TrogEdit), not WebKit.

If you look at the generated HTML, the blockquotes are there, they just do not have the classname on them for the special quoted style.

My guess is that it is an issue in the TrogEdit code that is trying to work around https://bugs.webkit.org/show_bug.cgi?id=19795.

Can you file a bug against TrogEdit instead?  http://code.google.com/p/closure-library/issues/
Comment 2 Ryosuke Niwa 2010-09-08 00:05:47 PDT
Created attachment 66852 [details]
demo
Comment 3 Ryosuke Niwa 2010-09-08 00:09:13 PDT
(In reply to comment #1)
> If you look at the generated HTML, the blockquotes are there, they just do not have the classname on them for the special quoted style.

Sure, blockquotes are there but they aren't at the places I'd expect it to be.  For example, if I called formatBlock on:
<ul><li>hello</li><li>world</li></ul>

I'd expect to get:
<blockquote><ul><li>hello</li><li>world</li></ul></blockquote>

but instead, I get:
<ul><li><blockquote>hello</blockquote></li><li><blockquote>world</blockquote></li></ul>

> My guess is that it is an issue in the TrogEdit code that is trying to work around https://bugs.webkit.org/show_bug.cgi?id=19795.
> 
> Can you file a bug against TrogEdit instead?  http://code.google.com/p/closure-library/issues/

It's possible that TrogEdit's doing something wrong as well but I think we should fix this bug in WebKit first.  It's quite unreasonable for me to ask TrogEdit and other editing tools to work-around this problem.  I'm surprised that this has never been a problem in Mail.
Comment 4 Julie Parent 2010-09-08 00:11:00 PDT
(In reply to comment #3)
> (In reply to comment #1)
> > If you look at the generated HTML, the blockquotes are there, they just do not have the classname on them for the special quoted style.
> 
> Sure, blockquotes are there but they aren't at the places I'd expect it to be.  For example, if I called formatBlock on:
> <ul><li>hello</li><li>world</li></ul>
> 
> I'd expect to get:
> <blockquote><ul><li>hello</li><li>world</li></ul></blockquote>
> 
> but instead, I get:
> <ul><li><blockquote>hello</blockquote></li><li><blockquote>world</blockquote></li></ul>

Right.  That behavior is the other bug I referenced, https://bugs.webkit.org/show_bug.cgi?id=19795.

> 
> > My guess is that it is an issue in the TrogEdit code that is trying to work around https://bugs.webkit.org/show_bug.cgi?id=19795.
> > 
> > Can you file a bug against TrogEdit instead?  http://code.google.com/p/closure-library/issues/
> 
> It's possible that TrogEdit's doing something wrong as well but I think we should fix this bug in WebKit first.  It's quite unreasonable for me to ask TrogEdit and other editing tools to work-around this problem.  I'm surprised that this has never been a problem in Mail.
Comment 5 Ryosuke Niwa 2010-12-07 10:28:10 PST
This almost works now.  The problem we have now is that we split lists when formatting by a block.  For example, if we had:
<ol>
<li>hello</li>
<li>world</li>
</ol>

and formatted the entire list, then we'll end up with
<blockquote>
<ol>
<li>hello</li>
</ol>
<ol>
<li>world</li>
</ol>
</blockquote>

Merging lists don't work because if we had:
<ol>
<li>hello<ol><li>abc</li><li>def</li></ol></li>
<li>world</li>
</ol>
then we also need to merge li.  But we can't always merge li's either.  It turns out that once we split nodes, it becomes ambiguous whether or not we should merge nodes.

So what we should do instead is NOT to split.  Instead of moving each paragraph separately, we need to move all them at once when the entire block is selected.