Closed Bug 138444 Opened 22 years ago Closed 22 years ago

attribute SELECTED is changed while saving to SELECTED=""

Categories

(Core :: DOM: Serializers, defect)

x86
All
defect
Not set
normal

Tracking

()

VERIFIED DUPLICATE of bug 88761

People

(Reporter: aha, Assigned: t_mutreja)

Details

(Keywords: testcase)

Attachments

(2 files, 1 obsolete file)

2002041711/RC1/Win2K

Repro: 
1. open testcase
2. save page as 'Web Page, complete'

Actual:
OPTION attribute SELECTED is changed while saving to SELECTED="".

Expect:
Not change attribute, because it's incorrect for HTML4.01.
Attached file testcase (obsolete) —
Keywords: testcase
Looking for an explanation between the difference between "save as web page HTML
only" an and "save as web page complete", but the jist of it is that when saving
the complete page the parsed document is saved along with changes that are
needed for local viewing. This IS NOT the document byte for byte that was sent
to the browser to begin with.

Potentially WONTFIX.
Attached file Updated testcase
Added DOCTYPE.
Attachment #79965 - Attachment is obsolete: true
I haven't problem with 'browser is changing source-code', but with 'Mozilla
turns strictly correct HTML 4.01 code to something incorrect'. Saved page don't
validate as HTML 4.01, but original validate.
This is a document encoder issue.... we should change to SELECTED="SELECTED"

To DOM-to-text-conversion
Assignee: law → harishd
Status: UNCONFIRMED → NEW
Component: File Handling → DOM to Text Conversion
Ever confirmed: true
OS: Windows 2000 → All
QA Contact: sairuh → sujay
-->Myself.
Assignee: harishd → t_mutreja
In mozilla/content/base/src/nsHTMLContentSerializer.cpp, method(line# 314) 

void nsHTMLContentSerializer::SerializeAttributes(nsIContent* aContent,
                                                  nsIAtom*
aTagName,                        
                                                  nsAString& aStr)
adding the following at line#361, as an extra condition solves this problem: 


    if ((attrName.get() == nsHTMLAtoms::selected) && valueStr.IsEmpty()){
      valueStr = NS_LITERAL_STRING("selected");
    }

For more clarity, next I'm attaching a text file that contains the modified
method as a whole. I'd be thankful if someone can incorporate this change and
provide a proper patch with the diff.
Status: NEW → ASSIGNED
Hmm, I think this is a dupe, and peterv already has a fix.

*** This bug has been marked as a duplicate of 88761 ***
Status: ASSIGNED → RESOLVED
Closed: 22 years ago
Resolution: --- → DUPLICATE
verified.
Status: RESOLVED → VERIFIED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: