Closed Bug 731172 Opened 12 years ago Closed 11 years ago

"View Selection Source" generates extra code

Categories

(Toolkit :: View Source, defect)

11 Branch
defect
Not set
normal

Tracking

()

RESOLVED WORKSFORME

People

(Reporter: pauly, Unassigned)

References

()

Details

Attachments

(2 files)

STR:
1. Open in Firefox the test case from bug 713810: https://bugzilla.mozilla.org/attachment.cgi?id=584543
2. "Select All" and then "View Selection Source"

Actual results:
Extra code in one div:
<div style="height: 2em; background: none repeat scroll 0% 0% gold;"></div>

Expected results:
<div style="height:2em;background:gold"></div>
"Given a valid declaration, the 'background' property first sets all the individual background properties to their initial values, then assigns explicit values given in the declaration."

As View Selected Source generates the source from DOM (including things added through javascript), I would say that what you get is expected. But I'll leave that for someone else to decide.
Here is another example of the problem.  Effectively, View Source and View Selection Source do not show the same HTML.  

The following attachments are based on my Web page at <http://www.rossde.com/internet/ASCII_mail.html>.  

I encountered this when I needed the source HTML from a small fragment of one of my Web pages.  I selected about three lines from the rendered page and then requested View Selection Source.  What I saw disturbed me because I wondered "When did I create such tag soup?"  It turned out that the tag soup was generated by View Selection Source and not by me; my actual HTML page did not contain any of that mess.
This shows inserted HTML tags -- especially </p> and </li> -- that are optional and quite unnecessary.
This is the same as my original HTML file.
Attachment #709519 - Attachment mime type: text/plain → text/html
Attachment #709518 - Attachment mime type: text/plain → text/html
So View Selection Source is not even trying to view the selection source. It's viewing a serialization of the selection. Inserted </p>, </li>, etc. are as-designed. (I.e. not a bug.)

Whether serializing the style attribute from CSSOM instead of the DOM is a bug I'm not quite sure of.
In looks like the case from comment 0 has been fixed.
Status: NEW → RESOLVED
Closed: 11 years ago
Resolution: --- → WORKSFORME
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: