WebKit Bugzilla
New
Browse
Search+
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
Working Progress Patch
working_progress.txt (text/plain), 7.10 KB, created by
Kaustubh Atrawalkar
on 2011-11-14 04:11:53 PST
(
hide
)
Description:
Working Progress Patch
Filename:
MIME Type:
Creator:
Kaustubh Atrawalkar
Created:
2011-11-14 04:11:53 PST
Size:
7.10 KB
patch
obsolete
>Index: Source/WebCore/html/DOMURL.idl >=================================================================== >--- Source/WebCore/html/DOMURL.idl (revision 100099) >+++ Source/WebCore/html/DOMURL.idl (working copy) >@@ -31,6 +32,26 @@ > GenerateToJS, > NoStaticTables > ] DOMURL { >+ attribute DOMString protocol; >+ attribute DOMString username; >+ attribute DOMString password; >+ attribute DOMString host; >+ attribute DOMString hostname; >+ attribute DOMString port; >+ attribute DOMString pathname; >+ attribute DOMString search; >+ attribute DOMString hash; >+ >+ attribute DOMString filename; >+ >+ readonly attribute DOMString origin; >+ >+ DOMString getParameter(DOMString name); >+ void appendParameter(DOMString name, DOMString values); >+ void clearParameter(DOMString name); >+ >+ stringifier attribute DOMString href; >+ > #if defined(ENABLE_MEDIA_STREAM) && ENABLE_MEDIA_STREAM > [ConvertNullStringTo=Undefined] DOMString createObjectURL(in MediaStream stream); > #endif >Index: Source/WebCore/html/DOMURL.cpp >=================================================================== >--- Source/WebCore/html/DOMURL.cpp (revision 100099) >+++ Source/WebCore/html/DOMURL.cpp (working copy) >@@ -31,8 +32,10 @@ > > #include "Blob.h" > #include "BlobURL.h" >+#include "Document.h" > #include "KURL.h" > #include "ScriptExecutionContext.h" >+#include "SecurityOrigin.h" > #include "ThreadableBlobRegistry.h" > #include <wtf/MainThread.h> > >@@ -43,6 +46,12 @@ > > namespace WebCore { > >+DOMURL::DOMURL(String& url, String& baseURL) >+ : m_href(KURL(ParsedURLString, url)) >+{ >+ // If baseURL is provided need to resolve the url realtive to baseURL >+} >+ > DOMURL::DOMURL(ScriptExecutionContext* scriptExecutionContext) > : ContextDestructionObserver(scriptExecutionContext) > { >@@ -125,6 +134,195 @@ > #endif > } > >+KURL DOMURL::href() const >+{ >+ return m_href; >+} >+ >+void DOMURL::setHref(const String& value) >+{ >+ m_href = KURL(KURL(), value); >+} >+ >+String DOMURL::protocol() const >+{ >+ return href().protocol() + ":"; >+} >+ >+void DOMURL::setProtocol(const String& value) >+{ >+ KURL url = href(); >+ url.setProtocol(value); >+ setHref(url.string()); >+} >+ >+String DOMURL::username() const >+{ >+ return ""; >+} >+ >+void DOMURL::setUsername(const String& value) >+{ >+ KURL url = href(); >+ url.setUser(value); >+ setHref(url.string()); >+} >+ >+String DOMURL::password() const >+{ >+ return ""; >+} >+ >+void DOMURL::setPassword(const String& value) >+{ >+ KURL url = href(); >+ url.setPass(value); >+ setHref(url.string()); >+} >+ >+String DOMURL::host() const >+{ >+ const KURL& url = href(); >+ if (url.hostEnd() == url.pathStart()) >+ return url.host(); >+ if (isDefaultPortForProtocol(url.port(), url.protocol())) >+ return url.host(); >+ return url.host() + ":" + String::number(url.port()); >+} >+ >+void DOMURL::setHost(const String& value) >+{ >+ if (value.isEmpty()) >+ return; >+ >+ KURL url = href(); >+ if (!url.canSetHostOrPort()) >+ return; >+ >+ size_t colon = value.find(':'); >+ if (!colon) >+ return; >+ >+ url.setHostAndPort(value); >+ setHref(url.string()); >+} >+ >+String DOMURL::hostname() const >+{ >+ return href().host(); >+} >+ >+void DOMURL::setHostname(const String& value) >+{ >+ unsigned i = 0; >+ unsigned hostLength = value.length(); >+ while (value[i] == '/') >+ i++; >+ >+ if (i == hostLength) >+ return; >+ >+ KURL url = href(); >+ if (!url.canSetHostOrPort()) >+ return; >+ >+ url.setHost(value.substring(i)); >+ setHref(url.string()); >+} >+ >+String DOMURL::port() const >+{ >+ if (href().hasPort()) >+ return String::number(href().port()); >+ >+ return emptyString(); >+} >+ >+void DOMURL::setPort(const String& value) >+{ >+ KURL url = href(); >+ if (!url.canSetHostOrPort()) >+ return; >+ >+ url.setPort(value.toUInt()); >+ setHref(url.string()); >+} >+ >+String DOMURL::pathname() const >+{ >+ return href().path(); >+} >+ >+void DOMURL::setPathname(const String& value) >+{ >+ KURL url = href(); >+ if (!url.canSetPathname()) >+ return; >+ >+ url.setPath(value); >+ setHref(url.string()); >+} >+ >+String DOMURL::search() const >+{ >+ String query = href().query(); >+ return query.isEmpty() ? emptyString() : "?" + query; >+} >+ >+void DOMURL::setSearch(const String& value) >+{ >+ KURL url = href(); >+ String newSearch = (value[0] == '?') ? value.substring(1) : value; >+ url.setQuery(newSearch.replace('#', "%23")); >+ >+ setHref(url.string()); >+} >+ >+String DOMURL::hash() const >+{ >+ String fragment = href().fragmentIdentifier(); >+ return fragment.isEmpty() ? emptyString() : "#" + fragment; >+} >+ >+void DOMURL::setHash(const String& value) >+{ >+ KURL url = href(); >+ if (value[0] == '#') >+ url.setFragmentIdentifier(value.substring(1)); >+ else >+ url.setFragmentIdentifier(value); >+ setHref(url.string()); >+} >+ >+String DOMURL::filename() >+{ >+ return ""; >+} >+ >+String DOMURL::origin() const >+{ >+ RefPtr<SecurityOrigin> origin = SecurityOrigin::create(href()); >+ return origin->toString(); >+} >+ >+String DOMURL::getParameter(const String&) >+{ >+ // FIXME: Implement me >+ return ""; >+} >+ >+void DOMURL::appendParameter(const String&, const String&) >+{ >+ // FIXME: Implement me >+} >+ >+void DOMURL::clearParameter(const String&) >+{ >+ // FIXME: Implement me >+} >+ >+ >+ > } // namespace WebCore > > #endif // ENABLE(BLOB) >Index: Source/WebCore/html/DOMURL.h >=================================================================== >--- Source/WebCore/html/DOMURL.h (revision 100099) >+++ Source/WebCore/html/DOMURL.h (working copy) >@@ -29,6 +30,7 @@ > #if ENABLE(BLOB) > > #include "ActiveDOMObject.h" >+#include "KURL.h" > #include "PlatformString.h" > #include <wtf/HashSet.h> > #include <wtf/PassRefPtr.h> >@@ -45,14 +47,56 @@ > static PassRefPtr<DOMURL> create(ScriptExecutionContext* scriptExecutionContext) { return adoptRef(new DOMURL(scriptExecutionContext)); } > ~DOMURL(); > >+ String protocol() const; >+ void setProtocol(const String&); >+ >+ String username() const; >+ void setUsername(const String&); >+ >+ String password() const; >+ void setPassword(const String&); >+ >+ String host() const; >+ void setHost(const String&); >+ >+ String hostname() const; >+ void setHostname(const String&); >+ >+ String port() const; >+ void setPort(const String&); >+ >+ String pathname() const; >+ void setPathname(const String&); >+ >+ String search() const; >+ void setSearch(const String&); >+ >+ String hash() const; >+ void setHash(const String&); >+ >+ String filename(); >+ String origin() const; >+ >+ KURL href() const; >+ void setHref(const String&); >+ > #if ENABLE(MEDIA_STREAM) > String createObjectURL(MediaStream*); > #endif > String createObjectURL(Blob*); > void revokeObjectURL(const String&); > >+ String getParameter(const String&); >+ void appendParameter(const String&, const String&); >+ void clearParameter(const String&); >+ > private: >+ String m_filename; >+ String m_origin; >+ KURL m_href; >+ > explicit DOMURL(ScriptExecutionContext*); >+ DOMURL(String&, String&); > > virtual void contextDestroyed(); >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Raw
Actions:
View
Attachments on
bug 71968
:
114916
|
115121
|
115138
|
115532
|
115780
|
116327
|
116565
|
118024
|
118104
|
118145
|
118290
|
118365
|
118687