1. 26 Aug, 2013 26 commits
  2. 25 Aug, 2013 14 commits
    • akling@apple.com's avatar
      RenderLayerBacking::renderer() should return a reference. · 32c7a6ec
      akling@apple.com authored
      <https://webkit.org/b/120280>
      
      Reviewed by Anders Carlsson.
      
      It's just a forwarding call to RenderLayer::renderer() which already returns a reference.
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@154585 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      32c7a6ec
    • gyuyoung.kim@samsung.com's avatar
      Add toSVGMissingGlyphElement(), and use it. · 2fb8fcdd
      gyuyoung.kim@samsung.com authored
      https://bugs.webkit.org/show_bug.cgi?id=120197
      
      Reviewed by Andreas Kling.
      
      As a step to clean-up static_cast<SVGXXX>, toSVGMissingGlyphElement() is added to clean-up
      static_cast<SVGMissingGlyphElement*>.
      
      * svg/SVGFontElement.cpp:
      (WebCore::SVGFontElement::firstMissingGlyphElement):
      (WebCore::SVGFontElement::ensureGlyphCache):
      * svg/SVGMissingGlyphElement.h:
      (WebCore::toSVGMissingGlyphElement):
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@154584 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      2fb8fcdd
    • akling@apple.com's avatar
      RenderLayer::renderer() should return a reference. · c34ed27e
      akling@apple.com authored
      <https://webkit.org/b/120276>
      
      Reviewed by Anders Carlsson.
      
      RenderLayer is always created with a renderer, so make renderer() (and m_renderer) references.
      Nuked an assortment of useless null checks.
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@154583 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      c34ed27e
    • commit-queue@webkit.org's avatar
      Improve srcset's layout tests · cdf8eea8
      commit-queue@webkit.org authored
      https://bugs.webkit.org/show_bug.cgi?id=120274
      
      Moved srcset's tests to use js-test-pre, and output text with clear PASS/FAILED statements.
      Added expected.txt files to the test directory, since there shouldn't be any platform variance in the results.
      For some of the tests, added an equivalent 1x/2x test, to make sure the feature behaves on both DPRs.
      Added preload tests on the "change-dynamically" tests, to make sure the 'src' resource is not loaded when it shouldn't.
      
      Patch by Yoav Weiss <yoav@yoav.ws> on 2013-08-25
      Reviewed by Andreas Kling.
      
      * fast/hidpi/image-srcset-change-dynamically-from-js-1x-expected.txt: Added.
      * fast/hidpi/image-srcset-change-dynamically-from-js-1x.html: Added.
      * fast/hidpi/image-srcset-change-dynamically-from-js-2x-expected.txt: Added.
      * fast/hidpi/image-srcset-change-dynamically-from-js-2x.html: Added.
      * fast/hidpi/image-srcset-change-dynamically-from-js.html: Removed.
      * fast/hidpi/image-srcset-data-src-expected.txt: Added.
      * fast/hidpi/image-srcset-data-src.html:
      * fast/hidpi/image-srcset-data-srcset-expected.txt: Added.
      * fast/hidpi/image-srcset-data-srcset.html:
      * fast/hidpi/image-srcset-invalid-inputs-correct-src-expected.txt: Added.
      * fast/hidpi/image-srcset-invalid-inputs-correct-src.html:
      * fast/hidpi/image-srcset-invalid-inputs-except-one-expected.txt: Added.
      * fast/hidpi/image-srcset-invalid-inputs-except-one.html:
      * fast/hidpi/image-srcset-remove-dynamically-from-js-expected.txt: Added.
      * fast/hidpi/image-srcset-remove-dynamically-from-js.html:
      * fast/hidpi/image-srcset-same-alternative-for-both-attributes-expected.txt: Added.
      * fast/hidpi/image-srcset-same-alternative-for-both-attributes.html:
      * fast/hidpi/image-srcset-simple-1x-expected.txt: Added.
      * fast/hidpi/image-srcset-simple-1x.html: Added.
      * fast/hidpi/image-srcset-simple-2x-expected.txt: Added.
      * fast/hidpi/image-srcset-simple-2x.html: Added.
      * fast/hidpi/image-srcset-simple.html: Removed.
      * fast/hidpi/image-srcset-src-selection-1x-expected.txt: Added.
      * fast/hidpi/image-srcset-src-selection-1x.html: Added.
      * fast/hidpi/image-srcset-src-selection-2x-expected.txt: Added.
      * fast/hidpi/image-srcset-src-selection-2x.html: Added.
      * fast/hidpi/image-srcset-src-selection.html: Removed.
      * fast/hidpi/image-srcset-viewport-modifiers-expected.txt: Added.
      * fast/hidpi/image-srcset-viewport-modifiers.html:
      * platform/mac/fast/hidpi/image-srcset-change-dynamically-from-js-expected.txt: Removed.
      * platform/mac/fast/hidpi/image-srcset-data-src-expected.txt: Removed.
      * platform/mac/fast/hidpi/image-srcset-data-srcset-expected.txt: Removed.
      * platform/mac/fast/hidpi/image-srcset-invalid-inputs-correct-src-expected.txt: Removed.
      * platform/mac/fast/hidpi/image-srcset-invalid-inputs-except-one-expected.txt: Removed.
      * platform/mac/fast/hidpi/image-srcset-remove-dynamically-from-js-expected.txt: Removed.
      * platform/mac/fast/hidpi/image-srcset-same-alternative-for-both-attributes-expected.txt: Removed.
      * platform/mac/fast/hidpi/image-srcset-simple-expected.txt: Removed.
      * platform/mac/fast/hidpi/image-srcset-src-selection-expected.txt: Removed.
      * platform/mac/fast/hidpi/image-srcset-viewport-modifiers-expected.txt: Removed.
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@154582 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      cdf8eea8
    • antti@apple.com's avatar
      Element child and descendant iterators · b8a9576d
      antti@apple.com authored
      https://bugs.webkit.org/show_bug.cgi?id=120248
      
      Reviewed by Sam Weinig and Andreas Kling.
      
      Add iterators for Element children and descendants.
              
      To iterate over element children:
              
      #include "ChildIterator.h"
              
      for (auto it = elementChildren(this).begin(), end = elementChildren(this).end(); it != end; ++it) {
          Element& element = *it;
          ...
      
      for (auto it = childrenOfType<HTMLAreaElement>(this).begin(), end = childrenOfType<HTMLAreaElement>(this).end(); it != end; ++it) {
          HTMLAreaElement& area = *it;
          ...
      
      To iteratate over element descendants in pre-order:
              
      #include "DescendantIterator.h"
              
      for (auto it = elementDescendants(this).begin(), end = elementDescendants(this).end(); it != end; ++it) {
          Element& element = *it;
          ...
      
      for (auto it = descendantsOfType<HTMLAreaElement>(this).begin(), end = descendantsOfType<HTMLAreaElement>(this).end(); it != end; ++it) {
          HTMLAreaElement& area = *it;
          ...
                  
      The iterators assert against DOM mutations and event dispatch while iterating in debug builds.
                  
      They are compatible with C++11 range-based for loops. In the future we can use
              
      for (auto& element : elementChildren(this))
          ...
      
      etc.
              
      The patch all uses the new iterators in a few places.
      
      * WebCore.xcodeproj/project.pbxproj:
      * accessibility/AccessibilityNodeObject.cpp:
      (WebCore::AccessibilityNodeObject::canvasHasFallbackContent):
      (WebCore::siblingWithAriaRole):
      * accessibility/AccessibilityRenderObject.cpp:
      * accessibility/AccessibilityTable.cpp:
      (WebCore::AccessibilityTable::isDataTable):
      * dom/ChildIterator.h: Added.
      (WebCore::ChildIterator::operator*):
      (WebCore::ChildIterator::operator->):
      (WebCore::::ChildIterator):
      (WebCore::::operator):
      (WebCore::=):
      (WebCore::::ChildIteratorAdapter):
      (WebCore::::begin):
      (WebCore::::end):
      (WebCore::elementChildren):
      (WebCore::childrenOfType):
      * dom/DescendantIterator.h: Added.
      (WebCore::DescendantIterator::operator*):
      (WebCore::DescendantIterator::operator->):
      (WebCore::::DescendantIterator):
      (WebCore::::operator):
      (WebCore::=):
      (WebCore::::DescendantIteratorAdapter):
      (WebCore::::begin):
      (WebCore::::end):
      (WebCore::elementDescendants):
      (WebCore::descendantsOfType):
      * dom/Document.cpp:
      (WebCore::Document::buildAccessKeyMap):
      (WebCore::Document::childrenChanged):
      (WebCore::Document::attach):
      (WebCore::Document::detach):
      * editing/ApplyStyleCommand.cpp:
      (WebCore::ApplyStyleCommand::cleanupUnstyledAppleStyleSpans):
      * editing/markup.cpp:
      (WebCore::completeURLs):
      * html/HTMLMapElement.cpp:
      (WebCore::HTMLMapElement::mapMouseEvent):
      * html/HTMLMediaElement.cpp:
      (WebCore::HTMLMediaElement::selectMediaResource):
      (WebCore::HTMLMediaElement::textTrackModeChanged):
      
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@154581 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      b8a9576d
    • akling@apple.com's avatar
      RenderObject::document() should return a reference. · 836b22b4
      akling@apple.com authored
      <https://webkit.org/b/120272>
      
      Reviewed by Antti Koivisto.
      
      There's always a Document. We were allocated in someone's arena, after all.
      Various null checks and assertions neutralized.
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@154580 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      836b22b4
    • ddkilzer@apple.com's avatar
      BUILD FIX (r154578): Return Vector<String>() from Pasteboard::types() for iOS · c1cc0210
      ddkilzer@apple.com authored
      * platform/ios/PasteboardIOS.mm:
      (WebCore::Pasteboard::types): Return Vector<String>() instead of
      ListHashSet<String>() after r154578.
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@154579 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      c1cc0210
    • darin@apple.com's avatar
      Make JavaScript binding for Clipboard::types more normal · c566ba9b
      darin@apple.com authored
      https://bugs.webkit.org/show_bug.cgi?id=120271
      
      Reviewed by Anders Carlsson.
      
      * bindings/js/JSClipboardCustom.cpp:
      (WebCore::JSClipboard::types): Make a simple custom binding. Only needed because
      there is a special value, null, this can return.
      
      * dom/Clipboard.cpp:
      (WebCore::Clipboard::types): Return Vector<String> instead of ListHashSet<String>.
      * dom/Clipboard.h: Ditto.
      * platform/Pasteboard.h: Ditto.
      * platform/blackberry/PasteboardBlackBerry.cpp:
      (WebCore::Pasteboard::types): Ditto.
      * platform/efl/PasteboardEfl.cpp:
      (WebCore::Pasteboard::types): Ditto.
      * platform/gtk/PasteboardGtk.cpp:
      (WebCore::Pasteboard::types): Ditto.
      * platform/ios/PasteboardIOS.mm:
      (WebCore::Pasteboard::types): Ditto.
      * platform/mac/PasteboardMac.mm:
      (WebCore::Pasteboard::types): Ditto.
      * platform/qt/PasteboardQt.cpp:
      (WebCore::Pasteboard::types): Ditto.
      * platform/win/PasteboardWin.cpp:
      (WebCore::Pasteboard::types): Ditto.
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@154578 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      c566ba9b
    • ddkilzer@apple.com's avatar
      Unreviewed rollout of r154571. Broke internal iOS build. · 26e03870
      ddkilzer@apple.com authored
      Reopened: No need for clearTimers function in Frame
      https://bugs.webkit.org/show_bug.cgi?id=120265
      
      * history/CachedFrame.cpp:
      (WebCore::CachedFrame::CachedFrame):
      (WebCore::CachedFrame::destroy):
      * page/Frame.cpp:
      (WebCore::Frame::clearTimers):
      * page/Frame.h:
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@154577 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      26e03870
    • darin@apple.com's avatar
      No need for hasData in Clipboard · a7951621
      darin@apple.com authored
      https://bugs.webkit.org/show_bug.cgi?id=120269
      
      Reviewed by Andreas Kling.
      
      This simple forwarder does not belong in the Clipboard class.
      The drag code that uses it already works directly with Pasteboard.
      
      * dom/Clipboard.cpp: Removed hasData.
      * dom/Clipboard.h: Ditto.
      
      * page/DragController.cpp:
      (WebCore::DragController::startDrag): Call through the pasteboard.
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@154576 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      a7951621
    • darin@apple.com's avatar
      Source/WebCore: No need for documentTypeString function in Frame · 70055d62
      darin@apple.com authored
      https://bugs.webkit.org/show_bug.cgi?id=120262
      
      Reviewed by Andreas Kling.
      
      * WebCore.exp.in: Removed export of Frame::documentTypeString.
      
      * editing/markup.cpp:
      (WebCore::documentTypeString): Added. Replaces the old Frame member function.
      Makes more sense to have this here since it is both called by and calls code
      in this file; somehow this function was left behind.
      (WebCore::createFullMarkup): Changed to call the new function.
      * editing/markup.h: Added documentTypeString function. Has to be exported
      because LegacyWebArchive uses it; might be worth fixing that later.
      * loader/archive/cf/LegacyWebArchive.cpp:
      (WebCore::LegacyWebArchive::create): Changed to call the new function.
      (WebCore::LegacyWebArchive::createFromSelection): Ditto.
      
      * page/Frame.cpp: Removed Frame::documentTypeString.
      * page/Frame.h: Ditto.
      
      Source/WebKit/mac: Frame should not have a documentTypeString member function
      https://bugs.webkit.org/show_bug.cgi?id=120262
      
      Reviewed by Andreas Kling.
      
      * WebView/WebFrame.mm: Removed _stringWithDocumentTypeStringAndMarkupString:
      internal method, which was not used anywhere in WebKit. Internal methods are
      only for use within WebKit, as opposed to public and private methods that can
      be used outside.
      * WebView/WebFrameInternal.h: Ditto.
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@154575 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      70055d62
    • darin@apple.com's avatar
      Clipboard is in DOM directory, but ClipboardMac is in platform directory · 1bdb14d4
      darin@apple.com authored
      https://bugs.webkit.org/show_bug.cgi?id=120267
      
      Reviewed by Andreas Kling.
      
      This file is almost gone; has just one function in it. Move it for now, and later
      we can delete it entirely.
      
      * WebCore.xcodeproj/project.pbxproj: Updated for new file location.
      * dom/ClipboardMac.mm: Moved from Source/WebCore/platform/mac/ClipboardMac.mm.
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@154574 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      1bdb14d4
    • darin@apple.com's avatar
      No need for notifyChromeClientWheelEventHandlerCountChanged in Frame · 9f35bdd1
      darin@apple.com authored
      https://bugs.webkit.org/show_bug.cgi?id=120264
      
      Reviewed by Andreas Kling.
      
      * dom/Document.cpp:
      (WebCore::Document::createRenderTree): Renamed attach to this.
      This made it practical to remove a comment that says the same thing and
      also helps make the purpose of the function considerably more clear,
      although the relationship to the attached and detach functions is now
      less clear; should fix that soon.
      (WebCore::pageWheelEventHandlerCountChanged): Added. Contains the code
      from Frame::notifyChromeClientWheelEventHandlerCountChanged, minus some
      assertions that were only needed because the function was passed a frame
      rather than a page.
      (WebCore::Document::didBecomeCurrentDocumentInFrame): Added. Contains
      most of the code from Frame::setDocument. Looking at before and after,
      we can see that most of the work is within the document class and matches
      up with other code already in this class. Added FIXMEs about many problems
      spotted in the code.
      (WebCore::Document::topDocument): Added FIXME and tweaked formatting.
      (WebCore::wheelEventHandlerCountChanged): Moved the call to the
      pageWheelEventHandlerCountChanged in here from the two call sites.
      Also added a FIXME.
      (WebCore::Document::didAddWheelEventHandler): Removed the call to
      notifyChromeClientWheelEventHandlerCountChanged, since that's now handled
      inside wheelEventHandlerCountChanged.
      (WebCore::Document::didRemoveWheelEventHandler): Ditto.
      
      * dom/Document.h: Renamed attach to createRenderTree, made it private,
      and added a new didBecomeCurrentDocumentInFrame function.
      
      * loader/PlaceholderDocument.cpp:
      (WebCore::PlaceholderDocument::createRenderTree): Renamed from attach.
      * loader/PlaceholderDocument.h: Did the rename and made the function a
      private override.
      
      * page/Frame.cpp:
      (WebCore::Frame::setDocument): Moved most of this function out of here
      into the new Document::didBecomeCurrentDocumentInFrame function.
      Also deleted notifyChromeClientWheelEventHandlerCountChanged.
      
      * page/Frame.h: Deleted notifyChromeClientWheelEventHandlerCountChanged.
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@154573 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      9f35bdd1
    • darin@apple.com's avatar
      No need for dispatchVisibilityStateChangeEvent function · f6fdedba
      darin@apple.com authored
      https://bugs.webkit.org/show_bug.cgi?id=120261
      
      Reviewed by Andreas Kling.
      
      * dom/Document.cpp: Removed dispatchVisibilityStateChangeEvent.
      * dom/Document.h: Ditto.
      * page/Frame.cpp: Ditto.
      * page/Frame.h: Ditto.
      
      * page/Page.cpp:
      (WebCore::Page::setVisibilityState): Put all the logic for dispatching the
      visibility state change event. Nothing here requires any special information
      about the internals of Frame or Document.
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@154572 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      f6fdedba