1. 30 Sep, 2009 2 commits
  2. 09 Sep, 2009 1 commit
    • hyatt@apple.com's avatar
      WebCore: https://bugs.webkit.org/show_bug.cgi?id=29102, add support for user... · 63e0ac2f
      hyatt@apple.com authored
      WebCore: https://bugs.webkit.org/show_bug.cgi?id=29102, add support for user stylesheet injection.  This is similar
      to user script injection but allows for user stylesheets to be added.  The stylesheets are applied immediately
      to all Frames in the PageGroup.
      
      Reviewed by Adam Roben.
      
      Added userscripts/simple-stylesheet.html test case.
      
      * WebCore.base.exp:
      * WebCore.gypi:
      * WebCore.vcproj/WebCore.vcproj:
      * WebCore.xcodeproj/project.pbxproj:
      * css/CSSStyleSelector.cpp:
      (WebCore::CSSStyleSelector::CSSStyleSelector):
      * css/CSSStyleSelector.h:
      * dom/Document.cpp:
      (WebCore::Document::Document):
      (WebCore::Document::attach):
      (WebCore::Document::pageGroupUserSheets):
      (WebCore::Document::clearPageGroupUserSheets):
      (WebCore::Document::recalcStyleSelector):
      * dom/Document.h:
      * loader/PlaceholderDocument.cpp:
      (WebCore::PlaceholderDocument::attach):
      * page/PageGroup.cpp:
      (WebCore::PageGroup::addUserStyleSheet):
      (WebCore::PageGroup::removeUserContentForWorld):
      (WebCore::PageGroup::removeAllUserContent):
      * page/PageGroup.h:
      (WebCore::PageGroup::userStyleSheets):
      * page/UserStyleSheet.h: Added.
      (WebCore::UserStyleSheet::UserStyleSheet):
      (WebCore::UserStyleSheet::source):
      (WebCore::UserStyleSheet::url):
      (WebCore::UserStyleSheet::patterns):
      (WebCore::UserStyleSheet::worldID):
      * page/UserStyleSheetTypes.h: Added.
      
      WebKit/mac: https://bugs.webkit.org/show_bug.cgi?id=29102, add support for user stylesheet injection.  This is similar
      to user script injection but allows for user stylesheets to be added.  The stylesheets are applied immediately
      to all Frames in the PageGroup.
      
      Reviewed by Adam Roben.
      
      Added userscripts/simple-stylesheet.html test case.
      
      * WebView/WebView.mm:
      (+[WebView _addUserStyleSheetToGroup:source:url:worldID:patterns:]):
      * WebView/WebViewPrivate.h:
      
      LayoutTests: https://bugs.webkit.org/show_bug.cgi?id=29102, add support for user stylesheet injection.  This is similar
      to user script injection but allows for user stylesheets to be added.  The stylesheets are applied immediately
      to all Frames in the PageGroup.
      
      Reviewed by Adam Roben.
      
      Added userscripts/simple-stylesheet.html test case.
      
      * platform/mac/userscripts/simple-stylesheet-expected.checksum: Added.
      * platform/mac/userscripts/simple-stylesheet-expected.png: Added.
      * platform/mac/userscripts/simple-stylesheet-expected.txt: Added.
      * userscripts/simple-stylesheet.html: Added.
      
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@48222 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      63e0ac2f
  3. 04 Sep, 2009 1 commit
    • hyatt@apple.com's avatar
      WebCore: https://bugs.webkit.org/show_bug.cgi?id=28890, make simple user script injection work. · 71960d78
      hyatt@apple.com authored
              
      Reviewed by Adam Roben.
      
      This patch adds new API for adding and removing user scripts from page groups.  User scripts
      are bundled together in isolated worlds (you can have multiple scripts together in the same
      world).
      
      Added userscripts/ directory for holding new tests (along with a simple test of script injection).
      
      * WebCore.base.exp:
      * WebCore.vcproj/WebCore.vcproj:
      * WebCore.xcodeproj/project.pbxproj:
      * bindings/js/ScriptController.cpp:
      (WebCore::ScriptController::evaluateInIsolatedWorld):
      * bindings/js/ScriptController.h:
      * bindings/v8/ScriptController.cpp:
      (WebCore::ScriptController::evaluateInIsolatedWorld):
      * bindings/v8/ScriptController.h:
      * loader/FrameLoader.cpp:
      (WebCore::FrameLoader::finishedParsing):
      (WebCore::FrameLoader::dispatchDocumentElementAvailable):
      * page/Frame.cpp:
      (WebCore::Frame::injectUserScripts):
      (WebCore::Frame::injectUserScriptsForWorld):
      * page/Frame.h:
      * page/PageGroup.cpp:
      (WebCore::PageGroup::~PageGroup):
      (WebCore::PageGroup::addUserScript):
      (WebCore::PageGroup::removeUserContentForWorld):
      (WebCore::PageGroup::removeAllUserContent):
      * page/PageGroup.h:
      (WebCore::PageGroup::userScripts):
      * page/UserScript.h: Added.
      (WebCore::UserScript::UserScript):
      (WebCore::UserScript::source):
      (WebCore::UserScript::url):
      (WebCore::UserScript::patterns):
      (WebCore::UserScript::worldID):
      (WebCore::UserScript::injectionTime):
      * page/UserScriptTypes.h: Added.
      (WebCore::):
      
      WebKit/mac: https://bugs.webkit.org/show_bug.cgi?id=28890, make simple user script injection work.
              
      Reviewed by Adam Roben.
      
      This patch adds new API for adding and removing user scripts from page groups.  User scripts
      are bundled together in isolated worlds (you can have multiple scripts together in the same
      world).
      
      Added userscripts/ directory for holding new tests (along with a simple test of script injection).
      
      * WebView/WebView.mm:
      (+[WebView _addUserScriptToGroup:source:url:worldID:patterns:injectionTime:]):
      (+[WebView _removeUserContentFromGroup:worldID:]):
      (+[WebView _removeAllUserContentFromGroup:]):
      * WebView/WebViewPrivate.h:
      
      LayoutTests: https://bugs.webkit.org/show_bug.cgi?id=28890, make simple user script injection work.
              
      Reviewed by Adam Roben.
      
      This patch adds new API for adding and removing user scripts from page groups.  User scripts
      are bundled together in isolated worlds (you can have multiple scripts together in the same
      world).
      
      Added userscripts/ directory for holding new tests (along with a simple test of script injection).
      
      * platform/mac/userscripts: Added.
      * platform/mac/userscripts/script-run-at-end-expected.txt: Added.
      * userscripts: Added.
      * userscripts/script-run-at-end.html: Added.
      
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@48057 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      71960d78
  4. 26 Jun, 2009 1 commit
    • dglazkov@chromium.org's avatar
      2009-06-26 Jeremy Orlow <jorlow@chromium.org> · 5626dd64
      dglazkov@chromium.org authored
              Reviewed by Darin Fisher.
      
              https://bugs.webkit.org/show_bug.cgi?id=26732
      
              For the final step of https://bugs.webkit.org/show_bug.cgi?id=25376,
              combine LocalStorage and SessionStorage into StorageNamespace. The
              synching code (for LocalStorage) has already been removed, so these
              classes are now very similar.  All they do is essentially contain a
              logical grouping of origins that are attached to specific contexts
              (be it PageGroups for LocalStorage and Page for SessionStorage).
      
              * GNUmakefile.am:
              * WebCore.vcproj/WebCore.vcproj:
              * WebCore.xcodeproj/project.pbxproj:
              * WebCoreSources.bkl:
              * page/Chrome.cpp:
              (WebCore::Chrome::createWindow):
              * page/DOMWindow.cpp:
              (WebCore::DOMWindow::localStorage):
              * page/DOMWindow.h:
              * page/Page.cpp:
              (WebCore::Page::sessionStorage):
              (WebCore::Page::setSessionStorage):
              * page/Page.h:
              * page/PageGroup.cpp:
              (WebCore::PageGroup::localStorage):
              * page/PageGroup.h:
              * storage/LocalStorage.cpp: Removed.
              * storage/LocalStorage.h: Removed.
              * storage/LocalStorageTask.cpp:
              * storage/LocalStorageThread.cpp:
              * storage/SessionStorage.cpp: Removed.
              * storage/SessionStorage.h: Removed.
              * storage/StorageArea.cpp:
              (WebCore::StorageArea::create):
              (WebCore::StorageArea::StorageArea):
              (WebCore::StorageArea::copy):
              (WebCore::StorageArea::length):
              (WebCore::StorageArea::key):
              (WebCore::StorageArea::getItem):
              (WebCore::StorageArea::setItem):
              (WebCore::StorageArea::removeItem):
              (WebCore::StorageArea::clear):
              (WebCore::StorageArea::contains):
              (WebCore::StorageArea::importItem):
              (WebCore::StorageArea::close):
              (WebCore::StorageArea::dispatchStorageEvent):
              * storage/StorageArea.h:
              (WebCore::):
              * storage/StorageAreaSync.cpp:
              (WebCore::StorageAreaSync::scheduleFinalSync):
              * storage/StorageNamespace.cpp: Copied from WebCore/storage/LocalStorage.cpp.
              (WebCore::localStorageNamespaceMap):
              (WebCore::StorageNamespace::localStorageNamespace):
              (WebCore::StorageNamespace::sessionStorageNamespace):
              (WebCore::StorageNamespace::StorageNamespace):
              (WebCore::StorageNamespace::~StorageNamespace):
              (WebCore::StorageNamespace::copy):
              (WebCore::StorageNamespace::storageArea):
              (WebCore::StorageNamespace::close):
              * storage/StorageNamespace.h: Copied from WebCore/storage/LocalStorage.h.
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@45290 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      5626dd64
  5. 13 Jun, 2009 1 commit
    • abarth@webkit.org's avatar
      2009-06-13 Ben Murdoch <benm@google.com> · ea665a21
      abarth@webkit.org authored
              Reviewed by David Kilzer.  Landed by Adam Barth.
      
              https://bugs.webkit.org/show_bug.cgi?id=26189
      
              This patch changes the way PageGroups create their localStorage
              objects. Rather than creating a local storage object for the page group
              when a page is added to the group, the local storage object is now
              created lazily when the local storage object is requested by the
              DOMWindow.
      
              * page/PageGroup.cpp:
              (WebCore::PageGroup::closeLocalStorage): Before attempting to close a local storage object for a page group, ensure one has been created.
              (WebCore::PageGroup::addPage): Do not automatically try to create a local storage object when a page is added to the group.
              (WebCore::PageGroup::localStorage): Create a local storage object if one does not exist and return it.
              * page/PageGroup.h: Add private hasLocalStorage method to PageGroup.
      
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@44663 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      ea665a21
  6. 05 Dec, 2008 1 commit
    • brettw@chromium.org's avatar
      Reviewed by Darin Adler. · 6af05ad4
      brettw@chromium.org authored
      Make the page group use the proper link hashing functions rather than
      calling the string hash functions directly. Add Chromium-specfic ifdefs
      in the visited link computation functions to allow integration.
      
      * page/PageGroup.cpp:
      (WebCore::PageGroup::isLinkVisited):
      (WebCore::PageGroup::addVisitedLink):
      * platform/LinkHash.cpp:
      (WebCore::visitedLinkHash):
      * platform/LinkHash.h:
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@39060 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      6af05ad4
  7. 21 Nov, 2008 1 commit
  8. 06 Aug, 2008 1 commit
    • beidson@apple.com's avatar
      2008-08-06 Brady Eidson <beidson@apple.com> · df1fd513
      beidson@apple.com authored
              Reviewed by MitzPettel
      
              <rdar://problem/6078543> - Many LocalStorageThreads may be started
      
              The original decision to key LocalStorage sets to PageGroups was a poor one.
      
              It seems a much better solution is to key them to the actual path of on-disk storage,
              which also solves all of the avenues that could lead to a boundless number of threads.
      
              In this patch, I am not attempting to completely sever the attachment of LocalStorage
              to PageGroups as that would require a more substantial re-working of the lifetime
              between pages, groups, and local storage threads.
      
              * page/PageGroup.cpp:
              (WebCore::PageGroup::addPage):
      
              * storage/LocalStorage.cpp:
              (WebCore::localStorageMap):  Map paths to LocalStorage objects here.
              (WebCore::LocalStorage::localStorage): Return the shared LocalStorage object for this path,
                or create a new one if it doesn't yet exist.
              (WebCore::LocalStorage::LocalStorage):
              (WebCore::LocalStorage::~LocalStorage):  Add to remove the path->LocalStorage mapping
              * storage/LocalStorage.h:
      
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@35614 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      df1fd513
  9. 10 May, 2008 1 commit
  10. 07 May, 2008 1 commit
  11. 06 May, 2008 1 commit
    • beidson@apple.com's avatar
      WebCore: · 18ed1cdf
      beidson@apple.com authored
      2008-05-06  Brady Eidson  <beidson@apple.com>
      
              Reviewed by Darin Adler
      
              Preparation for upcoming work making LocalStorage persistent.
      
              When the application terminates, all pending local storage writes need to be
              sync'ed out to disk.
              This works n combination with platform specific code in WebKit that calls it.
      
              * WebCore.base.exp:
      
              * page/PageGroup.cpp:
              (WebCore::PageGroup::closeLocalStorage): Close all open LocalStorage objects
              * page/PageGroup.h:
      
              * storage/LocalStorage.cpp:
              (WebCore::LocalStorage::close): Placeholder for what will sync and terminate the
                local storage thread in the future.
              * storage/LocalStorage.h:
      
      WebKit/mac:
      
      2008-05-06  Brady Eidson  <beidson@apple.com>
      
              Reviewed by Darin Adler
      
              Preparation for upcoming work making LocalStorage persistent.
      
              When the application terminates, all LocalStorage areas must be sync'ed out to disk first.
      
              * WebView/WebView.mm:
              (+[WebView _applicationWillTerminate]):  Close all LocalStorage areas before quitting.
      
      WebKit/win:
      
      2008-05-06  Brady Eidson  <beidson@apple.com>
      
              Reviewed by Darin Adler
      
              Preparation for upcoming work making LocalStorage persistent.
      
              When the application terminates, all LocalStorage areas must be sync'ed out to disk first.
      
              * WebKitDLL.cpp:
              (shutDownWebKit): Close all LocalStorage areas before quitting.
      
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@32906 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      18ed1cdf
  12. 05 May, 2008 1 commit
    • beidson@apple.com's avatar
      2008-05-05 Brady Eidson <beidson@apple.com> · 06c8e74b
      beidson@apple.com authored
              Reviewed by Mitz Pettel RTL
      
              Preparation for upcoming work making LocalStorage persistent.
      
              - Create the LocalStorage object for a PageGroup the moment the first Page is added to it
                The Settings of the first Page define what persistent path the LocalStorage will use
              - Add a Frame argument for the LocalStorageArea request - this will allow a client object
                to be queried before the LocalStorageArea is established
      
              * page/DOMWindow.cpp:
              (WebCore::DOMWindow::localStorage):
      
              * page/PageGroup.cpp:
              (WebCore::PageGroup::addPage):
              (WebCore::PageGroup::localStorage):
      
              * storage/LocalStorage.cpp:
              (WebCore::LocalStorage::LocalStorage): Take the path as a constructor argument.  Deep copy
                the path as it will be used from another thread.
              (WebCore::LocalStorage::storageArea):
              * storage/LocalStorage.h:
              (WebCore::LocalStorage::create):
      
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@32899 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      06c8e74b
  13. 24 Apr, 2008 2 commits
    • beidson@apple.com's avatar
      2008-04-24 Brady Eidson <beidson@apple.com> · ab528fba
      beidson@apple.com authored
              Reviewed by Teh Mitzpettel
      
              Make it so PageGroups know what their own name is.
      
              * WebCore.base.exp:
      
              * page/Page.cpp:
              (WebCore::Page::setGroupName):
              (WebCore::Page::groupName):
              * page/Page.h:
      
              * page/PageGroup.cpp: Move the PageGroupMap into the PageGroup class.
              (WebCore::PageGroup::PageGroup): Added a c'tor that takes the group name as an argument instead of
                the initial Page.
              (WebCore::PageGroup::pageGroup): Handles creating and mapping names to groups
              * page/PageGroup.h:
              (WebCore::PageGroup::name):
      
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@32524 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      ab528fba
    • kmccullough@apple.com's avatar
      JavaScriptCore: · d9e61e09
      kmccullough@apple.com authored
      2008-04-24  Kevin McCullough  <kmccullough@apple.com>
      
              Reviewed by Adam and Sam.
      
              -<rdar://problem/5770054> JavaScript profiler (10928)
              -Only profile the page group that starts profiling to avoid profiling
              tools that shouldn't be profiled unless explicitly requested to.
      
              * JavaScriptCore.exp: Export new signature.
              * kjs/JSGlobalObject.cpp: Add unique identifiers to the JSGlobalObject.
              (KJS::JSGlobalObject::init):
              * kjs/JSGlobalObject.h: Ditto.
              (KJS::JSGlobalObject::setPageGroupIdentifier):
              (KJS::JSGlobalObject::pageGroupIdentifier):
              * profiler/Profiler.cpp: Check the identifier of the page group of the
              lexical global exec state and only profile if it matches the given page
              group identifier.
              (KJS::Profiler::startProfiling):
              (KJS::Profiler::willExecute):
              (KJS::Profiler::didExecute):
              * profiler/Profiler.h: Ditto.
              (KJS::Profiler::Profiler):
      
      WebCore:
      
      2008-04-24  Kevin McCullough  <kmccullough@apple.com>
      
              Reviewed by Adam and Sam.
      
              -<rdar://problem/5770054> JavaScript profiler (10928)
              -Only profile the page group that starts profiling to avoid profiling
              tools that shouldn't be profiled unless explicitly requested to.
      
              * bindings/js/kjs_proxy.cpp: When a new global object is created set its
              page group identifier.
              (WebCore::KJSProxy::clear):
              (WebCore::KJSProxy::initScript):
              * page/Console.cpp: When calling console.profile set the identifier of
              the page group being profiled.
              (WebCore::Console::profile):
              * page/PageGroup.cpp: Implement unique identifiers.
              (WebCore::getUniqueIdentifier):
              (WebCore::PageGroup::PageGroup):
              * page/PageGroup.h: Ditto.
              (WebCore::PageGroup::identifier):
      
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@32495 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      d9e61e09
  14. 18 Apr, 2008 3 commits
  15. 17 Apr, 2008 1 commit
    • beidson@apple.com's avatar
      2008-04-17 Brady Eidson <beidson@apple.com> · 653985c6
      beidson@apple.com authored
              Reviewed by the Mitzpettel
      
              Before things get much more intertwined, move away from a global LocalStorage model
              to a per-PageGroup LocalStorage model.
      
              * page/DOMWindow.cpp:
              (WebCore::DOMWindow::localStorage): Get it from the current PageGroup, not the global
                LocalStorage (which doesn't exist anymore).
      
              * page/Page.cpp:
              * page/PageGroup.cpp:
              (WebCore::PageGroup::localStorage): Create a LocalStorage object on demand.
              * page/PageGroup.h:
      
              * storage/LocalStorage.cpp:
              (WebCore::LocalStorage::LocalStorage): Hold a back pointer to the owning PageGroup.
              (WebCore::LocalStorage::storageArea):
              * storage/LocalStorage.h:
              (WebCore::LocalStorage::create):
      
              * storage/LocalStorageArea.cpp:
              (WebCore::LocalStorageArea::LocalStorageArea): Hold a back pointer to the owning LocalStorage.
              * storage/LocalStorageArea.h:
              (WebCore::LocalStorageArea::create):
      
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@32020 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      653985c6
  16. 10 Mar, 2008 1 commit
    • darin@apple.com's avatar
      Reviewed by Antti. · d69216d5
      darin@apple.com authored
              - fix <rdar://problem/3059610> VIP: links opened in new frame, window, or tab
                should be redrawn as visited immediately
              - fix <rdar://problem/4382809> Going "back" a page doesn't change the color of
                the visited URL at directory.umi
              - fix http://bugs.webkit.org/show_bug.cgi?id=4941
                Visited links should be marked as visited
              - fix http://bugs.webkit.org/show_bug.cgi?id=7960
                REGRESSION: Visited link color doesn't displayed after loading page from cache
      
              We now mark all links on a page as "changed" at the appropriate times.
      
              * WebCore.base.exp: Update since I made completeURL be a const member function.
      
              * css/CSSStyleSelector.cpp: Got rid of some unneeded globals that could be turned
              into locals. Also changed some static data members to file-scoped globals with
              internal linkage. Renamed the globals to get rid of the m_ prefix. Changed the
              prefix on m_styleNotYetAvailable to s_styleNotYetAvailable.
              (WebCore::CSSStyleSelector::CSSStyleSelector): Updated for name changes.
              (WebCore::parseUASheet): Tweak the comment.
              (WebCore::CSSStyleSelector::loadDefaultStyle): Updated for name changes and to
              use local variables instead of globals where possible.
              (WebCore::CSSStyleSelector::checkPseudoState): Made this a member function so
              it can store the link in a hash. Also changed it to have a return value instead
              of having it modify a global variable. Added code to put the hash into a set so
              we can tell later if this is one of the links that affects this page.
              (WebCore::CSSStyleSelector::canShareStyleWithElement): Updated for the change to
              checkPseudoState.
              (WebCore::CSSStyleSelector::matchUARules): Updated for name changes.
              (WebCore::CSSStyleSelector::styleForElement): Ditto.
              (WebCore::CSSStyleSelector::adjustRenderStyle): Ditto.
              (WebCore::CSSStyleSelector::pseudoStyleRulesForElement): Changed code to read
              the SVG style sheet to use a boolean global and put it right here in the function
              since this is the only code that needs to know about it.
              (WebCore::CSSStyleSelector::checkOneSelector): Updated for name changes.
              (WebCore::colorForCSSValue): Moved code inside the function that is not needed
              anywhere else.
              (WebCore::CSSStyleSelector::getColorFromPrimitiveValue): Updaed for the change
              to checkPseudoState.
              (WebCore::CSSStyleSelector::allVisitedStateChanged): Added. Calls setChanged on
              all links if there were any in the set.
              (WebCore::CSSStyleSelector::visitedStateChanged): Added. Calls setChanged on all
              links if the one that changed is in the set.
      
              * css/CSSStyleSelector.h: Removed unused StyleSelector class and State enum. Made
              CSSStyleSelector derive from Noncopyable. Made lots of member functions private that
              didn't need to be public, and removed others that could be made into non-member
              functions. Changed pseudoStyleRulesForElement to take a const String& instead of
              a StringImpl*. Added new allVisitedStateChanged and visitedStateChanged functions.
              Got rid of unneeded friend declarations.
      
              * dom/Document.cpp:
              (WebCore::Document::completeURL): Made const.
              (WebCore::findSlashDotDotSlash): Moved here from PageGroup.
              (WebCore::findSlashSlash): Ditto.
              (WebCore::findSlashDotSlash): Ditto.
              (WebCore::containsColonSlashSlash):
              (WebCore::cleanPath): Ditto.
              (WebCore::matchLetter): Ditto.
              (WebCore::needsTrailingSlash): Ditto.
              (WebCore::Document::visitedLinkHash): Moved this here from PageGroup. This is
              the poor-man's completeURL function. The idea of putting it here is that this
              way it can be alongside the real completeURL function. Later we should figure out
              a way to make this function share more code with the real thing and match behavior.
      
              * dom/Document.h: Marked completeURL function const. Added visitedLinkHash function.
      
              * page/DOMWindow.cpp:
              (WebCore::DOMWindow::getMatchedCSSRules): Updated for change to CSSStyleSelector.
      
              * page/Page.cpp:
              (WebCore::Page::allVisitedStateChanged): Added. Calls allVisitedStateChanged on all
              style selectors.
              (WebCore::Page::visitedStateChanged): Ditto.
              * page/Page.h: Added the above functions.
      
              * page/PageGroup.cpp:
              (WebCore::PageGroup::isLinkVisited): Changed to take a visitedLinkHash parameter.
              The CSSStyleSelector now handles actually computing the hash, and it does so by
              calling code in Document.
              (WebCore::PageGroup::addVisitedLink): Refactored so the two overloaded copies share
              a bit more code. Added code that calls visitedStateChanged if a new link was added.
              (WebCore::PageGroup::removeVisitedLinks): Added code to call allVisitedStateChanged
              if any visited links are removed.
              * page/PageGroup.h: Include StringHash.h instead of having the AlreadyHashed struct
              definition here.
      
              * platform/text/StringHash.h:
              (WebCore::CaseFoldingHash::hash): Tweaked to make this a bit more consistent with
              the StringImpl::computeHash function, using the same technique for avoiding 0.
              (WebCore::AlreadyHashed::hash): Added. Was formerly in PageGroup.h.
              (WebCore::AlreadyHashed::avoidDeletedValue): Added. Was formerly in PageGroup.cpp.
      
              * rendering/RenderStyle.cpp:
              (WebCore::RenderStyle::isStyleAvailable): Changed to use an inline function instead
              of getting directly at a data member so the data member could be made private.
      
              * loader/FrameLoader.cpp:
              (WebCore::FrameLoader::scrollToAnchor): Added call to updateHistoryForAnchorScroll.
              (WebCore::FrameLoader::updateHistoryForAnchorScroll): Added.
              * loader/FrameLoader.h: Added updateHistoryForAnchorScroll.
      
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@30949 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      d69216d5
  17. 07 Mar, 2008 1 commit
    • darin@apple.com's avatar
      Reviewed by Brady. · fbeddf3e
      darin@apple.com authored
              - fix a theoretical problem with the visited-link hash table by avoiding collision
                with the special "deleted" value
              - improve efficiency of with the visited-link hash table by not hashing twice
      
              * page/PageGroup.cpp:
              (WebCore::avoidDeletedValue): Added. Makes sure we never try to use the "all ones"
              value, since the hash table uses that for deleted hash table entries.
              (WebCore::PageGroup::isLinkVisited): Call avoidDeletedValue before using the hash
              value with the HashSet.
              (WebCore::PageGroup::addVisitedLink): Ditto.
      
              * page/PageGroup.h: Added a new hash function, AlreadyHashed, for unsigned integer
              values. This assumes that the value is already a hash value, and doesn't try to
              hash it again. Used this for m_visitedLinkHashes.
      
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@30873 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      fbeddf3e
  18. 06 Mar, 2008 2 commits
    • darin@apple.com's avatar
      WebCore: · 62cb9c58
      darin@apple.com authored
              Reviewed by Mitz.
      
              - fix regression test failures from the visited-link change
      
              * WebCore.base.exp: Export PageGroup::setShouldTrackVisitedLinks.
              * page/PageGroup.cpp:
              (WebCore::PageGroup::addVisitedLink): Do nothing and return early
              if shouldTrackVisitedLinks is false.
              (WebCore::PageGroup::removeVisitedLinks): Reset m_visitedLinksPopulated
              so the next time a link is queried this will be populated from history.
              (WebCore::PageGroup::setShouldTrackVisitedLinks): Added.
              * page/PageGroup.h: Added setShouldTrackVisitedLinks. This is global
              for now, but it would be better if it was per-page-group instead.
      
      WebKit/mac:
      
              Reviewed by Mitz.
      
              - fix regression test failures from the visited-link change
      
              * History/WebHistory.mm:
              (+[WebHistory setOptionalSharedHistory:]): Call PageGroup::setShouldTrackVisitedLinks
              to turn off visited links if there is no history object. Also call
              removeAllVisitedLinks so we can start over from scratch with the new history.
      
      WebKit/win:
      
              Reviewed by Mitz.
      
              - fix regression test failures and crashes from the visited-link change
      
              * WebCoreSupport/WebChromeClient.cpp:
              (WebChromeClient::populateVisitedLinks): Check for null before calling
              addVisitedLinksToPageGroup.
              * WebCoreSupport/WebFrameLoaderClient.cpp:
              (WebFrameLoaderClient::updateGlobalHistory): Ditto.
              * WebHistory.cpp:
              (WebHistory::setOptionalSharedHistory): Call PageGroup::setShouldTrackVisitedLinks
              to turn off visited links if there is no history object. Also call
              removeAllVisitedLinks so we can start over from scratch with the new history.
      
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@30867 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      62cb9c58
    • darin@apple.com's avatar
      WebCore: · 2060803d
      darin@apple.com authored
              Reviewed by Mitz.
      
              - fix http://bugs.webkit.org/show_bug.cgi?id=17526
                REGRESSION: iframes are added to Safari's History menu
                by separating the visited link machinery from global history
      
              This should also make page loading faster due to more efficient visited link coloring.
      
              * WebCore.base.exp: Updated.
              * WebCore.vcproj/WebCore.vcproj: Added PageGroup.h/cpp, removed GlobalHistory.h/cpp.
              * WebCore.xcodeproj/project.pbxproj: Ditto. Also removed WebCoreHistory.h/m.
      
              * css/CSSStyleSelector.cpp: Updated includes.
              (WebCore::CSSStyleSelector::initElementAndPseudoState): Eliminated code to set
              currentEncodedURL.
              (WebCore::checkPseudoState): Moved most of the code inside a new
              PageGroup::isLinkVisited function.
              (WebCore::CSSStyleSelector::canShareStyleWithElement): Tightened code a bit by using
              references and only getting colors when needed.
              (WebCore::CSSStyleSelector::getColorFromPrimitiveValue): Ditto.
              * css/CSSStyleSelector.h: Removed EncodedURL, m_encodedURL, and setEncodedURL.
      
              * dom/Document.cpp:
              (WebCore::Document::attach): Removed call to setEncodedURL.
              (WebCore::Document::setURL): Ditto.
              (WebCore::Document::recalcStyleSelector): Ditto.
      
              * loader/FrameLoader.cpp:
              (WebCore::FrameLoader::addBackForwardItemClippedAtTarget): Changed code to use
              early exit idiom to be a little more readable.
              (WebCore::FrameLoader::urlsMatchItem): Change to use a reference for slightly
              better efficiency.
              (WebCore::FrameLoader::goToItem): Use early exit idiom to be a little more
              readable.
              (WebCore::FrameLoader::updateHistoryForStandardLoad): Moved history code back
              in here and got rid of the helper function updateGlobalHistory, restoring the
              logic before r30549. Also added a call to the new addVisitedLink function.
              (WebCore::FrameLoader::updateHistoryForClientRedirect): Added code to call
              addVisitedLink here.
              (WebCore::FrameLoader::updateHistoryForBackForwardNavigation): Removed comment.
              (WebCore::FrameLoader::updateHistoryForReload): Removed call to
              updateGlobalHistory; we can just go without updating global history or
              visited links here, at least for now, since it's not clear that a reload
              is a "history event".
              (WebCore::FrameLoader::updateHistoryForRedirectWithLockedHistory): Moved
              history code back where it was, and added the call to addVisitedLink, just
              as in updateHistoryForStandardLoad above.
              * loader/FrameLoader.h: Removed updateGlobalHistory function.
      
              * page/Chrome.cpp:
              (WebCore::ChromeClient::populateVisitedLinks): Added. Empty placeholder so we
              don't have to implement this for every port all at once.
              (WebCore::PageGroupLoadDeferrer::PageGroupLoadDeferrer): Changed to use the
              new PageGroup class.
              * page/ChromeClient.h: Added populateVisitedLinks function, used to fill the
              visited links set from the global history at application startup time.
      
              * page/FrameTree.cpp:
              (WebCore::FrameTree::find): Updated to use the new PageGroup class.
      
              * page/GlobalHistory.h: Removed.
              * page/win/GlobalHistoryWin.cpp: Removed.
              * page/mac/GlobalHistoryMac.mm: Removed.
              * platform/mac/WebCoreHistory.h: Removed.
              * platform/mac/WebCoreHistory.m: Removed.
              * platform/win/WebCoreHistory.cpp: Removed.
              * platform/win/WebCoreHistory.h: Removed.
      
              * page/Page.cpp:
              (WebCore::Page::Page): Set m_group to 0.
              (WebCore::Page::setGroupName): Set up m_group. If the page is not in any
              group, set it to 0 for now to postpone the cost of creating a group.
              (WebCore::Page::initGroup): Added. Sets m_group to point to a single-page
              group; used when getting a group.
              (WebCore::Page::removeAllVisitedLinks): Added. Calls removeVisitedLinks
              on all page groups.
              * page/Page.h: Moved enums inside the WebCore namespace. Removed the
              frameNamespace function and instead added the group and groupPtr functions.
      
              * page/PageGroup.cpp: Added. Contains all the visited code from the
              CSSStyleSelector in the isVisitedLink function, but more efficient because
              we don't allocate memory for the buffer.
              * page/PageGroup.h: Added.
      
              * platform/gtk/TemporaryLinkStubs.cpp: Removed historyContains.
              * platform/qt/TemporaryLinkStubs.cpp: Removed unneeded include.
              * platform/wx/TemporaryLinkStubs.cpp: Removed historyContains.
      
      WebKit:
      
              * WebKit.xcodeproj/project.pbxproj: Added WebHistoryInternal.h.
      
      WebKit/mac:
      
              Reviewed by Mitz.
      
              - fix http://bugs.webkit.org/show_bug.cgi?id=17526
                REGRESSION: iframes are added to Safari's History menu
                by separating the visited link machinery from global history
      
              * History/WebHistory.mm: Moved WebHistoryPrivate inside this file.
              (-[WebHistoryPrivate removeItemFromDateCaches:]): Removed the underscore from this
              method name, since it's on a private object.
              (-[WebHistoryPrivate removeItemForURLString:]): Added a call to the
              PageGroup::removeAllVisitedLinks function if the last URL was removed.
              (-[WebHistoryPrivate addItemToDateCaches:]): Removed the underscore from this
              method name, since it's on a private object.
              (-[WebHistoryPrivate removeAllItems]): Call PageGroup::removeAllVisitedLinks.
              (-[WebHistoryPrivate ageLimitDate]): Removed the underscore from this
              method name, since it's on a private object.
              (-[WebHistoryPrivate loadHistoryGutsFromURL:savedItemsCount:collectDiscardedItemsInto:error:]):
              Ditto.
              (-[WebHistoryPrivate saveHistoryGuts:URL:error:]): Ditto. Also changed this
              to correctly return the error by using the newer version of writeToURL: and
              removed the FIXME about that.
              (-[WebHistoryPrivate addVisitedLinksToPageGroup:]): Added. Calls addVisitedLink
              for every link in the history.
              (-[WebHistory saveToURL:error:]): Removed the FIXME, since we do get the error now.
              (-[WebHistory addItem:]): Moved into the WebPrivate category.
              (-[WebHistory addItemForURL:]): Ditto.
              (-[WebHistory _addItemForURL:title:]): Added. Used for the normal case where we
              create an item and already know its title.
              (-[WebHistory ageLimitDate]): Moved into the WebPrivate category.
              (-[WebHistory containsItemForURLString:]): Ditto.
              (-[WebHistory removeItem:]): Ditto.
              (-[WebHistory setLastVisitedTimeInterval:forItem:]): Ditto.
              (-[WebHistory _itemForURLString:]): Ditto.
              (-[WebHistory _addVisitedLinksToPageGroup:]): Added. For use only inside WebKit.
      
              * History/WebHistoryInternal.h: Added.
              * History/WebHistoryItemInternal.h: Tweaked formatting and includes.
              * History/WebHistoryPrivate.h: Moved the WebHistoryPrivate class out of this header.
              Also reorganized what was left behind.
      
              * WebCoreSupport/WebChromeClient.h: Added populateVisitedLinks.
              * WebCoreSupport/WebChromeClient.mm:
              (WebChromeClient::populateVisitedLinks): Added a call to the new
              -[WebHistory _addVisitedLinksToPageGroup:] method.
      
              * WebCoreSupport/WebFrameLoaderClient.mm:
              (WebFrameLoaderClient::updateGlobalHistory): Changed code to use the new
              -[WebHistory _addItemForURL:title:] method.
      
      WebKit/win:
      
              Reviewed by Mitz.
      
              - fix http://bugs.webkit.org/show_bug.cgi?id=17526
                REGRESSION: iframes are added to Safari's History menu
                by separating the visited link machinery from global history
      
              * WebCoreSupport/WebChromeClient.cpp:
              (WebChromeClient::populateVisitedLinks): Added a call to the new
              WebHistory::addVisitedLinksToPageGroup function.
              * WebCoreSupport/WebChromeClient.h: Added populateVisitedLinks.
              Also fixed the webView function to be non-virtual.
      
              * WebCoreSupport/WebFrameLoaderClient.cpp:
              (WebFrameLoaderClient::updateGlobalHistory): Changed to use the
              new WebHistory::addItem function.
              (WebFrameLoaderClient::webHistory): Changed to return a WebHistory*,
              there's no reason to AddRef the result from this function.
              * WebCoreSupport/WebFrameLoaderClient.h: Ditto.
      
              * WebHistory.cpp: Removed IWebHistoryPrivate and _WebCoreHistoryProvider.
              (WebHistory::QueryInterface): Removed IWebHistoryPrivate.
              (sharedHistoryStorage): Added.
              (WebHistory::sharedHistory): Added.
              (WebHistory::optionalSharedHistory): Changed to use sharedHistory().
              (WebHistory::setOptionalSharedHistory): Changed to require a WebHistory
              object, not just an IWebHistory.
              (WebHistory::removeAllItems): Call PageGroup::removeAllVisitedLinks.
              (WebHistory::addItem): Changed parameter types since this is called with
              arguments from WebCore -- at some point this could allow better efficiency.
              (WebHistory::removeItemForURLString):  Call PageGroup::removeAllVisitedLinks
              if the last URL is being removed.
              (addVisitedLinkToPageGroup): Added. Helper. Adds a single link to a group's
              visited link set.
              (WebHistory::addVisitedLinksToPageGroup): Added. Adds all links to a group's
              visited link.
              * WebHistory.h: Removed IWebHistoryPrivate. Removed optionalSharedHistoryInternal
              and added sharedHistory. Replaced addItemForURL and containsItemForURLString with
              non-virtual addItem and addVisitedLinksToPageGroup functions.
      
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@30840 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      2060803d