WebView replaceSelectionWithMarkupString: description is misleading
| Originator: | alexander.adolf | ||
| Number: | rdar://12197409 | Date Originated: | 2012-08-29 |
| Status: | Open | Resolved: | |
| Product: | Documentation | Product Version: | |
| Classification: | Other Bug | Reproducible: |
Summary:
The description of WebView's replaceSelectionWithMarkupString: method (see here: https://developer.apple.com/library/mac/documentation/Cocoa/Reference/WebKit/Classes/WebView_Class/Reference/Reference.html#//apple_ref/doc/uid/20001903-BABGAHDG) is not conclusive on the format of the string argument that the method expects. The linked MSDN documentation further adds to the confusion.
Steps to Reproduce:
n.a.
Expected Results:
The documentation should not link to outdated, confusing, external resources. Instead it should clearly state that the HTML fragment the user wishes to insert must be enclosed between
<html><body><!--StartFragment-->
and
<!--EndFragment --></body></html>
and must be self-contained and context-free (i.e. all opening and closing tags must be well balanced within the fragment).
Actual Results:
Reading the MSDN document, one might think that the whole "Version:0.9..." blah needs to be included. If one does include it, it gets inserted into the document, BTW.
Regression:
n.a.
Notes:
Why is the wrapping in <html>, <body>, and magic comments needed at all? Why not specify the markup string must be a self-contained, context-free HTML fragment. That's what I would have expected at least.
Removing the requirements for the wrapping, while maintaining the ability to remove it, would allow for a backwards compatible update of the method. And would make the semantics a lot clearer, IMHO.
Comments
Please note: Reports posted here will not necessarily be seen by Apple. All problems should be submitted at bugreport.apple.com before they are posted here. Please only post information for Radars that you have filed yourself, and please do not include Apple confidential information in your posts. Thank you!