Bug 5385 - [DOMRange markupString] adds a lot of <span>-tags
Summary: [DOMRange markupString] adds a lot of <span>-tags
Status: RESOLVED CONFIGURATION CHANGED
Alias: None
Product: WebKit
Classification: Unclassified
Component: DOM (show other bugs)
Version: 420+
Hardware: Mac OS X 10.4
: P2 Normal
Assignee: Nobody
URL:
Keywords:
Depends on: 7413
Blocks:
  Show dependency treegraph
 
Reported: 2005-10-14 11:16 PDT by Stefan Gorling
Modified: 2022-12-04 06:14 PST (History)
8 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Stefan Gorling 2005-10-14 11:16:43 PDT
Hi,

When loading a simple xml-document into a WebFrame, extracting a DOMRange and prints out its 
markupString, the original xml has been padded with a lot of junk.

For example: <span class="Apple-style-span" ..> and other apple-span-tags rather than the original 
xml-structure.

Is this a bug or a feature?

(Reason I asked was that I was recommended this approach as a way of saving a file after manipulating 
the DOMstructure)

To reproduce:
Load xml-file into webview (I used http://www.catb.org/~esr/writings/cathedral-bazaar/
introduction.xml)
- Select the preface-node  (=>selectedItem)

(I added the following test-code to the DOMTreeViewer example, in DOMDatasource.m:119 and clicked 
around)

	DOMRange *myRange = [[[_webView mainFrame] DOMDocument] createRange];
	[myRange selectNode: selectedItem];
	NSLog( [myRange markupString]);
Comment 1 Joost de Valk (AlthA) 2006-02-13 16:05:06 PST
Reassigning to webkit-unassigned, to make sure more people see this.
Comment 2 Joost de Valk (AlthA) 2006-02-18 11:37:16 PST
Reporter, Stefan, could you tell us:
a. if you're still having this?
b. if so, could you tell us more accurately how to reproduce it?
Comment 3 Alexey Proskuryakov 2006-02-18 14:11:09 PST
I can reproduce this, and also with ToT. I do not know whether this is a bug or a feature, though.

Additionally, I can see that the ToT result is badly broken, tags are not opened and closed correctly:
<title/>Why You Should Care</title>
...
<surname/>Raymond</surname>
...etc.

Looks like we need a separate bug about the latter, but it should have easier steps to reproduce... CC'ing Anders and Eric, maybe they will have some ideas about this?
Comment 4 Eric Seidel (no email) 2006-02-21 14:34:38 PST
A separate bug to cover serialization troubles would be greatly apprecaited.  If it's a regression, please mark it a p1 and add the Regression keyword, thanks.
Comment 5 Joseph Holsten 2010-01-08 15:30:29 PST
Looks like this is confirmed, but not a bug. Looks like the serialization issues were closed in #7413, so this can be closed as well.
Comment 6 Lucas Forschler 2019-02-06 09:03:25 PST
Mass moving XML DOM bugs to the "DOM" Component.
Comment 7 Ahmad Saleem 2022-12-01 12:46:49 PST
@ap - do you know any tips on how to reproduce, the URL works:

http://www.catb.org/~esr/writings/cathedral-bazaar/introduction.xml

I am not sure about this piece:

I added the following test-code to the DOMTreeViewer example, in DOMDatasource.m:119 and clicked 
around)

	DOMRange *myRange = [[[_webView mainFrame] DOMDocument] createRange];
	[myRange selectNode: selectedItem];
	NSLog( [myRange markupString]);
Comment 8 Alexey Proskuryakov 2022-12-01 14:11:50 PST
DOMRange no longer has the markupString SPI. From some code inspection, I do not see WebKit ever adding Apple-style-span any more, although it does check for it in a few places.

Adding Ryosuke in case I'm overlooking something.
Comment 9 Stefan Gorling 2022-12-04 06:14:54 PST
Thank you for looking into this. I have not touched this project since 2005 so can't verify/reproduce so go ahead and close.