RESOLVED FIXED Bug 65990
MarkupAccumulator: make resolution of URLs implicit to appendQuotedURLAttributeValue()
https://bugs.webkit.org/show_bug.cgi?id=65990
Summary MarkupAccumulator: make resolution of URLs implicit to appendQuotedURLAttribu...
Ryosuke Niwa
Reported 2011-08-10 09:10:03 PDT
http://trac.webkit.org/changeset/92769 merged two code paths resolveURLIfNeeded. Now that there's exactly one place where resolveURLIfNeeded and resolveURLIfNeeded are called. We should probably merge these two functions.
Attachments
Patch (4.14 KB, patch)
2011-08-10 11:54 PDT, Benjamin Poulain
no flags
Benjamin Poulain
Comment 1 2011-08-10 09:57:39 PDT
Will do, don't worry :)
Benjamin Poulain
Comment 2 2011-08-10 11:54:34 PDT
Benjamin Poulain
Comment 3 2011-08-10 11:57:27 PDT
Just moved appendQuotedURLAttributeValue() to an internal function, so appendAttribute() is the only function the client of the interface should use. I kept resolveURLIfNeeded() because it makes the code more readable IMHO.
Ryosuke Niwa
Comment 4 2011-08-10 12:02:49 PDT
Comment on attachment 103512 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=103512&action=review > Source/WebCore/editing/MarkupAccumulator.cpp:187 > + const String resolvedURLString = resolveURLIfNeeded(element, attribute.value()); > UChar quoteChar = '\"'; > - String strippedURLString = urlString.stripWhiteSpace(); > + String strippedURLString = resolvedURLString.stripWhiteSpace(); Maybe do this one in one line? i.e. String strippedURLString = resolveURLIfNeeded(element, attribute.value()).stripWhiteSpace(); Also, can we make resolveURLIfNeeded a static local function since it doesn't need to access any member variable?
Benjamin Poulain
Comment 5 2011-08-10 12:12:07 PDT
(In reply to comment #4) > (From update of attachment 103512 [details]) > View in context: https://bugs.webkit.org/attachment.cgi?id=103512&action=review > > > Source/WebCore/editing/MarkupAccumulator.cpp:187 > > + const String resolvedURLString = resolveURLIfNeeded(element, attribute.value()); > > UChar quoteChar = '\"'; > > - String strippedURLString = urlString.stripWhiteSpace(); > > + String strippedURLString = resolvedURLString.stripWhiteSpace(); > > Maybe do this one in one line? i.e. > String strippedURLString = resolveURLIfNeeded(element, attribute.value()).stripWhiteSpace(); The non-stripped url is used in the general case. The stripped version is only used in the JavaScript case. I am just following the original code. > Also, can we make resolveURLIfNeeded a static local function since it doesn't need to access any member variable? It does need m_resolveURLsMethod.
Ryosuke Niwa
Comment 6 2011-08-10 12:14:08 PDT
Comment on attachment 103512 [details] Patch ok
WebKit Review Bot
Comment 7 2011-08-10 12:46:01 PDT
Comment on attachment 103512 [details] Patch Clearing flags on attachment: 103512 Committed r92786: <http://trac.webkit.org/changeset/92786>
WebKit Review Bot
Comment 8 2011-08-10 12:46:06 PDT
All reviewed patches have been landed. Closing bug.
Note You need to log in before you can comment on or make changes to this bug.