Bug 25316 - Outdenting a line inside a blockquote tag does nothing
Summary: Outdenting a line inside a blockquote tag does nothing
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: HTML Editing (show other bugs)
Version: 528+ (Nightly build)
Hardware: PC Windows XP
: P2 Normal
Assignee: Ryosuke Niwa
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-04-21 16:14 PDT by Marcos Almeida
Modified: 2009-07-21 15:27 PDT (History)
4 users (show)

See Also:


Attachments
fixes the bug (51.15 KB, patch)
2009-07-09 16:45 PDT, Ryosuke Niwa
eric: review-
Details | Formatted Diff | Diff
removes isIndentBlockquote as requested (54.58 KB, patch)
2009-07-10 19:06 PDT, Ryosuke Niwa
no flags Details | Formatted Diff | Diff
fixes the bug (54.65 KB, patch)
2009-07-12 16:46 PDT, Ryosuke Niwa
eric: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Marcos Almeida 2009-04-21 16:14:18 PDT
1) go to http://www.mozilla.org/editor/midasdemo/
2) check View HTML
3) enter "<blockquote>one<br>two</blockquote>"
4) uncheck View HTML
5) put the cursor at the beginning of "two"
6) press the outdent button
  --> nothing happens. the line should have been outdented (e.g. removed from inside the blockquote tags)
Comment 1 Ryosuke Niwa 2009-07-09 16:45:38 PDT
Created attachment 32540 [details]
fixes the bug
Comment 2 Ryosuke Niwa 2009-07-09 16:47:16 PDT
Comment on attachment 32540 [details]
fixes the bug

The patch is large only because I had to rebaseline a pixel test.  The actual change is very small (<10 lines).
Comment 3 Eric Seidel (no email) 2009-07-10 17:45:26 PDT
Ok, this was added in:
http://trac.webkit.org/changeset/17143

It seems that Justin/Levi were trying to add the ability for Mail.app to style blockquotes added by WebKit.  I think an unintentional side-effect of this change was that WebKit was changed to no longer to outdent non-webkit blockquotes.  So I guess we could call this bug a REGRESSION(17143) although it seems no one noticed until much later.
Comment 4 Eric Seidel (no email) 2009-07-10 17:54:04 PDT
Comment on attachment 32540 [details]
fixes the bug

I think we should remove this function:
6060 static bool isIndentBlockquote(const Node* node)

and just use tag-based detection of blockquotes like was the case pre-r17143

Why is:
LayoutTests/platform/mac/editing/execCommand/outdent-selection-expected.txt
changing?  Please explain in your ChagneLog.

Please remove boilerplate from your ChangeLogs:
         DETAILED DESCRIPTION OF THE CHANGES GOES HERE. (OOPS!) SEE:
 9         http://webkit.org/coding/contributing.html FOR MORE INFORMATION

You soudl explain all your added tests and changes to tests in your ChangeLogs.

Please explain this change:
     if (enclosingBlockFlow != enclosingNode)
275          splitBlockquoteNode = splitTreeToNode(enclosingBlockFlowElement(visibleStartOfParagraph), enclosingNode, true);
 271         splitBlockquoteNode = splitTreeToNode(enclosingBlockFlow, enclosingNode, true);
 272     else {
 273         splitElement(static_cast<Element*>(enclosingBlockFlow), visibleStartOfParagraph.deepEquivalent().node());
 274         splitBlockquoteNode = enclosingBlockFlow;
 275     }
in your ChangeLog.
Comment 5 Ryosuke Niwa 2009-07-10 19:06:30 PDT
Created attachment 32601 [details]
removes isIndentBlockquote as requested
Comment 6 Eric Seidel (no email) 2009-07-10 20:20:12 PDT
Comment on attachment 32601 [details]
removes isIndentBlockquote as requested

Why is it OK to remove the ! check here?
-                if (isIndentBlockquote(splitPointParent)
-                    && !isIndentBlockquote(splitPoint)
+                if (splitPointParent->hasTagName(blockquoteTag)

Style:
+    else
+        splitElement(static_cast<Element*>(enclosingNode), visibleStartOfParagraph.deepEquivalent().node());
+        // We split the blockquote at where we start outdenting.
comment would go before the splt, and the whole thing would be in { }

In general this looks fine.  You're a committer now, so you could just commit this with edits, but I'd liek to see your answer to the first question before I r+
Comment 7 Ryosuke Niwa 2009-07-12 16:46:52 PDT
Created attachment 32635 [details]
fixes the bug
Comment 8 Ryosuke Niwa 2009-07-12 16:47:37 PDT
(In reply to comment #6)
> (From update of attachment 32601 [details])
> Why is it OK to remove the ! check here?
> -                if (isIndentBlockquote(splitPointParent)
> -                    && !isIndentBlockquote(splitPoint)
> +                if (splitPointParent->hasTagName(blockquoteTag)

Good catch.  I didn't realize that I deleted a line.  Fixed.

> Style:
> +    else
> +        splitElement(static_cast<Element*>(enclosingNode),
> visibleStartOfParagraph.deepEquivalent().node());
> +        // We split the blockquote at where we start outdenting.
> comment would go before the splt, and the whole thing would be in { }

Fixed.
Comment 9 Eric Seidel (no email) 2009-07-12 17:37:59 PDT
Comment on attachment 32635 [details]
fixes the bug

Looks sane enough to me.
Comment 10 Ryosuke Niwa 2009-07-14 14:03:49 PDT
This patch doesn't have the rebaselined expected results for qt platform.  Please rebaseline it as needed.
Comment 11 Julie Parent 2009-07-14 18:03:16 PDT
Landed in http://trac.webkit.org/changeset/45886