Timeline
Sep 15, 2014:
- 11:53 PM Changeset in webkit [173651] by
-
- 3 edits2 adds in trunk/Source/WebCore
[GTK] Add WaylandDisplay
https://bugs.webkit.org/show_bug.cgi?id=136216
Reviewed by Martin Robinson.
Add the WaylandDisplay class. This class is used in the LayerTreeHostGtk,
in the WebProcess, and controls the connection to the nested Wayland
compositor in the UIProcess. Only one instance of the class is used in the
WebProcess, accessible via the static WaylandDisplay::instance() method.
The WaylandDisplay constructor performs the EGL initialization while also
querying the Wayland register, resulting in initializing client-side objects
that can interact with the wl_compositor and wl_webkitgtk interfaces
implemented in the nested Wayland compositor. The single class instance is
only deemed properly initialized if it picked up the Wayland interface objects
and has properly acquired the EGL display and config.
WaylandDisplay::createSurface() is called by the LayerTreeHostGtk during
its own initialization. The method creates a new wl_surface object via the
wl_compositor interface and a new wl_egl_window object that's based on that
surface. For the wl_egl_window object, we fall back to a width or height of 1
in case the passed-in value for either is 0. This avoids problems in Mesa
where widths or heights of 0 are not supported.
We associate the created surface with the passed-in widget ID, as provided
by LayerTreeHostGtk, via the wl_webkitgtk interface. This enables proper
mapping of Wayland surfaces and the GtkWidgets in the UIProcess and makes
it possible for the nested Wayland compositor to correctly determine which
GtkWidget has to be redrawn after some surface has been committed.
WaylandDisplay::createSharingGLContext() creates a new GLContextEGL object
that's to be used as a sharing context. The method creates a new surface
via the wl_compositor interface and uses it to create a dummy native EGL
window that's 1x1px in size. The GLContextEGL object is then created
through the static GLContextEGL::createWindowContext() method.
- PlatformGTK.cmake:
- platform/graphics/wayland/WaylandDisplay.cpp: Added.
(WebCore::WaylandDisplay::globalCallback):
(WebCore::WaylandDisplay::globalRemoveCallback):
(WebCore::WaylandDisplay::instance):
(WebCore::WaylandDisplay::WaylandDisplay):
(WebCore::WaylandDisplay::createSurface):
(WebCore::WaylandDisplay::createSharingGLContext):
- platform/graphics/wayland/WaylandDisplay.h: Added.
(WebCore::WaylandDisplay::nativeDisplay):
(WebCore::WaylandDisplay::eglDisplay):
- platform/graphics/wayland/WaylandSurface.cpp:
(WebCore::WaylandSurface::~WaylandSurface): Assert that the WaylandDisplay
instance is present before going on to destroy the surface resources.
- 11:26 PM Changeset in webkit [173650] by
-
- 5 edits in branches/safari-600.1.4.11-branch/Source
Versioning.
- 10:36 PM Changeset in webkit [173649] by
-
- 15 edits in trunk/Source/WebCore
Rename LiveNodeLists / HTMLCollections's nodeMatches() to elementMatches()
https://bugs.webkit.org/show_bug.cgi?id=136844
Reviewed by Sam Weinig.
Rename LiveNodeLists / HTMLCollections's nodeMatches() to elementMatches()
for clarity as the argument is an Element.
No new tests, no behavior change.
- dom/ClassNodeList.h:
(WebCore::ClassNodeList::elementMatches):
(WebCore::ClassNodeList::nodeMatches): Deleted.
- dom/DocumentOrderedMap.cpp:
(WebCore::keyMatchesWindowNamedItem):
(WebCore::keyMatchesDocumentNamedItem):
- dom/Element.cpp:
(WebCore::Element::updateNameForDocument):
(WebCore::Element::updateIdForDocument):
- dom/LiveNodeList.cpp:
(WebCore::LiveNodeList::namedItem):
- dom/LiveNodeList.h:
(WebCore::CachedLiveNodeList<NodeListType>::collectionBegin):
(WebCore::CachedLiveNodeList<NodeListType>::collectionLast):
(WebCore::CachedLiveNodeList<NodeListType>::collectionTraverseForward):
(WebCore::CachedLiveNodeList<NodeListType>::collectionTraverseBackward):
- dom/NameNodeList.h:
(WebCore::NameNodeList::elementMatches):
(WebCore::NameNodeList::nodeMatches): Deleted.
- dom/TagNodeList.h:
(WebCore::TagNodeList::elementMatches):
(WebCore::HTMLTagNodeList::elementMatches):
(WebCore::TagNodeList::nodeMatches): Deleted.
(WebCore::HTMLTagNodeList::nodeMatches): Deleted.
- html/HTMLCollection.cpp:
(WebCore::isMatchingElement):
- html/HTMLNameCollection.cpp:
(WebCore::WindowNameCollection::elementMatchesIfNameAttributeMatch):
(WebCore::WindowNameCollection::elementMatches):
(WebCore::DocumentNameCollection::elementMatchesIfIdAttributeMatch):
(WebCore::DocumentNameCollection::elementMatchesIfNameAttributeMatch):
(WebCore::DocumentNameCollection::elementMatches):
(WebCore::WindowNameCollection::nodeMatchesIfNameAttributeMatch): Deleted.
(WebCore::WindowNameCollection::nodeMatches): Deleted.
(WebCore::DocumentNameCollection::nodeMatchesIfIdAttributeMatch): Deleted.
(WebCore::DocumentNameCollection::nodeMatchesIfNameAttributeMatch): Deleted.
(WebCore::DocumentNameCollection::nodeMatches): Deleted.
- html/HTMLNameCollection.h:
- html/LabelsNodeList.cpp:
(WebCore::LabelsNodeList::elementMatches):
(WebCore::LabelsNodeList::nodeMatches): Deleted.
- html/LabelsNodeList.h:
- html/RadioNodeList.cpp:
(WebCore::RadioNodeList::elementMatches):
(WebCore::RadioNodeList::nodeMatches): Deleted.
- html/RadioNodeList.h:
- 9:09 PM Changeset in webkit [173648] by
-
- 8 edits2 adds in trunk
Use an AtomicString as key for caching ClassNodeList objects
https://bugs.webkit.org/show_bug.cgi?id=136830
Reviewed by Benjamin Poulain.
Use an AtomicString as key for caching ClassNodeList objects instead of
a String. ClassNodeList is the only type using a String instead of an
AtomicString as key in the cache HashTable. This brings some
complexity.
I believe this was done to avoid unnecessarily atomizing the String,
for performance reasons. However, at the moment, the String gets
atomized anyway when constructing the ClassNodeList object. This is
because the ClassNodeList::m_classNames member is of SpaceSplitString
type and the SpaceSplitString constructor takes an AtomicString in
argument.
Using an AtomicString to cache ClassNodeLists simplifies the code quite
a bit and decreases the size of NodeListsNodeData as well.
Test: fast/dom/getElementsByClassName/conflict-tag-name.html
- WebCore.order:
Remove symbol corresponding to addCacheWithName() as it was removed.
- dom/ClassNodeList.cpp:
(WebCore::ClassNodeList::~ClassNodeList):
Update the constructor to take an AtomicString in argument instead of
a String, for clarity. The String gets atomized when initializing
m_classNames anyway.
(WebCore::ClassNodeList::ClassNodeList):
Call removeCacheWithAtomicName() instead of removeCacheWithName() now
that m_originalClassNames is an AtomicString.
- dom/ClassNodeList.h:
Use AtomicString instead of String type for classNames, in both the
constructor argument and the m_originalClassNames data member.
- dom/ContainerNode.cpp:
(WebCore::ContainerNode::getElementsByClassName):
Call addCacheWithAtomicName() instead of addCacheWithName() now that
addCacheWithName() has been removed.
- dom/Node.cpp:
(WebCore::NodeListsNodeData::invalidateCaches):
Stop invalidating m_nameCaches as this HashMap no longer exists.
- dom/NodeRareData.h:
(WebCore::NodeListsNodeData::NodeListCacheMapEntryHash::hash):
(WebCore::NodeListsNodeData::NodeListCacheMapEntryHash::equal):
(WebCore::NodeListsNodeData::isEmpty):
(WebCore::NodeListsNodeData::adoptDocument):
(WebCore::NodeListsNodeData::namedNodeListKey):
(WebCore::NodeListsNodeData::deleteThisAndUpdateNodeRareDataIfAboutToRemoveLastList):
(WebCore::NodeListsNodeData::addCacheWithName): Deleted.
(WebCore::NodeListsNodeData::removeCacheWithName): Deleted.
- Drop addCacheWithName() / removeCacheWithName() now that no NodeList uses a String as HashMap key.
- Drop m_nameCaches now that ClassNodeLists are cached in m_atomicNameCaches instead.
- Remove StringType template parameter and hardcode AtomicString instead.
- 8:50 PM Changeset in webkit [173647] by
-
- 2 edits in trunk/Tools
Remove ORWT related crufts from webkitdirs.pm
https://bugs.webkit.org/show_bug.cgi?id=136821
Patch by Tibor Meszaros <tmeszaros.u-szeged@partner.samsung.com> on 2014-09-15
Reviewed by Alexey Proskuryakov.
- Scripts/webkitdirs.pm:
(isPerianInstalled): Deleted.
(determineIPhoneSimulatorVersion): Deleted.
(iPhoneSimulatorVersion): Deleted.
(isSnowLeopard): Deleted.
(isLion): Deleted.
(quitIOSSimulator): Deleted.
- 7:30 PM Changeset in webkit [173646] by
-
- 2 edits in trunk/Source/WebCore
Return early in SelectorChecker::checkOne() if selector.isAttributeSelector() is true
https://bugs.webkit.org/show_bug.cgi?id=136838
Reviewed by Benjamin Poulain.
Return early in SelectorChecker::checkOne() if selector.isAttributeSelector()
is true and the selector matched. Previously, we were only returning early if
the selector did not match and we were falling through if it did. This means
that we ended up doing the 2 if() checks below in the method unnecessarily:
- selector.m_match == CSSSelector::PseudoClass
- selector.m_match == CSSSelector::PseudoElement
No new tests, no behavior change.
- css/SelectorChecker.cpp:
(WebCore::SelectorChecker::checkOne):
- 7:24 PM Changeset in webkit [173645] by
-
- 7 edits1 copy in trunk/Source/bmalloc
bmalloc: allocate small and medium objects using the same bump pointer class
https://bugs.webkit.org/show_bug.cgi?id=136843
Reviewed by Gavin Barraclough.
4% speedup on MallocBench.
Now that medium-sized objects have dedicated per-size allocators, they
don't need to use an arbitrary bump pointer allocator. This means that
every allocator knows how many objects it will allocate from the start,
and we don't need a post-processing step to adjust refcounts based on
real allocation count.
- bmalloc.xcodeproj/project.pbxproj: Renamed SmallAllocator to BumpAllocator
since it's used for small and medium objects now.
- bmalloc/Allocator.cpp:
(bmalloc::Allocator::Allocator): Updated to use new interface.
(bmalloc::Allocator::scavenge): To "retire" an allocator, we just need
to make sure that we finish allocating all the objects in it.
(bmalloc::Allocator::allocateMedium):
(bmalloc::Allocator::allocateSlowCase):
(bmalloc::Allocator::retire): Deleted.
(bmalloc::Allocator::processSmallAllocatorLog): Deleted.
(bmalloc::Allocator::processMediumAllocatorLog): Deleted.
- bmalloc/Allocator.h:
(bmalloc::Allocator::allocateFastCase): Removed abstractions and data
used to post-process an allocator based on how many objects it allocated.
- bmalloc/BumpAllocator.h: Copied from Source/bmalloc/bmalloc/SmallAllocator.h.
(bmalloc::BumpAllocator::BumpAllocator):
(bmalloc::BumpAllocator::init):
(bmalloc::BumpAllocator::line):
(bmalloc::BumpAllocator::validate):
(bmalloc::BumpAllocator::allocate):
(bmalloc::BumpAllocator::refill):
(bmalloc::BumpAllocator::clear): Updated these functions to be agnostic
about the kinds of lines they allocate into. In some cases, the line
type must be provided as a template parameter by the caller.
(bmalloc::SmallAllocator::SmallAllocator): Deleted.
(bmalloc::SmallAllocator::line): Deleted.
(bmalloc::SmallAllocator::allocate): Deleted.
(bmalloc::SmallAllocator::objectCount): Deleted.
(bmalloc::SmallAllocator::derefCount): Deleted.
(bmalloc::SmallAllocator::refill): Deleted.
(bmalloc::SmallAllocator::clear): Deleted.
- bmalloc/ObjectType.h:
(bmalloc::isMedium):
- bmalloc/SmallAllocator.h:
(bmalloc::SmallAllocator::isNull): Deleted.
(bmalloc::SmallAllocator::canAllocate): Deleted.
(bmalloc::SmallAllocator::SmallAllocator): Deleted.
(bmalloc::SmallAllocator::line): Deleted.
(bmalloc::SmallAllocator::allocate): Deleted.
(bmalloc::SmallAllocator::objectCount): Deleted.
(bmalloc::SmallAllocator::derefCount): Deleted.
(bmalloc::SmallAllocator::refill): Deleted.
(bmalloc::SmallAllocator::clear): Deleted.
- 6:22 PM Changeset in webkit [173644] by
-
- 1 edit1 delete in trunk/LayoutTests
Unreviewed Windows gardening. fast/forms/label test expectations now match Mac platform's expectations.
- platform/win/fast/forms/label: Removed.
- platform/win/fast/forms/label/labelable-elements-expected.txt: Removed.
- platform/win/fast/forms/label/labels-add-htmlFor-label-expected.txt: Removed.
- platform/win/fast/forms/label/labels-add-parent-label-expected.txt: Removed.
- platform/win/fast/forms/label/labels-change-htmlFor-attribute-expected.txt: Removed.
- platform/win/fast/forms/label/labels-multiple-sibling-labels-expected.txt: Removed.
- platform/win/fast/forms/label/labels-parent-and-sibling-labels-expected.txt: Removed.
- platform/win/fast/forms/label/labels-remove-htmlFor-attribute-expected.txt: Removed.
- platform/win/fast/forms/label/labels-remove-htmlFor-label-expected.txt: Removed.
- platform/win/fast/forms/label/labels-remove-parent-label-expected.txt: Removed.
- platform/win/fast/forms/label/labels-set-htmlFor-attribute-expected.txt: Removed.
- 6:15 PM Changeset in webkit [173643] by
-
- 3 edits in trunk/Source/WebCore
Un-inline the Node constructor
https://bugs.webkit.org/show_bug.cgi?id=136842
Reviewed by Benjamin Poulain.
Un-inline the Node constructor as it does not seem to impact
performance, based on my testing:
http://dromaeo.com/?id=226992,226998
This reduces the stripped binary size by ~4Kb.
No new tests, no behavior change.
- dom/Document.h:
(WebCore::Node::Node): Deleted.
- dom/Node.cpp:
(WebCore::Node::Node):
- 5:45 PM Changeset in webkit [173642] by
-
- 3 edits2 adds in trunk
Web Core: Websocket state should be set to closed in didReceiveMessage call back.
https://bugs.webkit.org/show_bug.cgi?id=136219
Patch by Shivakumar JM <shiva.jm@samsung.com> on 2014-09-15
Reviewed by Alexey Proskuryakov.
Source/WebCore:
Set the Websocket state to closed in didReceiveMessage call back.
Test: http/tests/websocket/tests/hybi/error-event-ready-state.html
- Modules/websockets/WebSocket.cpp:
(WebCore::WebSocket::didReceiveMessageError):
LayoutTests:
Added test to check readyState is CLOSED within onerror event.
- http/tests/websocket/tests/hybi/error-event-ready-state-expected.txt: Added.
- http/tests/websocket/tests/hybi/error-event-ready-state.html: Added.
- 5:44 PM Changeset in webkit [173641] by
-
- 11 edits in trunk/LayoutTests
Unreviewed. Windows rebaselining to account for subpixel layout Part 1.
- platform/win/editing/selection/move-left-right-expected.txt:
- platform/win/editing/selection/vertical-lr-ltr-extend-line-backward-br-expected.txt:
- platform/win/editing/selection/vertical-lr-ltr-extend-line-forward-br-expected.txt:
- platform/win/editing/selection/vertical-rl-ltr-extend-line-backward-br-expected.txt:
- platform/win/editing/selection/vertical-rl-ltr-extend-line-backward-p-expected.txt:
- platform/win/editing/selection/vertical-rl-ltr-extend-line-forward-br-expected.txt:
- platform/win/editing/selection/vertical-rl-ltr-extend-line-forward-p-expected.txt:
- platform/win/editing/selection/vertical-rl-rtl-extend-line-backward-p-expected.txt:
- platform/win/editing/selection/vertical-rl-rtl-extend-line-forward-br-expected.txt:
- platform/win/editing/selection/vertical-rl-rtl-extend-line-forward-p-expected.txt:
- 5:41 PM Changeset in webkit [173640] by
-
- 2 edits in trunk/Source/WebInspectorUI
Web Inspector: mouse drifts away from resizer when resizing docked inspector
https://bugs.webkit.org/show_bug.cgi?id=22263
Patch by Matt Baker <Matt Baker> on 2014-09-15
Reviewed by Joseph Pecoraro.
Modified the docked resizer dragging logic to record the initial mouse down position relative to the
resizer client rectangle. Added check while dragging the resizer to ensure that the cursor is positioned
correctly with respect to the resize direction before updating the attached window dimension.
- UserInterface/Base/Main.js:
(WebInspector._dockedResizerMouseDown.dockedResizerDrag):
- 4:47 PM Changeset in webkit [173639] by
-
- 1 copy in tags/Safari-600.1.4.11.7
New tag.
- 4:15 PM Changeset in webkit [173638] by
-
- 3 edits in trunk/Source/WebCore
Naming clean-up.
Rubber-stamped by Andy Estes.
- html/HTMLFormElement.cpp:
(WebCore::HTMLFormElement::requestAutocomplete):
(WebCore::HTMLFormElement::finishRequestAutocomplete):
Remove superfluous "AutocompleteResult".
- html/HTMLFormElement.h:
Ditto.
- 4:13 PM Changeset in webkit [173637] by
-
- 2 edits in trunk/Tools
Unreviewed. Skip yet another ecma/Date test that fails only on Windows.
https://bugs.webkit.org/show_bug.cgi?id=25160
- Scripts/run-javascriptcore-tests:
- 3:58 PM Changeset in webkit [173636] by
-
- 3 edits in trunk/Source/JavaScriptCore
Create a JSCallee for GlobalExec object
https://bugs.webkit.org/show_bug.cgi?id=136840
Reviewed by Geoffrey Garen.
Added m_globalCallee, initialized it and then used it to set the globalExec's callee.
- runtime/JSGlobalObject.cpp:
(JSC::JSGlobalObject::init):
(JSC::JSGlobalObject::visitChildren):
- runtime/JSGlobalObject.h:
- 3:52 PM Changeset in webkit [173635] by
-
- 2 edits in trunk/Source/WebCore
Crash when logging in to optionshouse.com
https://bugs.webkit.org/show_bug.cgi?id=136834
Reviewed by Anders Carlsson.
No test, because I couldn't make one. I don't have a way to reproduce first-hand.
- platform/network/cf/SocketStreamHandleCFNet.cpp:
(WebCore::SocketStreamHandle::readStreamCallback):
(WebCore::SocketStreamHandle::writeStreamCallback):
- 3:47 PM Changeset in webkit [173634] by
-
- 4 edits in trunk/Source/WebCore
Unreviewed build fix for 32-bit builds.
Make casts from unsigned long long -> size_t explicit, rather than implicit. Also
make CARingBuffer be protected by USING_MEDIA_TOOLBOX so ports without that flag
won't try to compile unused code.
- platform/audio/mac/CARingBuffer.cpp:
(WebCore::CARingBuffer::fetch):
- platform/audio/mac/CARingBuffer.h:
- platform/graphics/avfoundation/AudioSourceProviderAVFObjC.mm:
(WebCore::AudioSourceProviderAVFObjC::provideInput):
- 3:03 PM Changeset in webkit [173633] by
-
- 2 edits in trunk/LayoutTests
Unreviewed. Skip initial-letter tests on Windows.
https://bugs.webkit.org/show_bug.cgi?id=136841
- platform/win/TestExpectations:
- 2:52 PM Changeset in webkit [173632] by
-
- 2 edits in trunk/Source/WebCore
Unreviewed logic fix from r173631. Logic for includeShadowDOM was reversed.
- page/DragController.cpp:
(WebCore::DragController::startDrag):
- 2:47 PM Changeset in webkit [173631] by
-
- 4 edits in trunk/Source/WebCore
Videos with controls enabled never receive 'dragstart' events.
https://bugs.webkit.org/show_bug.cgi?id=136837
Reviewed by Simon Fraser.
When initiating a drag, the DragController checks whether the hit-tested element at a
drag location is a child of the drag source, and bails if early if that is not the case.
For a <video> element with controls, the hit-tested element is an element within the
<video> element's Shadow DOM. Because the DragController uses a method which does not
take Shadow DOM into account when determining a child-parent relationship, this test fails
and all drag operations fail as well.
For <video> elements only, when testing whether the drag source is an ancestor of the
hit-tested element, use containsIncludingShadowDOM() instead of contains(). To ensure that
the controls are still usable when a drag listener is active on a <video> element, mark
the controls as a draggable element, but simply call preventDefault() in the controls'
'dragstart' handler, ensuring the timeline and volume controls are themselves still draggable.
- Modules/mediacontrols/mediaControlsApple.css:
(audio::-webkit-media-controls-panel):
- Modules/mediacontrols/mediaControlsApple.js:
(Controller.prototype.createControls):
(Controller.prototype.handlePanelDragStart):
- page/DragController.cpp:
(WebCore::DragController::startDrag):
- 2:40 PM Changeset in webkit [173630] by
-
- 2 edits in trunk/Source/WebCore
Unreviewed. Add an unimplemented case to handle CSSPropertyWebkitInitialLetter so we don't get an assertion failure.
- css/SVGCSSStyleSelector.cpp:
(WebCore::StyleResolver::applySVGProperty):
- 1:17 PM Changeset in webkit [173629] by
-
- 13 edits in trunk/LayoutTests
Change all snapshotting tests to use quicktime.
- platform/mac-wk2/TestExpectations:
- platform/mac-wk2/plugins/snapshotting/autoplay-similar-to-dominant-expected.txt:
- plugins/snapshotting/autoplay-dominant-blank-plugin-moved-into-view.html:
- plugins/snapshotting/autoplay-dominant.html:
- plugins/snapshotting/autoplay-plugin-blocked-by-image.html:
- plugins/snapshotting/autoplay-plugin-mostly-blocked-by-image.html:
- plugins/snapshotting/autoplay-similar-to-dominant.html:
- plugins/snapshotting/plugin-receives-click-event.html:
- plugins/snapshotting/restart.html:
- plugins/snapshotting/set-plugin-size-to-tiny.html:
- plugins/snapshotting/simple.html:
- plugins/snapshotting/snapshot-plugin-not-quite-blocked-by-image.html:
- 1:05 PM Changeset in webkit [173628] by
-
- 7 edits4 adds in trunk/Source
[Mac] Support audioSourceProvider() in MediaPlayerPrivateAVFoundationObjC
https://bugs.webkit.org/show_bug.cgi?id=135042
Reviewed by Eric Carlson.
Source/WebCore:
Add support for AudioSourceProvider in MediaPlayerPrivateAVFoundationObjC, thereby
supporting MediaElementAudioSourceNode.
Import the CARingBuffer from CoreAudio sample code, making the necessary modifications
for WebKit style and coding conventions. The threading assumptions for this class are
that there will be a single writer thread and a single reader thread.
- platform/audio/mac/CARingBuffer.cpp: Added.
(WebCore::CARingBuffer::create): Create a unique_ptr.
(WebCore::CARingBuffer::CARingBuffer): Simple constructor.
(WebCore::CARingBuffer::~CARingBuffer): Simple destructor.
(WebCore::CARingBuffer::allocate): Initialize the buffers and time bounds structures.
(WebCore::CARingBuffer::deallocate): Destroy same.
(WebCore::ZeroRange): Static utility method.
(WebCore::StoreABL): Ditto.
(WebCore::FetchABL): Ditto.
(WebCore::ZeroABL): Ditto.
(WebCore::CARingBuffer::store): Store the passed in buffer in the ring buffer, wrapping
if necessary.
(WebCore::CARingBuffer::setTimeBounds): Set the new time bounds by incrementing the
bounds index locally, filling in the new values, then atomically incrementing the
reader-visible index.
(WebCore::CARingBuffer::getTimeBounds): Get the new time bounds by masking the time
bounds index, and using it as an offset to the time bounds array. Protect against
CPU starvation on the reading thread by checking the index against the stored
index in the array entry. This check will fail if the writing thread has wrapped
more than the size of the array.
(WebCore::CARingBuffer::clipTimeBounds): Clamp the passed values to the available bounds.
(WebCore::CARingBuffer::startFrame): Simple accessor.
(WebCore::CARingBuffer::endFrame): Ditto.
(WebCore::CARingBuffer::fetch): Read an audio buffer list from the ring buffer, possbily
wrapping around to the start of the ring buffer.
- platform/audio/mac/CARingBuffer.h: Added.
(WebCore::CARingBuffer::numberOfChannels): Simple accessor.
(WebCore::CARingBuffer::frameOffset): Ditto.
(WebCore::CARingBuffer::TimeBounds::TimeBounds): Struct holding the start and end frame values.
Add an implementation of AudioSourceProvider, using AVAudioMix and MTAudioProcessingTap
to tap an AVPlayerItem's audio output and feed it to a MediaElementAudioSourceNode.
- platform/graphics/avfoundation/AudioSourceProviderAVFObjC.h: Added.
- platform/graphics/avfoundation/AudioSourceProviderAVFObjC.mm: Added.
(WebCore::AudioSourceProviderAVFObjC::create): Simple factory.
(WebCore::AudioSourceProviderAVFObjC::AudioSourceProviderAVFObjC): Simple constructor.
(WebCore::AudioSourceProviderAVFObjC::~AudioSourceProviderAVFObjC): Simple destructor.
(WebCore::AudioSourceProviderAVFObjC::provideInput): Push audio into the ring buffer.
(WebCore::AudioSourceProviderAVFObjC::setClient): Call destroyMix()/createMix() as appropriate.
(WebCore::AudioSourceProviderAVFObjC::setPlayerItem): Ditto.
(WebCore::AudioSourceProviderAVFObjC::destroyMix): Detach and destroy the AVAudioMix and tap.
(WebCore::AudioSourceProviderAVFObjC::createMix): Set up the AVAudioMix and tap and attach to
the AVPlayerItem.
(WebCore::AudioSourceProviderAVFObjC::initCallback): Pass to class method.
(WebCore::AudioSourceProviderAVFObjC::finalizeCallback): Ditto.
(WebCore::AudioSourceProviderAVFObjC::prepareCallback): Ditto.
(WebCore::AudioSourceProviderAVFObjC::unprepareCallback): Ditto.
(WebCore::AudioSourceProviderAVFObjC::processCallback): Ditto.
(WebCore::AudioSourceProviderAVFObjC::init): Set up the storage pointer for the tap.
(WebCore::AudioSourceProviderAVFObjC::finalize): No-op.
(WebCore::operator==): Compare two AudioStreamBasicDescription objects.
(WebCore::operator!=): Ditto.
(WebCore::AudioSourceProviderAVFObjC::prepare): Create an AudioCoverter object if necessary,
create the ring buffer, and notify the client of format changes.
(WebCore::AudioSourceProviderAVFObjC::unprepare): Destroy same.
(WebCore::AudioSourceProviderAVFObjC::process): Copy samples out of the ring buffer,
format converting them if necessary. Mute original audio.
Create the AudioSourceProviderAVFObjC object and notify it when the current AVPlayerItem changes.
- platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.h:
- platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
(WebCore::MediaPlayerPrivateAVFoundationObjC::cancelLoad):
(WebCore::MediaPlayerPrivateAVFoundationObjC::createAVPlayerItem):
(WebCore::MediaPlayerPrivateAVFoundationObjC::audioSourceProvider):
Enable SOFT_LINK_MAY_FAIL on the Mac platform.
- platform/mac/SoftLinking.h:
Add new files to the project.
- WebCore.xcodeproj/project.pbxproj:
Source/WTF:
- wtf/Platform.h: Add WTF_USE_MEDIATOOLBOX.
- 12:50 PM Changeset in webkit [173627] by
-
- 2 edits in trunk/Tools
Add another Apple build slave to the Mountain Lion Debug WK1 queue
Rubber stamped by Matt Hanson.
- BuildSlaveSupport/build.webkit.org-config/config.json:
- 12:32 PM Changeset in webkit [173626] by
-
- 4 edits in trunk/Source/JavaScriptCore
DFG ref count calculation should be reusable
https://bugs.webkit.org/show_bug.cgi?id=136811
Reviewed by Oliver Hunt.
Henceforth if you call Graph::computeRefCounts(), a nifty O(n) operation, every Node
will be able to tell you how many places it is used from. Currently only DCE uses this,
but it will be useful for https://bugs.webkit.org/show_bug.cgi?id=136330.
- dfg/DFGDCEPhase.cpp:
(JSC::DFG::DCEPhase::run):
(JSC::DFG::DCEPhase::findTypeCheckRoot): Deleted.
(JSC::DFG::DCEPhase::countNode): Deleted.
(JSC::DFG::DCEPhase::countEdge): Deleted.
- dfg/DFGGraph.cpp:
(JSC::DFG::Graph::computeRefCounts):
- dfg/DFGGraph.h:
- 11:45 AM Changeset in webkit [173625] by
-
- 4 edits in branches/safari-600.1.4.11-branch/Source/WebKit2
Merged r173623. <rdar://problem/17897780>
- 11:40 AM Changeset in webkit [173624] by
-
- 8 edits in branches/safari-600.1.4.11-branch/Source
Merge patch for <rdar://problem/18327341>.
- 10:10 AM Changeset in webkit [173623] by
-
- 4 edits in trunk/Source/WebKit2
Should call [BKSProcessAssertion invalidate]
https://bugs.webkit.org/show_bug.cgi?id=136804
<rdar://problem/17897780>
Reviewed by Darin Adler.
We should invalidate the process assertion before releasing it. Fortunately this is really easy,
since there is a simple 1:1 relationship with ProcessAssertion, with their lifetimes matching exactly.
- UIProcess/ProcessAssertion.cpp:
(WebKit::ProcessAssertion::~ProcessAssertion):
- no-op implementation.
- UIProcess/ProcessAssertion.h:
- added destructor.
- UIProcess/ios/ProcessAssertionIOS.mm:
(WebKit::ProcessAssertion::~ProcessAssertion):
- destructor invalidates the BKSProcessAssertion.
- 8:59 AM Changeset in webkit [173622] by
-
- 14 edits in trunk/Source/WebCore
Avoid redundant isElementNode() checks in Traversal<HTML*Element> / Traversal<SVG*Element>
https://bugs.webkit.org/show_bug.cgi?id=136719
Reviewed by Darin Adler.
Avoid redundant isElementNode() checks in Traversal<HTML*Element> /
Traversal<SVG*Element>. We used to iterate through Elements, and then
call isElementOfType<HTML*Element>() on each Element. This made sense
because hasTagName() used to be defined on Element. However, after
http://trac.webkit.org/changeset/165699, hasTagName() is now defined on
Node for HTMLQualifiedName / SVGQualifiedName arguments.
Node::hasTagName(HTMLQualifiedName) basically does the following check
"isHTMLElement() && toHTMLElement(*this).hasTagName(tagName)". As a
consequence, doing an isElementNode() check is now redundant as
isHTMLElement() is defined on Node.
This patch adds a template parameter to isElementOfType() so that it can
take any type in argument (particulaly Node, Element, HTMLElement,
SVGElement, MathMLElement), not just an Element. I had to add an
ElementTypeCastTraits struct to support partial specialization as C++
does not support partial specialization of template functions.
This patch also updates Traversal<ElementType> so that the methods use
NodeTraversal internally instead of Traversal<ElementType>. As a result,
we now iterate over Nodes (not Elements) and call the new
isElementOfType<ElementType>(Node) helpers (which are efficient after
r165699).
Before the patch, the code ended up doing the following checks for
Traversal<HTML*element>:
node.isElementNode() && toElement(node).isHTMLElement()
&& toHTMLElement(node).hasTagName(HTMLNames::fooTag)
After the patch, the code only does:
node.isHTMLElement()
&& toHTMLElement(node).hasTagName(HTMLNames::fooTag)
No new tests, no behavior change.
- dom/Element.h:
(WebCore::Element>):
(WebCore::isElementOfType):
Add template parameter to isElementOfType() function so that it can
handle any argument type, not just Elements. Also introduce an
ElementTypeCastTraits struct that is called by isElementOfType()
function so that we can so partial template specialization.
- dom/ElementTraversal.h:
(WebCore::Traversal<ElementType>::firstWithinTemplate):
(WebCore::Traversal<ElementType>::lastWithinTemplate):
(WebCore::Traversal<ElementType>::nextTemplate):
(WebCore::Traversal<ElementType>::previousTemplate):
Use NodeTraversal API internally instead of Traversal<Element> to avoid
redundant isElementNode() checks.
(WebCore::Traversal<Element>::lastWithinTemplate): Deleted.
The code is now identical to the generic version.
(WebCore::Traversal<Element>::previousTemplate): Deleted.
The code is now identical to the generic version.
- dom/make_names.pl:
(printTypeHelpers):
- Generate template specializations for ElementTypeCastTraits struct instead of isElementOfType(). This avoids having to provide overloads for specific argument types (e.g. Node, Element, HTMLElement, ...).
- Share more code between HTML code path and the other path (for SVG, MTHML).
- html/HTMLElement.h:
(WebCore::HTMLElement>):
Provide HTMLElement template specialization for ElementTypeCastTraits
struct instead of isElementOfType().
- html/HTMLFormControlElement.h:
(WebCore::HTMLFormControlElement>):
Provide HTMLFormControlElement template specialization for
ElementTypeCastTraits struct instead of isElementOfType().
- html/HTMLFrameElementBase.h:
(WebCore::isHTMLFrameElementBase):
- Remove helper taking an Element in argument as it does not bring any benefit. Instead, update the overload taking a Node in argument to remove the unnecessary isElementNode() check as isHTMLFrameElement(Node) is now efficient.
- Add an overload taking an HTMLElement in argument so that we can bypass the isHTMLElement() check when we know the input is an HTMLElement.
- html/HTMLMediaElement.h:
(WebCore::HTMLMediaElement>):
Provide HTMLMediaElement template specialization for ElementTypeCastTraits
struct instead of isElementOfType().
- html/HTMLPlugInImageElement.h:
(WebCore::HTMLPlugInImageElement>):
Provide HTMLPlugInImageElement template specialization for
ElementTypeCastTraits struct instead of isElementOfType().
- html/LabelableElement.h:
(WebCore::LabelableElement>):
Provide LabelableElement template specialization for ElementTypeCastTraits
struct instead of isElementOfType().
- mathml/MathMLElement.h:
(WebCore::MathMLElement>):
Provide MathMLElement template specialization for ElementTypeCastTraits
struct for consistency with HTMLElement / SVGElement.
- svg/SVGElement.h:
(WebCore::SVGElement>):
- Provide SVGElement template specialization for ElementTypeCastTraits struct instead of isElementOfType().
- include SVGElementTypeHelpers.h at the end of the file (similarly to what is already done in HTMLElement.h because isElementOfType(const SVGElement&) needs to be defiend because the include.
- svg/SVGFilterPrimitiveStandardAttributes.h:
(WebCore::SVGFilterPrimitiveStandardAttributes>):
Provide SVGFilterPrimitiveStandardAttributes template specialization for
ElementTypeCastTraits struct instead of isElementOfType().
- svg/animation/SVGSMILElement.h:
(WebCore::SVGSMILElement>):
Provide SVGSMILElement template specialization for ElementTypeCastTraits
struct instead of isElementOfType().
- 7:45 AM Changeset in webkit [173621] by
-
- 4 edits in trunk/Tools
[EFL] Ecore and Eina are initialized twice in TestWebKitAPI
https://bugs.webkit.org/show_bug.cgi?id=136822
Reviewed by Gyuyoung Kim.
In TestWebKitAPI/efl/main.cpp, ecore and eina modules are unnecessarily
initialized as we already does it in PlatformWebView::PlatformWebView
calling ewk_init(). The reason for that was to ensure testing for example,
WTF where creating the view is not mandatory.
Call ewk_init() and ewk_shutdown() in TestWebKitAPI/efl/main.cpp
in order to properly initalize and release EWebKit.
- TestWebKitAPI/PlatformEfl.cmake:
- TestWebKitAPI/efl/PlatformWebView.cpp:
(TestWebKitAPI::PlatformWebView::PlatformWebView):
(TestWebKitAPI::PlatformWebView::~PlatformWebView):
- TestWebKitAPI/efl/main.cpp:
(main):
- 7:20 AM Changeset in webkit [173620] by
-
- 4 edits2 adds in trunk
[CSS Grid Layout] Sort items by span when resolving content-based track sizing functions
https://bugs.webkit.org/show_bug.cgi?id=135701
Reviewed by Darin Adler.
Source/WebCore:
Section 10.4 of the specs mentions that we should first treat non
spanning items and then incrementally proceed with items with
greater spans when resolving the track breaths in the Track Sizing
Algorithm.
As a nice side effect we're removing the multiple processing of
spanning grid items caused by GridIterator (it returns the same
item as many times as the number of cells it spans). This adds a
~4% performance penalty in auto-grid-lots-of-data.html mainly due
to the use of a hash to remove duplicates.
Test: fast/css-grid-layout/grid-item-order-in-content-sized-columns-resolution.html
- rendering/RenderGrid.cpp:
(WebCore::RenderGrid::gridItemSpan):
(WebCore::gridItemWithSpanSorter):
(WebCore::uniquePointerInPair):
(WebCore::RenderGrid::resolveContentBasedTrackSizingFunctions):
- rendering/RenderGrid.h:
LayoutTests:
Tests that check that items are sorted by span to resolve content
based track sizing functions instead of directly using DOM order.
- fast/css-grid-layout/grid-item-order-in-content-sized-columns-resolution-expected.txt: Added.
- fast/css-grid-layout/grid-item-order-in-content-sized-columns-resolution.html: Added.
- 4:35 AM Changeset in webkit [173619] by
-
- 2 edits in trunk/Source/WebCore
[GTK][CMake] Build WebCore with Wayland-specific include directories, libraries
https://bugs.webkit.org/show_bug.cgi?id=136815
Reviewed by Philippe Normand.
- PlatformGTK.cmake: Add the platform/graphics/wayland/ directory to the list of
WebCore's include directories. Add include directories of the Wayland dependency
to the list of WebCore's include directories. Same for the Wayland libraries.
- 4:32 AM Changeset in webkit [173618] by
-
- 2 edits in trunk
[CMake] Remove FIND_PACKAGE_HANDLE_STANDARD_ARGS call for WAYLAND_EGL in FindWayland.cmake
https://bugs.webkit.org/show_bug.cgi?id=136814
Reviewed by Philippe Normand.
- Source/cmake/FindWayland.cmake: This line was committed by mistake.
We bundle the wayland-egl dependency with wayland-client and wayland-server
and store the resulting variables with the WAYLAND_ prefix. Because of this
this line wasn't exporting anything useful.
- 3:04 AM Changeset in webkit [173617] by
-
- 3 edits in trunk/Source/WebKit2
REGRESSION(r170243): [EFL][WK2] Dirty image is shown when new page is loading on fixed layout
https://bugs.webkit.org/show_bug.cgi?id=136568
Reviewed by Csaba Osztrogonác.
r170243 landed wrong didCommitNewPage() since it always returns false. It cause that
PageViewportControllerClientEfl::didChangeVisibleContents() continues to draw dirty image on 0,0 coordinate.
This patch fixes the problem.
- UIProcess/API/efl/EwkView.h:
(EwkView::waitingForNewPage):
(EwkView::didCommitNewPage):
- UIProcess/efl/PageViewportControllerClientEfl.cpp:
(WebKit::PageViewportControllerClientEfl::didChangeVisibleContents):
- 2:45 AM Changeset in webkit [173616] by
-
- 14 edits in trunk
[WinCairo] Make it easier to enable/disable GStreamer.
https://bugs.webkit.org/show_bug.cgi?id=135766
Patch by peavo@outlook.com <peavo@outlook.com> on 2014-09-15
Reviewed by Brent Fulgham.
Make it possible to enable/disable GStreamer by editing the new user macro ENABLE_GSTREAMER_WINCAIRO.
Source/WebCore:
- WebCore.vcxproj/WebCoreDebugWinCairo.props: Import GStreamer property file.
- WebCore.vcxproj/WebCoreReleaseWinCairo.props: Ditto.
Source/WebKit:
- WebKit.vcxproj/WebKit/WebKitDebugWinCairo.props: Import GStreamer property file.
- WebKit.vcxproj/WebKit/WebKitReleaseWinCairo.props: Ditto.
Source/WTF:
- WTF.vcxproj/WTFDebugWinCairo.props: Import GStreamer property file.
- WTF.vcxproj/WTFReleaseWinCairo.props: Ditto.
- wtf/Platform.h: Enable GStreamer if ENABLE(GSTREAMER_WINCAIRO) is true, otherwise use Media Foundation.
Tools:
- WinLauncher/WinMain.cpp: Compile fix when GStreamer is enabled.
WebKitLibraries:
- win/tools/vsprops/GStreamerCommon.props: Add user macro ENABLE_GSTREAMER_WINCAIRO.
- 2:12 AM Changeset in webkit [173615] by
-
- 6 edits in trunk
[CSS Grid Layout] Crash at CSSParser::parseGridTemplateRowsAndAreas
https://bugs.webkit.org/show_bug.cgi?id=136778
Reviewed by Darin Adler.
Source/WebCore:
An empty list of grid line names (represented by "()") does not
add anything to the list of parsed values. That's why trying to
concatenate an adjacent list of grid line names was failing,
because we were trying to concatenate a list with the last parsed
CSSValue which was not the expected grid line names list.
- css/CSSParser.cpp:
(WebCore::CSSParser::parseGridTemplateRowsAndAreas):
(WebCore::CSSParser::parseGridLineNames):
- css/CSSParser.h:
LayoutTests:
Added some new test cases to verify that we properly handle empty
lists of grid line names.
- fast/css-grid-layout/grid-template-shorthand-get-set-expected.txt:
- fast/css-grid-layout/grid-template-shorthand-get-set.html:
- 1:08 AM Changeset in webkit [173614] by
-
- 3 edits in trunk/Source/WebCore
[GStreamer] don't send transferMode HTTP header
https://bugs.webkit.org/show_bug.cgi?id=136781
Reviewed by Philippe Normand.
No header at all is better than having the wrong header as DLNA
mandates that a missing header has to be tolerated while a wrong
header is an error.
- platform/graphics/gstreamer/WebKitWebSourceGStreamer.cpp:
(webKitWebSrcStart):
- platform/network/HTTPHeaderNames.in:
Sep 14, 2014:
- 10:40 PM Changeset in webkit [173613] by
-
- 3 edits in trunk/Source/WebCore
Fix post-mortem nits for r173528 & r173549
https://bugs.webkit.org/show_bug.cgi?id=136808
Reviewed by Darin Adler.
Fix post-mortem nits for r173528 & r173549.
No new tests, no behavior change.
- accessibility/AccessibilityNodeObject.cpp:
(WebCore::AccessibilityNodeObject::alternativeTextForWebArea):
- Use auto* instead of more specific types.
- Use fastGetAttribute() instead of getAttribute() as this is supported for the "title" attribute.
- editing/FrameSelection.cpp:
(WebCore::FrameSelection::setSelectionFromNone):
Use auto* instead of more specific types.
- 9:29 PM Changeset in webkit [173612] by
-
- 6 edits in trunk/Source/WebCore
Introduce FONT_DATA_TYPE_CASTS, and use it
https://bugs.webkit.org/show_bug.cgi?id=136766
Reviewed by Darin Adler.
As a step to use toFoo, this patch introduces FONT_DATA_TYPE_CASTS macro for toFooFontData().
This will help to detect wrong type cast.
- platform/graphics/FontData.h:
- platform/graphics/FontGlyphs.cpp:
(WebCore::FontGlyphs::releaseFontData):
(WebCore::FontGlyphs::determinePitch):
- platform/graphics/GlyphPageTreeNode.cpp:
(WebCore::GlyphPageTreeNode::initializePage):
- platform/graphics/SegmentedFontData.h:
- platform/graphics/SimpleFontData.h:
- platform/graphics/mac/SimpleFontDataMac.mm:
(WebCore::SimpleFontData::getCompositeFontReferenceFontData):
- 9:07 PM Changeset in webkit [173611] by
-
- 7 edits in trunk/Source/WebCore
Generate toCSSStyleSheet using STYLE_SHEET_TYPE_CASTS
https://bugs.webkit.org/show_bug.cgi?id=136774
Reviewed by Darin Adler.
As a step to use toFoo, this patch introduces STYLE_SHEET_TYPE_CASTS for toCSSStyleSheet().
This will help to detect wrong type cast. Additonally this patch helps to remove argument type of RefPtr.
No new tests, no behavior changes.
- bindings/gobject/WebKitDOMPrivate.cpp:
(WebKit::wrap):
- css/CSSStyleSheet.h:
- css/StyleSheet.h:
- dom/DocumentStyleSheetCollection.cpp:
(WebCore::filterEnabledNonemptyCSSStyleSheets):
- dom/ProcessingInstruction.cpp:
(WebCore::ProcessingInstruction::parseStyleSheet):
- inspector/InspectorCSSAgent.cpp:
(WebCore::InspectorCSSAgent::getAllStyleSheets):
(WebCore::InspectorCSSAgent::collectStyleSheets):
- 8:40 PM Changeset in webkit [173610] by
-
- 5 edits in trunk/Source/WebCore
Generate toFooElementData() using ELEMENT_DATA_TYPE_CASTS
https://bugs.webkit.org/show_bug.cgi?id=136775
Reviewed by Darin Adler.
As a step to use toFoo, this patch introduces ELEMENT_DATA_TYPE_CASTS for toFooElementData().
This will help to detect wrong type cast. Additonally this patch helps to remove argument type of RefPtr.
No new tests, no behavior changes.
- dom/Element.cpp:
(WebCore::Element::cloneAttributesFromElement):
(WebCore::Element::createUniqueElementData):
- dom/ElementData.cpp:
(WebCore::ElementData::destroy):
- dom/ElementData.h:
(WebCore::ElementData::length):
(WebCore::ElementData::attributeBase):
(WebCore::ElementData::presentationAttributeStyle):
(WebCore::ElementData::attributesIterator):
- svg/SVGSVGElement.cpp:
(WebCore::SVGSVGElement::setupInitialView): Remove static_cast<SVGSVGElement*>
- 7:23 PM Changeset in webkit [173609] by
-
- 2 edits in trunk/Source/WebCore
Remove unnecessary overloads taking a ContainerNode in Element Traversal
https://bugs.webkit.org/show_bug.cgi?id=136767
Reviewed by Darin Adler.
Remove unnecessary overloads taking a ContainerNode in Element Traversal.
Several of those don't bring any performance improvements as the needed
methods are defined on Node (not ContainerNode).
No new tests, no behavior change.
- dom/ElementTraversal.h:
(WebCore::Traversal<Element>::previous):
NodeTraversal::previous() takes a const Node* in argument so the
ContainerNode overload is not needed.
(WebCore::Traversal<ElementType>::previous):
Unnecessary now that Traversal<Element>::previous() takes a const Node*
in argument.
(WebCore::Traversal<ElementType>::nextSibling):
nextSibling() is defined on Node, not ContainerNode, so the overload
is not needed.
(WebCore::Traversal<ElementType>::previousSibling):
previousSibling() is defined on Node, not ContainerNode, so the overload
is not needed.
(WebCore::Traversal<Element>::previousTemplate): Deleted.
(WebCore::Traversal<ElementType>::previousTemplate): Deleted.
(WebCore::Traversal<ElementType>::nextSiblingTemplate): Deleted.
(WebCore::Traversal<ElementType>::previousSiblingTemplate): Deleted.
No need to have those functions templated anymore.
- 6:51 PM Changeset in webkit [173608] by
-
- 5 edits in trunk/Source
[iOS] Attempt to fix the iOS build after <http://trac.webkit.org/changeset/173606>
(https://bugs.webkit.org/show_bug.cgi?id=136789)
Substitute Node::countChildNodes() for Node::childNodeCount() in more places.
Source/WebCore:
Although I updated a comment in WebCore::lastOffsetForEditing() (defined in file
editing/htmlediting.cpp) to refer to Node::countChildNodes(), I'm unclear what the
comment is trying to explain that isn't otherwise explained by the code or the
comments that precede this function. Specifically, I don't understand the use of
the word "preempt" in the comment. We should look to improve the readability of
this comment.
- editing/htmlediting.cpp:
(WebCore::lastOffsetForEditing):
- page/ios/FrameIOS.mm:
(WebCore::Frame::interpretationsForCurrentRoot):
Source/WebKit/mac:
- WebView/WebFrame.mm:
(-[WebFrame focusedNodeHasContent]):
- 3:19 PM Changeset in webkit [173607] by
-
- 3 edits in trunk/Source/WebCore
Drop NodeTraversal::nextSkippingChildren() overload taking a ContainerNode
https://bugs.webkit.org/show_bug.cgi?id=136764
Reviewed by Darin Adler.
Drop NodeTraversal::nextSkippingChildren() overload taking a
ContainerNode argument. This one does not bring any performance
improvement because nextSibling() is defined on Node and
nextAncestorSibling() takes a Node in argument.
Also remove the overload in ElementTraversal as it no longer makes
sense after this change.
No new tests, no behavior change.
- dom/ElementTraversal.h:
(WebCore::Traversal<ElementType>::nextSkippingChildren):
(WebCore::Traversal<ElementType>::nextSkippingChildrenTemplate): Deleted.
- dom/NodeTraversal.h:
(WebCore::NodeTraversal::nextSkippingChildren):
(WebCore::NodeTraversal::next):
(WebCore::NodeTraversal::traverseNextSkippingChildrenTemplate): Deleted.
- 2:18 PM Changeset in webkit [173606] by
-
- 31 edits in trunk/Source
Rename Node::childNodeCount() to countChildNodes() and avoid inefficient uses
https://bugs.webkit.org/show_bug.cgi?id=136789
Reviewed by Darin Adler.
Source/WebCore:
Rename Node::childNodeCount() to countChildNodes() to make it clearer
that the method actually computes the result rather than returning a
cached value.
This patch also introduces a new Node::hasOneChild() method that is
used to check if a Node has a single child. This is much more efficient
than calling countChildNodes() == 1.
The patch also leverages Node::hasChildNodes() in a lot of places
instead of calling countChildNodes().
Finally, in a couple of places, we now use childrenOfType() to iterate
over children more efficient than using countChildNodes() and
childNode(index).
No new tests, no behavior change.
- WebCore.exp.in:
- WebCore.order:
Update the name of the exposed symbol for countChildNodes().
- dom/ContainerNode.cpp:
(WebCore::ContainerNode::removeChildren):
(WebCore::ContainerNode::countChildNodes):
(WebCore::ContainerNode::childNodeCount): Deleted.
Rename childNodeCount() to countChildNodes() to make it obvious it is
computing the result rather than returning a cached value.
- dom/ContainerNode.h:
(WebCore::ContainerNode::hasOneChild):
Introduce an efficient way to check in a ContainerNode has a single
child as "countChildNodes() == 1" calls were frequent and inefficient.
(WebCore::Node::countChildNodes):
(WebCore::Node::childNodeCount): Deleted.
- dom/Node.h:
Rename childNodeCount() to countChildNodes().
- dom/Position.cpp:
(WebCore::Position::parentAnchoredEquivalent):
- dom/Position.h:
(WebCore::lastOffsetInNode):
- dom/Range.cpp:
Mechanical renaming.
(WebCore::lengthOfContentsInNode):
- editing/ApplyStyleCommand.cpp:
(WebCore::ApplyStyleCommand::applyInlineStyleToNodeRange):
(WebCore::ApplyStyleCommand::shouldApplyInlineStyleToRun):
(WebCore::ApplyStyleCommand::applyInlineStyleToPushDown):
(WebCore::ApplyStyleCommand::mergeEndWithNextIfIdentical):
(WebCore::ApplyStyleCommand::applyInlineStyleChange):
Call hasChildNodes() rather than countChildNodes() as it is a lot more
efficient.
- editing/Editor.cpp:
(WebCore::Editor::setTextAsChildOfElement):
(WebCore::Editor::rangeOfString):
(WebCore::Editor::countMatchesForText):
- editing/FrameSelection.cpp:
(WebCore::FrameSelection::elementRangeContainingCaretSelection):
Mechanical renaming.
- editing/ReplaceSelectionCommand.cpp:
(WebCore::ReplaceSelectionCommand::insertAsListItems):
Call hasOneChild() instead of countChildNodes() == 1. Also remove
redundant listElement->hasChildNodes() check as hasOneChild() takes
care of this already.
- editing/TextIterator.cpp:
(WebCore::SimplifiedBackwardsTextIterator::SimplifiedBackwardsTextIterator):
- editing/VisibleUnits.cpp:
(WebCore::endOfDocument):
- editing/htmlediting.cpp:
(WebCore::lastOffsetForEditing):
Mechanical renaming.
(WebCore::visiblePositionBeforeNode):
(WebCore::visiblePositionAfterNode):
Call hasChildNodes() instead of converting countChildNodes() to a
boolean.
- editing/markup.cpp:
(WebCore::StyledMarkupAccumulator::traverseNodesForSerialization):
Call !hasChildNodes() instead of !countChildNodes().
(WebCore::isPlainTextMarkup):
- Drop !node->isElementNode() check as !node->hasTagName(divTag) takes care of discarding non-Element Nodes already.
- Cast the Node to an HTMLDivElement as soon as possible to avoid calling calling the slower Node APIs in several cases.
- Call hasOneChild() instead of countChildNodes() == 1.
- html/HTMLDivElement.h:
- html/HTMLTagNames.in:
Generate casting helpers as I use them in WebCore::isPlainTextMarkup().
- html/HTMLScriptElement.cpp:
(WebCore::HTMLScriptElement::setText):
- html/HTMLTitleElement.cpp:
(WebCore::HTMLTitleElement::setText):
Call hasOneChild() / hasChildNodes() instead of countChildNodes().
- html/shadow/MediaControlElements.cpp:
(WebCore::MediaControlTimelineContainerElement::setTimeDisplaysHidden):
(WebCore::MediaControlTextTrackContainerElement::updateDisplay):
Use childrenOfType<Element>() to iterate of child Elements instead of
slower childNodeCount() + childNode(index) + isElementNode(). Also,
childNodeCount() was not even cached before the loop.
- html/track/VTTRegion.cpp:
(WebCore::VTTRegion::displayLastTextTrackCueBox):
Use childrenOfType<Element>() to iterate of child Elements, thus
avoiding calling childNodeCount() + childNode(index).
- page/DOMSelection.cpp:
(WebCore::DOMSelection::extend):
(WebCore::DOMSelection::selectAllChildren):
- rendering/RenderObject.cpp:
(WebCore::RenderObject::caretMaxOffset):
- rendering/RenderReplaced.cpp:
(WebCore::RenderReplaced::isSelected):
- rendering/RenderView.cpp:
(WebCore::RenderView::splitSelectionBetweenSubtrees):
Mechanical renaming.
Source/WebKit/mac:
Rename childNodeCount() to countChildNodes().
- WebView/WebHTMLView.mm:
(-[WebHTMLView attributedString]):
Source/WebKit2:
Avoid calling slow Node::countChildNodes().
- WebProcess/WebPage/CoordinatedGraphics/WebPageCoordinatedGraphics.cpp:
(WebKit::WebPage::findZoomableAreaForPoint):
Replace call to "node->parentNode()->childNodeCount() != 1" by
"!node->parentNode()->hasOneChild()" which is equivalent but more
efficient.