Bug 78478 - Implement common class for URL decomposition attribute
Summary: Implement common class for URL decomposition attribute
Status: RESOLVED WONTFIX
Alias: None
Product: WebKit
Classification: Unclassified
Component: DOM (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Nobody
URL:
Keywords:
Depends on:
Blocks: 76816
  Show dependency treegraph
 
Reported: 2012-02-13 02:44 PST by Kaustubh Atrawalkar
Modified: 2012-02-15 09:48 PST (History)
7 users (show)

See Also:


Attachments
WIP (15.38 KB, patch)
2012-02-13 02:46 PST, Kaustubh Atrawalkar
webkit-ews: commit-queue-
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Kaustubh Atrawalkar 2012-02-13 02:44:29 PST
Implement a comman base class for URL decomposition attributes setter & getter functions to avoid repetition in page/Location, html/HTMLAnchorElement & html/DOMURL (to be implemented).
Comment 1 Kaustubh Atrawalkar 2012-02-13 02:46:36 PST
Created attachment 126741 [details]
WIP

First level WIP. This has implementation of common base class and replacement setter/getter function used in page/Location.
Comment 2 WebKit Review Bot 2012-02-13 02:50:08 PST
Attachment 126741 [details] did not pass style-queue:

Failed to run "['Tools/Scripts/check-webkit-style', '--diff-files', u'Source/WebCore/CMakeLists.txt', u'Source/W..." exit_code: 1

Source/WebCore/html/URLAttributes.cpp:92:  Weird number of spaces at line-start.  Are you using a 4-space indent?  [whitespace/indent] [3]
Total errors found: 1 in 7 files


If any of these errors are false positives, please file a bug against check-webkit-style.
Comment 3 Early Warning System Bot 2012-02-13 03:27:06 PST
Comment on attachment 126741 [details]
WIP

Attachment 126741 [details] did not pass qt-ews (qt):
Output: http://queues.webkit.org/results/11507761
Comment 4 WebKit Review Bot 2012-02-13 09:41:48 PST
Comment on attachment 126741 [details]
WIP

Attachment 126741 [details] did not pass chromium-ews (chromium-xvfb):
Output: http://queues.webkit.org/results/11509808

New failing tests:
fast/dom/Window/invalid-protocol.html
fast/history/history-back-within-subframe-hash.html
http/tests/xmlhttprequest/workers/referer.html
fast/forms/submit-change-fragment.html
http/tests/loading/location-hash-reload-cycle.html
fast/history/history-back-forward-within-subframe-hash.html
fast/history/same-document-iframes-changing-fragment.html
fast/loader/about-blank-hash-change.html
fast/history/same-document-iframes-changing-pushstate.html
fast/loader/hashchange-event.html
http/tests/inspector/change-iframe-src.html
http/tests/history/popstate-fires-with-pending-requests.html
fast/dom/location-new-window-no-crash.html
http/tests/inspector/inspect-iframe-from-different-domain.html
fast/dom/location-hash.html
fast/loader/stateobjects/pushstate-with-fragment-urls-and-hashchange.html
fast/history/location-replace-hash.html
Comment 5 Alexey Proskuryakov 2012-02-13 10:36:02 PST
What does this buy us? From the patch, it doesn't appear that a lot of code sharing is achieved, nor does the size of code go down.

These attributes are slightly different anyway.
Comment 6 Kaustubh Atrawalkar 2012-02-13 22:07:38 PST
(In reply to comment #5)
> What does this buy us? From the patch, it doesn't appear that a lot of code sharing is achieved, nor does the size of code go down.
> 
> These attributes are slightly different anyway.

Based on the Adam's suggestion, we should be creating a common base class to accommodate all these 8 attributes's setter & getter functions. Current patch is just first cut implementation of base class and migrating Location's class functions to this class. The purpose of uploading this patch was to get comments if I am going on right direction. Will be uploading one more WIP which will have HTMLAnchorElement implementation.
Comment 7 Alexey Proskuryakov 2012-02-14 00:28:13 PST
We'll need to see how much this helps. KURL is pretty much the class that implements this.
Comment 8 Kaustubh Atrawalkar 2012-02-14 01:04:31 PST
True, KURL has its own implementation. We might fix the KURL ascii issues and make it complete so that all these Location/HTMLAnchorElement/DOMURL can use it without needing any more modification on url.
Comment 9 Alexey Proskuryakov 2012-02-14 10:16:22 PST
You are using KURL's implementation already.

What I'm saying is that even when there is a lot of code to share, adding a common base class is the wrong solution. Inheritance is not a method of code sharing.

In this particular case, it seems that there is no issue to solve in the first place.
Comment 10 Kaustubh Atrawalkar 2012-02-14 21:22:20 PST
(In reply to comment #9)
> You are using KURL's implementation already.
> 
> What I'm saying is that even when there is a lot of code to share, adding a common base class is the wrong solution. Inheritance is not a method of code sharing.
> 
> In this particular case, it seems that there is no issue to solve in the first place.

From your comments what I get is I should implement the URL decomposition attributes as it is without using base class as this is not much code saving mechanism to make a base class. If so, I will close this bug and will update the patch in https://bugs.webkit.org/show_bug.cgi?id=76816.
Comment 11 Alexey Proskuryakov 2012-02-14 21:26:32 PST
I think that this would be more like what Adam was referring to, as well.

As you've seen, KURL already has code for most of what this API exposes.
Comment 12 Kaustubh Atrawalkar 2012-02-14 21:41:48 PST
(In reply to comment #11)
> I think that this would be more like what Adam was referring to, as well.
> 
> As you've seen, KURL already has code for most of what this API exposes.

Yes, KURL already has almost complete APIs for the same. And all these setter/getter functions have little or No modification over these. So, I will close this bug and will update the blocking issue with updated patch.
Comment 13 Kaustubh Atrawalkar 2012-02-15 02:36:54 PST
Closing the bugs as per discussion. Will reopen if in future there would be
Comment 14 Kaustubh Atrawalkar 2012-02-15 02:37:35 PST
Closing the bugs as per discussion. Will reopen if in future there would be need to code re-factoring.