[Webkit-unassigned] [Bug 132269] Document.contentType implementation

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Tue Dec 9 07:39:15 PST 2014


https://bugs.webkit.org/show_bug.cgi?id=132269

--- Comment #35 from Darin Adler <darin at apple.com> ---
Comment on attachment 242800
  --> https://bugs.webkit.org/attachment.cgi?id=242800
Patch v7

View in context: https://bugs.webkit.org/attachment.cgi?id=242800&action=review

> Source/WebCore/dom/Document.cpp:1388
> +    if (!m_overriddenMIMEType.isEmpty())

I think maybe we want isNull here instead of isEmpty.

> Source/WebCore/dom/Document.cpp:1391
> +    if (DocumentLoader* documentLoader = this->loader())

No need for "this->" here.

> Source/WebCore/dom/Document.cpp:1395
> +    if (!mimeType.isEmpty())

I think maybe we want isNull here instead of isEmpty.

> Source/WebCore/loader/DocumentLoader.h:121
>          WEBCORE_EXPORT const String& responseMIMEType() const;
> +
> +        const String& mimeType() const;
>  #if PLATFORM(IOS)
>          // FIXME: This method seems to violate the encapsulation of this class.
>          WEBCORE_EXPORT void setResponseMIMEType(const String&);

Seems strange to put the new "mimeType" function between responseMIMEType and setResponseMIMEType, which were previously right next to each other. Can we find a better place for this?

Also, it’s confusing that we have a function named responseMIMEType and a second function named mimeType. Maybe we need a longer name for the new function.

> Source/WebCore/xml/DOMParser.cpp:42
> +    if (doc->contentType() != contentType)
> +        doc->overrideMIMEType(contentType);

Why is this conditional? What’s the downside to always calling overrideMIMEType unconditionally?

-- 
You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.webkit.org/pipermail/webkit-unassigned/attachments/20141209/53aa3912/attachment-0002.html>


More information about the webkit-unassigned mailing list