If you think a bug might affect users in the 57 release, please set the correct tracking and status flags for Release Management.

attribute SELECTED is changed while saving to SELECTED=""

VERIFIED DUPLICATE of bug 88761

Status

()

Core
Serializers
VERIFIED DUPLICATE of bug 88761
16 years ago
16 years ago

People

(Reporter: Adam Hauner, Assigned: Tanu Mutreja)

Tracking

({testcase})

Trunk
x86
All
testcase
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(2 attachments, 1 obsolete attachment)

(Reporter)

Description

16 years ago
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.
(Reporter)

Comment 1

16 years ago
Created attachment 79965 [details]
testcase
(Reporter)

Updated

16 years ago
Keywords: testcase

Comment 2

16 years ago
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.
(Reporter)

Comment 3

16 years ago
Created attachment 80028 [details]
Updated testcase 

Added DOCTYPE.
Attachment #79965 - Attachment is obsolete: true
(Reporter)

Comment 4

16 years ago
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
(Assignee)

Comment 6

16 years ago
-->Myself.
Assignee: harishd → t_mutreja
(Assignee)

Comment 7

16 years ago
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
(Assignee)

Comment 8

16 years ago
Created attachment 85901 [details]
Modified Method For Fixing This Bug...
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
Last Resolved: 16 years ago
Resolution: --- → DUPLICATE

Comment 10

16 years ago
verified.
Status: RESOLVED → VERIFIED
You need to log in before you can comment on or make changes to this bug.