2012-07-13 Ryosuke Niwa Iterating backwards over HTMLCollection is O(n^2) https://bugs.webkit.org/show_bug.cgi?id=91306 Reviewed by Anders Carlsson. Fixed the bug by introducing itemBefore that iterates nodes backwards to complement itemAfter. Unfortunately, some HTML collections such as HTMLFormCollection and HTMLTableRowsCollection have its own itemAfter function and writing an equivalent itemBefore is somewhat tricky. For now, added a new boolean flag indicating whether a given HTML collection supports itemBefore or not, and left those HTML collections that override itemAfter alone. This also paves our way to share more code between DynamicNodeList and HTMLCollection. Test: perf/htmlcollection-backwards-iteration.html * dom/DynamicNodeList.h: (WebCore::DynamicNodeListCacheBase::DynamicNodeListCacheBase): Takes ItemBeforeSupportType. (WebCore::DynamicNodeListCacheBase::supportsItemBefore): Added. (DynamicNodeListCacheBase): (WebCore::DynamicNodeListCacheBase::setItemCache): Replaced a FIXME by an assertion now that we can. * html/HTMLAllCollection.cpp: (WebCore::HTMLAllCollection::HTMLAllCollection): Supports itemBefore since it doesn't override itemAfter. * html/HTMLCollection.cpp: (WebCore::HTMLCollection::HTMLCollection): (WebCore::HTMLCollection::create): (WebCore::isAcceptableElement): Made it a static local function instead of a static member. (WebCore::nextNode): Templatized. (WebCore::itemBeforeOrAfter): Extracted from itemAfter and templatized. (WebCore::HTMLCollection::itemBefore): Added. (WebCore::HTMLCollection::itemAfter): (WebCore::HTMLCollection::shouldSearchFromFirstItem): Added. Determines whether we should reset the item cache to the first item. We obviously do if the cache is invalid. If the target offset is after the cached offset, then we shouldn't go back regardless of availability of itemBefore. Otherwise, we go back to the first item iff itemBefore is not available or the distance from the cached offset to the target offset is greater than the target offset itself. (WebCore::HTMLCollection::length): (WebCore::HTMLCollection::item): Use the term "offset" to match the terminology elsewhere. (WebCore::HTMLCollection::itemBeforeOrAfterCachedItem): Ditto. Also added the logic to iterate nodes backwards using itemBefore. Once we're in this branch, we should always find a matching item since the target offset was less than the cached offset, and offsets are non-negative. If we had ever reached the end of the loop without finding an item, it indicates that the cache has been invalid and we have some serious bug elsewhere. * html/HTMLCollection.h: (WebCore::HTMLCollectionCacheBase::HTMLCollectionCacheBase): (HTMLCollection): * html/HTMLOptionsCollection.cpp: (WebCore::HTMLOptionsCollection::HTMLOptionsCollection): Supports itemBefore since it doesn't override itemAfter. * html/HTMLFormCollection.cpp: (WebCore::HTMLFormCollection::HTMLFormCollection): Doesn't support itemBefore as it overrides itemAfter. * html/HTMLNameCollection.cpp: (WebCore::HTMLNameCollection::HTMLNameCollection): Ditto. * html/HTMLPropertiesCollection.cpp: (WebCore::HTMLPropertiesCollection::HTMLPropertiesCollection): * html/HTMLTableRowsCollection.cpp: (WebCore::HTMLTableRowsCollection::HTMLTableRowsCollection): 2012-07-13 Eric Penner [chromium] Add 'self-managed' option to CCPrioritizedTexture to enable render-surface and canvas use cases. https://bugs.webkit.org/show_bug.cgi?id=91177 Reviewed by Adrienne Walker. This makes the render-surface memory use case generic as 'self-managed' textures, as this use case is popping up in other places (eg. canvases). It's exactly the same idea except we can have as many place-holders as we want at arbitrary priorities. This already tested by the render surface unit tests which now also use the generic placeholder. * platform/graphics/chromium/cc/CCLayerTreeHost.cpp: (WebCore::CCLayerTreeHost::CCLayerTreeHost): (WebCore::CCLayerTreeHost::initializeLayerRenderer): (WebCore::CCLayerTreeHost::updateLayers): (WebCore::CCLayerTreeHost::setPrioritiesForSurfaces): (WebCore): (WebCore::CCLayerTreeHost::setPrioritiesForLayers): (WebCore::CCLayerTreeHost::prioritizeTextures): (WebCore::CCLayerTreeHost::calculateMemoryForRenderSurfaces): (WebCore::CCLayerTreeHost::paintLayerContents): * platform/graphics/chromium/cc/CCLayerTreeHost.h: (CCLayerTreeHost): * platform/graphics/chromium/cc/CCPrioritizedTexture.cpp: (WebCore::CCPrioritizedTexture::CCPrioritizedTexture): (WebCore::CCPrioritizedTexture::setToSelfManagedMemoryPlaceholder): * platform/graphics/chromium/cc/CCPrioritizedTexture.h: (CCPrioritizedTexture): (WebCore::CCPrioritizedTexture::setIsSelfManaged): (WebCore::CCPrioritizedTexture::isSelfManaged): * platform/graphics/chromium/cc/CCPrioritizedTextureManager.cpp: (WebCore::CCPrioritizedTextureManager::prioritizeTextures): (WebCore::CCPrioritizedTextureManager::acquireBackingTextureIfNeeded): (WebCore::CCPrioritizedTextureManager::destroyBacking): * platform/graphics/chromium/cc/CCPrioritizedTextureManager.h: (CCPrioritizedTextureManager): (WebCore::CCPrioritizedTextureManager::memoryForSelfManagedTextures): 2012-07-13 Kent Tamura Internals: Clean up the mock PagePopupDriver correctly. https://bugs.webkit.org/show_bug.cgi?id=91250 Unreviewed, a trivial testing code fix. * testing/InternalSettings.cpp: (WebCore::InternalSettings::Backup::restoreTo): (WebCore::InternalSettings::reset): Resetting PaePopupDriver here instead of Backup::restoreTo. Also, close the mock popup before resetting PagePopupDriver by clearing m_pagePopupDriver. * testing/MockPagePopupDriver.cpp: (WebCore::MockPagePopupDriver::~MockPagePopupDriver): Close the popup. 2012-07-13 Tony Payne Remove Widget from screenColorProfile https://bugs.webkit.org/show_bug.cgi?id=91300 Reviewed by Adam Barth. Chromium, the only platform implementing screenColorProfile, does not need the Widget, so removing for simplicity. Covered by existing tests. * platform/PlatformScreen.h: (WebCore): Updated comment to remove reference to type param that no longer exists and removed Widget param. * platform/blackberry/PlatformScreenBlackBerry.cpp: (WebCore::screenColorProfile): Removed widget param. * platform/chromium/PlatformScreenChromium.cpp: (WebCore::screenColorProfile): Removed widget param. * platform/efl/PlatformScreenEfl.cpp: (WebCore::screenColorProfile): Removed widget param. * platform/gtk/PlatformScreenGtk.cpp: (WebCore::screenColorProfile): Removed widget param. * platform/image-decoders/ImageDecoder.h: (WebCore::ImageDecoder::qcmsOutputDeviceProfile): removed param to match screenColorProfile()'s new spec. * platform/mac/PlatformScreenMac.mm: (WebCore::screenColorProfile): Removed widget param. * platform/qt/PlatformScreenQt.cpp: (WebCore::screenColorProfile): Removed widget param. * platform/win/PlatformScreenWin.cpp: (WebCore::screenColorProfile): Removed widget param. 2012-07-13 Brian Anderson [chromium] Add flushes to CCTextureUpdater::update https://bugs.webkit.org/show_bug.cgi?id=89035 Reviewed by Adrienne Walker. Automatic flushes are being removed from the command buffer, so this moves the flushes into the CCTextureUpdater itself. CCTextureUpdaterTest added to verify texture upload/flushing patterns. * platform/graphics/chromium/cc/CCGraphicsContext.h: (WebCore::CCGraphicsContext::flush): (CCGraphicsContext): * platform/graphics/chromium/cc/CCTextureUpdater.cpp: (WebCore): (WebCore::CCTextureUpdater::update): Manual flushes added here. 2012-07-13 Kiran Muppala REGRESSION: RenderInline boundingBox ignores relative position offset https://bugs.webkit.org/show_bug.cgi?id=91168 Reviewed by Simon Fraser. RenderGeometryMap, used for caching the transform to the view, expects the first mapping pushed, to be that of the view itself. RenderInline was instead pushing it's own offset first. Besides the offset of the view itself was not being pushed. Relaxed the RenderGeometryMap restriction that the first pushed step should be of the view. It is sufficient that the view's mapping is pushed in the first call to pushMappingsToAncestor. Modified RenderInline to push the offset of the view also to the geometry map. Test: fast/inline/inline-relative-offset-boundingbox.html * rendering/RenderGeometryMap.cpp: (WebCore::RenderGeometryMap::pushMappingsToAncestor): Add assertion to check if mapping to view was pushed in first invocation. (WebCore::RenderGeometryMap::pushView): Correct assertion that checks if the view's mapping is the first one to be applied. (WebCore::RenderGeometryMap::stepInserted): Use isRenderView to check if a mapping step belongs to a view instead of using mapping size. (WebCore::RenderGeometryMap::stepRemoved): Ditto. * rendering/RenderInline.cpp: (WebCore::(anonymous namespace)::AbsoluteQuadsGeneratorContext::AbsoluteQuadsGeneratorContext): Push mappings all the way up to and including the view. 2012-07-13 Xianzhu Wang Move WebCore/platform/text/Base64 to WTF/wtf/text https://bugs.webkit.org/show_bug.cgi?id=91162 Reviewed by Adam Barth. No new tests. Files moving only. * CMakeLists.txt: * GNUmakefile.list.am: * Modules/websockets/WebSocketHandshake.cpp: (WebCore::generateSecWebSocketKey): (WebCore::WebSocketHandshake::getExpectedWebSocketAccept): * Target.pri: * WebCore.gypi: * WebCore.order: * WebCore.vcproj/WebCore.vcproj: * WebCore.xcodeproj/project.pbxproj: * fileapi/FileReaderLoader.cpp: (WebCore::FileReaderLoader::convertToDataURL): * inspector/DOMPatchSupport.cpp: (WebCore::DOMPatchSupport::createDigest): * inspector/InspectorFileSystemAgent.cpp: (WebCore): * inspector/InspectorPageAgent.cpp: (WebCore::InspectorPageAgent::cachedResourceContent): (WebCore::InspectorPageAgent::sharedBufferContent): * loader/archive/mhtml/MHTMLArchive.cpp: (WebCore::MHTMLArchive::generateMHTMLData): * loader/archive/mhtml/MHTMLParser.cpp: (WebCore::MHTMLParser::parseNextPart): * page/DOMWindow.cpp: (WebCore::DOMWindow::btoa): (WebCore::DOMWindow::atob): * page/Page.cpp: (WebCore::Page::userStyleSheetLocationChanged): * platform/graphics/cairo/ImageBufferCairo.cpp: (WebCore::ImageBuffer::toDataURL): * platform/graphics/cg/ImageBufferCG.cpp: (WebCore::CGImageToDataURL): * platform/graphics/gtk/ImageBufferGtk.cpp: (WebCore::ImageBuffer::toDataURL): * platform/graphics/skia/FontCustomPlatformData.cpp: (WebCore::createUniqueFontName): * platform/graphics/skia/ImageBufferSkia.cpp: (WebCore::ImageBuffer::toDataURL): (WebCore::ImageDataToDataURL): * platform/graphics/win/FontCustomPlatformData.cpp: (WebCore::createUniqueFontName): * platform/graphics/wince/FontCustomPlatformData.cpp: (WebCore::createUniqueFontName): * platform/graphics/wince/ImageBufferWinCE.cpp: * platform/graphics/wx/ImageBufferWx.cpp: * platform/network/DataURL.cpp: (WebCore::handleDataURL): * platform/network/cf/ResourceHandleCFNet.cpp: (WebCore::applyBasicAuthorizationHeader): * platform/network/mac/ResourceHandleMac.mm: (WebCore::applyBasicAuthorizationHeader): * platform/network/soup/ResourceHandleSoup.cpp: * platform/win/SSLKeyGeneratorWin.cpp: (WebCore::WebCore::signedPublicKeyAndChallengeString): 2012-07-13 Xianzhu Wang [Chromium] Sometimes bottom of text is truncated when page has a fractional scale https://bugs.webkit.org/show_bug.cgi?id=88684 Reviewed by Tony Chang. When the page has a fractional scale, the ascent and descent part of the fonts might be fractional. If the descent part is rounded down, the bottom of the text might be truncated when displayed when subpixel text positioning is enabled. To avoid that, borrow one unit from the ascent when possible. Test: fast/text/descent-clip-in-scaled-page.html * platform/graphics/harfbuzz/FontPlatformDataHarfBuzz.cpp: (WebCore::FontPlatformData::setupPaint): Moved NoPreference handling into querySystemForRenderStyle so that fontRenderStyle() can have actual styles without NoPreference. (WebCore::FontPlatformData::querySystemForRenderStyle): Added NoPreference handling (moved from setupPaint) * platform/graphics/harfbuzz/FontPlatformDataHarfBuzz.h: (FontPlatformData): (WebCore::FontPlatformData::fontRenderStyle): Added to let SimpleFontDataSkia access the font render styles. * platform/graphics/skia/SimpleFontDataSkia.cpp: (WebCore::SimpleFontData::platformInit): 2012-07-13 Ryosuke Niwa Remove an assertion after r122637. * dom/DynamicNodeList.h: (WebCore::DynamicNodeListCacheBase::shouldInvalidateTypeOnAttributeChange): 2012-07-13 Pierre Rossi [Qt] Improve the mobile theme slightly https://bugs.webkit.org/show_bug.cgi?id=90806 Reviewed by Kenneth Rohde Christiansen. Improve drawing of the mobile theme's controls' background. Ensure the focus ring never appears with the mobile theme, since it looks bad in combination with the highlights. No new tests. The painting code from the mobile theme is still not covered specifically (it will when we revive pixel tests). * platform/qt/RenderThemeQtMobile.cpp: (WebCore): (WebCore::addPointToOctants): Added. This is simply a helper to avoid doing too much duplicate work in drawControlBackground. (WebCore::drawControlBackground): Rely on the octant logic added above and take the opportunity to increase the granularity. (WebCore::borderPen): (WebCore::StylePainterMobile::findLineEdit): (WebCore::RenderThemeQtMobile::adjustTextFieldStyle): * platform/qt/RenderThemeQtMobile.h: (RenderThemeQtMobile): (WebCore::RenderThemeQtMobile::supportsFocusRing): 2012-07-13 Julien Chaffraix Remove an always-failing table-wrapping check in RenderObject::addChild https://bugs.webkit.org/show_bug.cgi?id=91286 Reviewed by Eric Seidel. Due to the structure of the code, this test is always failing (newChild->isTableCell() is true to get in the branch). The changeset adding the code didn't add testing so I poundered adding the mentioned test, which is passing. However the test would need to be blindly changed to be included in our test harness. I would also expect this code to be exercised by other table tests anyway. * rendering/RenderObject.cpp: (WebCore::RenderObject::addChild): Removed never-reached branch. While at it, removed a 'what' comment in the same file. 2012-07-13 Emil A Eklund Use LayoutBoxExtent for image outsets https://bugs.webkit.org/show_bug.cgi?id=91166 Reviewed by Tony Chang. Change RenderStyle and calling code to use LayoutBoxExtent for image outsets and remove text direction and writing mode versions of the outline getters from RenderStyle as LayoutBoxExtent provides the same functionality. No new tests, no change in functionality. * platform/graphics/FractionalLayoutBoxExtent.h: * platform/graphics/FractionalLayoutBoxExtent.cpp: (WebCore::FractionalLayoutBoxExtent::logicalTop): (WebCore::FractionalLayoutBoxExtent::logicalBottom): Add logicalTop and logicalBottom methods to go with the existing logicalLeft and logicalRight ones. * platform/graphics/FractionalLayoutRect.h: (WebCore::FractionalLayoutRect::expand): Add FractionalLayoutBoxExtent version of expand method. * rendering/InlineFlowBox.cpp: (WebCore::InlineFlowBox::addBorderOutsetVisualOverflow): Change implementation to use the new FractionalLayoutBoxExtent version of borderImageOutsets and the logicalTop/Bottom/Left/Right methods. (WebCore::clipRectForNinePieceImageStrip): Change implementation to use the new FractionalLayoutBoxExtent version of borderImageOutsets. * rendering/RenderBox.cpp: (WebCore::RenderBox::maskClipRect): Change implementation to use the new FractionalLayoutBoxExtent version of borderImageOutsets and the new FractionalLayoutRect::expand method. (WebCore::RenderBox::addVisualEffectOverflow): Change implementation to use the new FractionalLayoutBoxExtent version of borderImageOutsets. * rendering/RenderBoxModelObject.cpp: (WebCore::RenderBoxModelObject::paintNinePieceImage): Change implementation to use the new FractionalLayoutBoxExtent version of borderImageOutsets and the new FractionalLayoutRect::expand method. * rendering/style/RenderStyle.h: * rendering/style/RenderStyle.cpp: (WebCore::RenderStyle::imageOutsets): Change getImageOutsets to return a FractionalLayoutBoxExtent object and rename to imageOutsets to match the webkit naming convention for getters. Remove getBorderImageHorizontalOutsets, getBorderImageVerticalOutsets, getBorderImageInlineDirectionOutsets, getImageHorizontalOutsets, getImageVerticalOutsets and getBorderImageBlockDirectionOutsets methods as the same functionality is provided by FractionalLayoutBoxExtent. 2012-07-13 David Hyatt https://bugs.webkit.org/show_bug.cgi?id=91278 Improve block margin estimation function to account for not having a layout and for quirks mode Reviewed by Simon Fraser. * rendering/RenderBlock.cpp: (WebCore::RenderBlock::marginBeforeEstimateForChild): Revise marginBeforeEstimateForChild so that it computes block margins for the grandchild before recurring. This includes the quirks margin information as well. This ensures that the margins are up-to-date when checked, even before the object has had its first layout. * rendering/RenderBlock.h: (WebCore::RenderBlock::setMarginStartForChild): (WebCore::RenderBlock::setMarginEndForChild): (WebCore::RenderBlock::setMarginBeforeForChild): (WebCore::RenderBlock::setMarginAfterForChild): * rendering/RenderBox.cpp: (WebCore::RenderBox::computeBlockDirectionMargins): * rendering/RenderBox.h: (RenderBox): Add consts in order to compile. 2012-07-13 Ryosuke Niwa NodeLists should not invalidate on irreleavnt attribute changes https://bugs.webkit.org/show_bug.cgi?id=91277 Reviewed by Ojan Vafai. Explicitely check the invalidation type and the changed attribute in NodeListNodeData::invalidateCaches and ElementRareData::clearHTMLCollectionCaches to only invalidate node lists affected by the change. Also merged invalidateNodeListsCacheAfterAttributeChanged and invalidateNodeListsCacheAfterChildrenChanged as invalidateNodeListCachesInAncestors since they're almost identical after r122498. In addition, moved shouldInvalidateNodeListForType from Document.cpp to DynamicNodeList.h and renamed it to shouldInvalidateTypeOnAttributeChange since it needs to called in Node.cpp and ElementRareData.h. * dom/Attr.cpp: (WebCore::Attr::setValue): (WebCore::Attr::childrenChanged): * dom/ContainerNode.cpp: (WebCore::ContainerNode::childrenChanged): * dom/Document.cpp: (WebCore::Document::registerNodeListCache): Calls isRootedAtDocument() instead of directly comparing the value of NodeListRootType in order to prepare for the bug 80269. (WebCore::Document::unregisterNodeListCache): Ditto. (WebCore): shouldInvalidateNodeListForType is moved to DynamicNodeList.h (WebCore::Document::shouldInvalidateNodeListCaches): * dom/DynamicNodeList.h: (DynamicNodeListCacheBase): (WebCore::DynamicNodeListCacheBase::shouldInvalidateTypeOnAttributeChange): Moved from Document.cpp. * dom/Element.cpp: (WebCore::Element::attributeChanged): * dom/ElementRareData.h: (WebCore::ElementRareData::clearHTMLCollectionCaches): Takes const QualifiedName* to compare against the invalidation type of HTML collections via shouldInvalidateTypeOnAttributeChange. * dom/Node.cpp: (WebCore::Node::invalidateNodeListCachesInAncestors): Merged invalidateNodeListCachesInAncestors and invalidateNodeListsCacheAfterChildrenChanged. Also pass attrName to clearHTMLCollectionCaches. (WebCore::NodeListsNodeData::invalidateCaches): Compares attrName against the invalidation type of node lists via shouldInvalidateTypeOnAttributeChange. (WebCore): * dom/Node.h: (Node): * dom/NodeRareData.h: (WebCore::NodeRareData::ensureNodeLists): Merged NodeRareData::createNodeLists. (WebCore::NodeRareData::clearChildNodeListCache): Moved from Node.cpp. (NodeRareData): * html/HTMLCollection.h: (HTMLCollectionCacheBase): 2012-07-13 Arpita Bahuguna Refactor RenderTable to use the section's iteration functions. https://bugs.webkit.org/show_bug.cgi?id=89751 Reviewed by Julien Chaffraix. Removing anti-pattern wherever possible from RenderTable code. Also, modifying RenderTable sections' iterations to use helper functions. No new tests required for this change since no change in behavior is expected. * rendering/RenderTable.cpp: (WebCore::RenderTable::addOverflowFromChildren): (WebCore::RenderTable::setCellLogicalWidths): (WebCore::RenderTable::outerBorderStart): (WebCore::RenderTable::outerBorderEnd): Removed anti-patterns involving iterations over RenderObjects. (WebCore::RenderTable::outerBorderAfter): Modified RenderTable sections' iteration to use helper functions. 2012-07-13 Enrica Casucci Threadsafety issues in WebScriptObject https://bugs.webkit.org/show_bug.cgi?id=90849 Reviewed by Geoff Garen. Updated fix for this bug. The JSC API lock needs to be acquired also in JSObject. * bindings/objc/WebScriptObject.mm: (-[WebScriptObject JSObject]): 2012-07-13 Raymond Toy DelayNode doesn't work if delayTime.value == delayTime.maxValue https://bugs.webkit.org/show_bug.cgi?id=90357 Reviewed by Kenneth Russell. Increase delay buffer size slightly so that the read and write pointers don't become equal when the delay and the max delay are the same. Tests: webaudio/delaynode-max-default-delay.html webaudio/delaynode-max-nondefault-delay.html * Modules/webaudio/DelayDSPKernel.cpp: (WebCore): Moved SmoothingTimeConstant to WebCore namespace. (WebCore::DelayDSPKernel::DelayDSPKernel): Add some additional checks to prevent crashes; use bufferLengthForDelay to compute buffer length. (WebCore::DelayDSPKernel::bufferLengthForDelay): New function to compute buffer length. * Modules/webaudio/DelayDSPKernel.h: (DelayDSPKernel): Declare bufferLengthForDelay. 2012-07-13 Benjamin Poulain Always aggressively preload on iOS https://bugs.webkit.org/show_bug.cgi?id=91276 Reviewed by Simon Fraser. * loader/cache/CachedResourceLoader.cpp: (WebCore::CachedResourceLoader::preload): 2012-07-13 Vineet Chaudhary Restructure V8Utilities::extractTransferables() with help of toV8Sequence() https://bugs.webkit.org/show_bug.cgi?id=91208 Reviewed by Kentaro Hara. We can remove the specialised check for MessagePort from V8Utilities::extractTransferables() using toV8Sequence() as it validates the passed object for sequence type per WebIDL spec. No new test as just refactoring. Existing tests under fast/dom/Window/window-* fast/dom/events/* covers tests. * bindings/v8/V8Utilities.cpp: (WebCore::extractTransferables): 2012-07-13 Vincent Scheib Pointer Lock handles disconnected DOM elements https://bugs.webkit.org/show_bug.cgi?id=77029 Reviewed by Adrienne Walker. Pointer Lock Controller now checks when elements or documents are removed, and unlocks if the target element is being removed. Tests: pointer-lock/locked-element-iframe-removed-from-dom.html pointer-lock/locked-element-removed-from-dom.html * dom/Document.cpp: (WebCore::Document::detach): * dom/Element.cpp: (WebCore::Element::removedFrom): (WebCore::Element::webkitRequestPointerLock): * page/PointerLockController.cpp: (WebCore::PointerLockController::requestPointerLock): (WebCore::PointerLockController::elementRemoved): (WebCore): (WebCore::PointerLockController::documentDetached): (WebCore::PointerLockController::didLosePointerLock): (WebCore::PointerLockController::enqueueEvent): * page/PointerLockController.h: (WebCore): (PointerLockController): 2012-07-13 Ryosuke Niwa HTMLCollection should use DynamicNodeList's invalidation model https://bugs.webkit.org/show_bug.cgi?id=90326 Reviewed by Anders Carlsson. Make HTMLCollection invalidated upon attribute and children changes instead of invalidating it on demand by comparing DOM tree versions. Node that HTMLCollections owned by Document are invalidated with other document-rooted node lists in m_listsInvalidatedAtDocument for simplicity although this mechanism is normally used for node lists owned by a non-Document node that contains nodes outside of its subtree. ItemProperties and FormControls are more "traditional" users of the mechanism. Also, merged DynamicNodeList::invalidateCache and HTMLCollection::invalidateCache. * dom/Document.cpp: (WebCore::Document::registerNodeListCache): Renamed. No longer takes NodeListInvalidationType or NodeListRootType since they can be obtained from the cache base. Increment the node list counter for InvalidateOnIdNameAttrChange when a HTMLCollection is passed in since all HTMLCollections need to be invalidated on id or name content attribute changes due to named getters. (WebCore::Document::unregisterNodeListCache): Ditto. (WebCore::shouldInvalidateNodeListForType): (WebCore::Document::shouldInvalidateNodeListCaches): (WebCore::Document::clearNodeListCaches): * dom/Document.h: (WebCore): Added InvalidateOnIdNameAttrChange, InvalidateOnHRefAttrChange, and InvalidateOnAnyAttrChange. (Document): * dom/DynamicNodeList.cpp: (WebCore::DynamicNodeListCacheBase::invalidateCache): Added. Invalidates caches of both DynamicNodeList and HTMLCollection. We can't afford to use virtual function calls here because this function is called on all node lists and HTML collections owned by ancestors of an element under which a node is added, removed, or its attributes are changed. (WebCore): * dom/DynamicNodeList.h: (WebCore::DynamicNodeListCacheBase::DynamicNodeListCacheBase): Initializes member variables directly instead of calling clearCache now that DynamicNodeListCacheBase::invalidateCache has become polymorphic. (DynamicNodeListCacheBase): Increased the number of bits for m_invalidationType since we now have 9 invalidation types. (WebCore::DynamicSubtreeNodeList::~DynamicSubtreeNodeList): (WebCore::DynamicSubtreeNodeList::DynamicSubtreeNodeList): * dom/ElementRareData.h: (ElementRareData): (WebCore::ElementRareData::clearHTMLCollectionCaches): Added. (WebCore::ElementRareData::adoptTreeScope): Added; similar to NodeRareData::adoptTreeScope. * dom/Node.cpp: (WebCore::Node::invalidateNodeListsCacheAfterAttributeChanged): Clears HTML collection caches as well as node list caches. (WebCore::Node::invalidateNodeListsCacheAfterChildrenChanged): Ditto. * dom/NodeRareData.h: (WebCore::NodeListsNodeData::adoptTreeScope): * dom/TreeScopeAdopter.cpp: (WebCore::TreeScopeAdopter::moveTreeToNewScope): Calls ElementRareData's adoptTreeScope as well as NodeRareData's. * html/HTMLAllCollection.cpp: (WebCore::HTMLAllCollection::namedItemWithIndex): * html/HTMLCollection.cpp: (WebCore::rootTypeFromCollectionType): Added. As mentioned above, treat all Document-owned HTML collection as if rooted at document for convenience. (WebCore::invalidationTypeExcludingIdAndNameAttributes): Added. Since all HTML collection requires invalidation on id and name content attribute changes, which is taken care by the special logic in Document::registerNodeListCache, exclude those two attributes from consideration. (WebCore::HTMLCollection::HTMLCollection): Calls Document::registerNodeListCache. (WebCore::HTMLCollection::~HTMLCollection): Calls Document::unregisterNodeListCache. (WebCore::HTMLCollection::length): (WebCore::HTMLCollection::item): (WebCore::HTMLCollection::namedItem): (WebCore::HTMLCollection::updateNameCache): * html/HTMLCollection.h: (WebCore::HTMLCollectionCacheBase::HTMLCollectionCacheBase): (HTMLCollectionCacheBase): Removed m_cacheTreeVersion and clearCache since they're no longer used. (HTMLCollection): * html/HTMLFormCollection.cpp: (WebCore::HTMLFormCollection::namedItem): (WebCore::HTMLFormCollection::updateNameCache): * html/HTMLOptionsCollection.h: (HTMLOptionsCollection): * html/HTMLPropertiesCollection.cpp: (WebCore::HTMLPropertiesCollection::updateNameCache): * html/HTMLPropertiesCollection.h: (WebCore::HTMLPropertiesCollection::invalidateCache): 2012-07-13 Shawn Singh [chromium] Remove incorrect debug assertion in LayerRendererChromium.cpp https://bugs.webkit.org/show_bug.cgi?id=91260 Reviewed by Adrienne Walker. ASSERT(!clipped) was being triggered after skinny almost-degenerate quads went through anti-aliasing inflation, and then were being transformed back from device space to local space. It turns out this assertion is too aggressive, and we don't yet have an obvious need to change the behavior on the clipped==true case. No new tests needed, this patch fixes only comments and debug code. * platform/graphics/chromium/LayerRendererChromium.cpp: (WebCore::LayerRendererChromium::drawRenderPassQuad): fixed a comment. (WebCore::LayerRendererChromium::drawTileQuad): fixed a similar comment, removed unnecessary assertion. 2012-07-13 Philip Rogers Remove assert in localCoordinateSpaceTransform() https://bugs.webkit.org/show_bug.cgi?id=91189 Reviewed by Nikolas Zimmermann. The assert in localCoordinateSpaceTransform was added to catch subclasses forgetting to override the method but it is better to simply return the identity matrix. This scenario can occur when we break the SVG content model, such as asking for the CTM of a element inside a . This is undefined in the spec because tspan is not a subclass of SVGLocatable but both Firefox and Opera implement this by returning the identity matrix. Test: svg/custom/invalid-ctm.svg * svg/SVGStyledElement.cpp: (WebCore::SVGStyledElement::localCoordinateSpaceTransform): 2012-07-13 Kentaro Hara [V8] String wrappers should be marked Independent https://bugs.webkit.org/show_bug.cgi?id=91251 Reviewed by Adam Barth. Currently V8 String wrappers are not marked Independent. By marking them Independent, they can be reclaimed by the scavenger GC. I tried to find some cases where this change reduces memory usage, but couldn't due to sensitive behavior of GC. No tests. No change in behavior. * bindings/v8/V8Binding.cpp: (WebCore::StringCache::v8ExternalStringSlow): 2012-07-13 Peter Beverloo [Chromium] Make the v8 i18n API dependency conditional for Android, disable strict aliasing https://bugs.webkit.org/show_bug.cgi?id=91240 Reviewed by Adam Barth. Disable the v8 internationalization API for Chromium Android, as it's disabled and not always available in checkouts. Furthermore, disable strict aliasing for the webkit_remaining target, similar to what x11-based builds are doing (see the webcore_prerequisites target). * WebCore.gyp/WebCore.gyp: 2012-07-13 Kentaro Hara [CallWith=XXX] arguments should be placed at the head of method arguments https://bugs.webkit.org/show_bug.cgi?id=91217 Reviewed by Adam Barth. The EFL build with the ENABLE_FILE_SYSTEM flag caused a build error, because CodeGeneratorJS.pm assumes webkitEntries(ScriptExecutionContext*, HTMLInputElement*) but the actual signature is webkitEntries(HTMLInputElement*, ScriptExecutionContext*) (bug 91185). Per https://trac.webkit.org/wiki/WebKitIDL#CallWith, [CallWith=XXX] arguments should be placed at the head of the arguments. (i.e. the behavior of CodeGeneratorJS.pm is correct.) Thus the correct fix is (1) to change the signature of webkitEntries() and webkitGetAsEntry() so that ScriptExecutionContext* comes first and (2) to modify CodeGeneratorV8.pm to support the order. Test: bindings/scripts/test/TestObj.idl * Modules/filesystem/DataTransferItemFileSystem.h: Placed ScriptExecutionContext* at the head of arguments. (DataTransferItemFileSystem): * Modules/filesystem/HTMLInputElementFileSystem.cpp: Ditto. (WebCore::HTMLInputElementFileSystem::webkitEntries): * Modules/filesystem/HTMLInputElementFileSystem.h: Ditto. (HTMLInputElementFileSystem): * Modules/filesystem/chromium/DataTransferItemFileSystemChromium.cpp: Ditto. (WebCore::DataTransferItemFileSystem::webkitGetAsEntry): * bindings/scripts/CodeGeneratorV8.pm: Modified to support the correct order. (GenerateNormalAttrGetter): (GenerateNormalAttrSetter): (GenerateFunctionCallString): * bindings/scripts/test/V8/V8TestInterface.cpp: Updated run-bindings-tests results. (WebCore::TestInterfaceV8Internal::supplementalMethod2Callback): 2012-07-13 Mary Wu [BlackBerry] Some small changes in network code https://bugs.webkit.org/show_bug.cgi?id=90974 Reviewed by Rob Buis. 1. Set status in NetworkJob/SocketStreamHandleBlackBerry so that its wrapped stream can also query the stream result. 2. pass download attribute to NetworkRequest. RIM PR# 171555 Reviewed internally by Lyon Chen and Joe Mason. * platform/network/blackberry/NetworkJob.cpp: (WebCore::NetworkJob::handleNotifyClose): * platform/network/blackberry/NetworkJob.h: (WebCore::NetworkJob::status): * platform/network/blackberry/ResourceRequestBlackBerry.cpp: (WebCore::platformTargetTypeForRequest): * platform/network/blackberry/SocketStreamHandle.h: (WebCore::SocketStreamHandle::status): (SocketStreamHandle): * platform/network/blackberry/SocketStreamHandleBlackBerry.cpp: (WebCore::SocketStreamHandle::notifyStatusReceived): (WebCore::SocketStreamHandle::notifyClose): 2012-07-13 Vsevolod Vlasov Web Inspector: Remove uiSourceCode from Resource. https://bugs.webkit.org/show_bug.cgi?id=91201 Reviewed by Pavel Feldman. Removed Resource._uiSourceCode field as it is not used anymore. * inspector/front-end/Resource.js: (WebInspector.Resource.prototype.isHidden): * inspector/front-end/UISourceCode.js: (WebInspector.UISourceCode): 2012-07-13 Sheriff Bot Unreviewed, rolling out r122450 and r122580. http://trac.webkit.org/changeset/122450 http://trac.webkit.org/changeset/122580 https://bugs.webkit.org/show_bug.cgi?id=91263 Caused multiple regressions on ClusterFuzz (Requested by inferno-sec on #webkit). * bindings/js/ScriptWrappable.h: (WebCore::ScriptWrappable::reportMemoryUsage): * bindings/v8/DOMDataStore.cpp: (WebCore::DOMDataStore::reportMemoryUsage): * bindings/v8/IntrusiveDOMWrapperMap.h: (WebCore::ChunkedTable::reportMemoryUsage): * bindings/v8/ScriptWrappable.h: (WebCore::ScriptWrappable::reportMemoryUsage): * bindings/v8/V8Binding.cpp: (WebCore::V8BindingPerIsolateData::reportMemoryUsage): (WebCore::StringCache::reportMemoryUsage): * bindings/v8/V8DOMMap.h: * css/PropertySetCSSStyleDeclaration.cpp: (WebCore::InlineCSSStyleDeclaration::ensureMutablePropertySet): * css/StylePropertySet.cpp: * css/StylePropertySet.h: (WebCore::StylePropertySet::reportMemoryUsage): * dom/CharacterData.cpp: (WebCore::CharacterData::reportMemoryUsage): * dom/ContainerNode.h: (WebCore::ContainerNode::reportMemoryUsage): * dom/Document.cpp: (WebCore::Document::reportMemoryUsage): * dom/Element.cpp: (WebCore::Element::detachAttribute): (WebCore::Element::removeAttribute): (WebCore::Element::attributes): (WebCore::Element::setAttributeInternal): (WebCore::Element::parserSetAttributes): (WebCore::Element::hasEquivalentAttributes): (WebCore::Element::createAttributeData): (WebCore): (WebCore::Element::setAttributeNode): (WebCore::Element::removeAttributeNode): (WebCore::Element::getAttributeNode): (WebCore::Element::getAttributeNodeNS): (WebCore::Element::hasAttribute): (WebCore::Element::hasAttributeNS): (WebCore::Element::normalizeAttributes): (WebCore::Element::cloneAttributesFromElement): * dom/Element.h: (WebCore::Element::attributeData): (Element): (WebCore::Element::reportMemoryUsage): (WebCore::Element::ensureAttributeData): (WebCore::Element::updatedAttributeData): (WebCore::Element::ensureUpdatedAttributeData): * dom/ElementAttributeData.cpp: (WebCore::ElementAttributeData::attrIfExists): (WebCore::ElementAttributeData::ensureAttr): (WebCore::ElementAttributeData::setAttr): (WebCore::ElementAttributeData::removeAttr): (WebCore::ElementAttributeData::setClass): (WebCore): (WebCore::ElementAttributeData::ensureInlineStyle): (WebCore::ElementAttributeData::ensureMutableInlineStyle): (WebCore::ElementAttributeData::destroyInlineStyle): (WebCore::ElementAttributeData::addAttribute): (WebCore::ElementAttributeData::removeAttribute): (WebCore::ElementAttributeData::isEquivalent): (WebCore::ElementAttributeData::detachAttrObjectsFromElement): (WebCore::ElementAttributeData::getAttributeItemIndexSlowCase): (WebCore::ElementAttributeData::cloneDataFrom): (WebCore::ElementAttributeData::clearAttributes): (WebCore::ElementAttributeData::replaceAttribute): (WebCore::ElementAttributeData::getAttributeNode): * dom/ElementAttributeData.h: (WebCore::ElementAttributeData::create): (ElementAttributeData): (WebCore::ElementAttributeData::setIdForStyleResolution): (WebCore::ElementAttributeData::setAttributeStyle): (WebCore::ElementAttributeData::length): (WebCore::ElementAttributeData::isEmpty): (WebCore::ElementAttributeData::attributeItem): (WebCore::ElementAttributeData::getAttributeItem): (WebCore::ElementAttributeData::reportMemoryUsage): (WebCore::ElementAttributeData::ElementAttributeData): (WebCore::ElementAttributeData::attributeVector): (WebCore::ElementAttributeData::clonedAttributeVector): (WebCore::ElementAttributeData::removeAttribute): (WebCore::ElementAttributeData::getAttributeItemIndex): * dom/MemoryInstrumentation.h: (MemoryInstrumentation): (MemoryObjectInfo): (WebCore::MemoryObjectInfo::reportInstrumentedPointer): (WebCore::MemoryObjectInfo::reportPointer): (WebCore::MemoryObjectInfo::reportInstrumentedObject): (WebCore::MemoryObjectInfo::reportObject): (WebCore::MemoryObjectInfo::reportObjectInfo): (WebCore::MemoryObjectInfo::reportHashMap): (WebCore::MemoryObjectInfo::reportHashSet): (WebCore::MemoryObjectInfo::reportListHashSet): (WebCore::MemoryObjectInfo::reportVector): (WebCore::MemoryObjectInfo::reportString): (WebCore::MemoryObjectInfo::objectType): (WebCore::MemoryObjectInfo::objectSize): (WebCore::MemoryObjectInfo::memoryInstrumentation): * dom/Node.cpp: (WebCore::Node::reportMemoryUsage): * dom/QualifiedName.h: (WebCore::QualifiedName::QualifiedNameImpl::reportMemoryUsage): (WebCore::QualifiedName::reportMemoryUsage): * dom/StyledElement.cpp: (WebCore::StyledElement::style): (WebCore::StyledElement::classAttributeChanged): (WebCore::StyledElement::setInlineStyleProperty): (WebCore::StyledElement::removeInlineStyleProperty): (WebCore::StyledElement::addSubresourceAttributeURLs): * dom/StyledElement.h: (WebCore::StyledElement::ensureInlineStyle): * html/parser/HTMLConstructionSite.cpp: (WebCore::HTMLConstructionSite::createHTMLElementFromSavedElement): * platform/TreeShared.h: (WebCore::TreeShared::reportMemoryUsage): * xml/parser/XMLDocumentParserQt.cpp: (WebCore::XMLDocumentParser::XMLDocumentParser): 2012-07-13 Huang Dongsung Remove down-casting to BitmapImage in GraphicsContext::drawImage. https://bugs.webkit.org/show_bug.cgi?id=90755 Reviewed by Simon Fraser. Add a BitmapImage draw method which takes RespectImageOrientationEnum enum as the last argument for CG. Then we can remove the conditional down-casting in GraphicsContext::drawImage. This change is needed for parallel image decoders. Because parallel image decoders use a Bitmap image wrapper class which extends Image (not Bitmap), the down-casting above causes the loss of RespectImageOrientationEnum which must be passed to BitmapImage. No new tests, no behavior change. * platform/graphics/BitmapImage.cpp: * platform/graphics/BitmapImage.h: * platform/graphics/GraphicsContext.cpp: (WebCore::GraphicsContext::drawImage): * platform/graphics/Image.cpp: (WebCore::Image::draw): (WebCore): * platform/graphics/Image.h: (Image): 2012-07-13 Lauro Neto Fix QtWebKit build with OpenGLES after GC3D/E3D refactor https://bugs.webkit.org/show_bug.cgi?id=91156 Reviewed by Noam Rosenthal. Adds several build fixes. * platform/graphics/GraphicsContext3D.h: Use E3DOpenGLES instead of previously removed E3DQt. * platform/graphics/OpenGLESShims.h: Enable defines for Qt. * platform/graphics/opengl/Extensions3DOpenGLES.cpp: (WebCore::Extensions3DOpenGLES::blitFramebuffer): (WebCore): (WebCore::Extensions3DOpenGLES::renderbufferStorageMultisample): (WebCore::Extensions3DOpenGLES::copyTextureCHROMIUM): Added pure virtual stubs. (WebCore::Extensions3DOpenGLES::supportsExtension): Remove PROC suffix. See bug #91130. * platform/graphics/opengl/Extensions3DOpenGLES.h: (Extensions3DOpenGLES): Added pure virtual stubs. * platform/graphics/opengl/GraphicsContext3DOpenGLES.cpp: (WebCore::GraphicsContext3D::reshapeFBOs): Readded missing function after removed in r122250. (WebCore): Use PLATFORM(BLACKBERRY) guard around port-specific include. * platform/graphics/qt/GraphicsContext3DQt.cpp: Added USE(OPENGL_ES_2) guard instead of always loading the OpenGL extensions. 2012-07-13 Keishi Hattori Form of FormAssociatedElement is not updated when id target changes. https://bugs.webkit.org/show_bug.cgi?id=91042 Reviewed by Kent Tamura. Test: fast/forms/update-form-attribute-element.html This patch introduces the IdTargetObserver and IdTargetObserverRegistry class. They can be used to be notified when the element that an id is pointing to (the id target) changes. * CMakeLists.txt: Added IdTargetObserverRegistry.{h,cpp} and IdTargetObserver.{h,cpp} * GNUmakefile.list.am: Ditto. * Target.pri: Ditto. * WebCore.gypi: Ditto. * WebCore.vcproj/WebCore.vcproj: Ditto. * WebCore.xcodeproj/project.pbxproj: Ditto. * dom/DOMAllInOne.cpp: * dom/IdTargetObserver.cpp: Added. When you want notified of changes to an id target, you should create a new class that inherits this. (WebCore): (WebCore::IdTargetObserver::IdTargetObserver): (WebCore::IdTargetObserver::~IdTargetObserver): * dom/IdTargetObserver.h: Added. (WebCore): (IdTargetObserver): * dom/IdTargetObserverRegistry.cpp: Added. (WebCore): (WebCore::IdTargetObserverRegistry::create): (WebCore::IdTargetObserverRegistry::addObserver): Register an IdTargetObserver to observe an id target. (WebCore::IdTargetObserverRegistry::removeObserver): Unregisters an IdTargetObserver from observing. (WebCore::IdTargetObserverRegistry::notifyObserversInternal): * dom/IdTargetObserverRegistry.h: Added. (WebCore): (IdTargetObserverRegistry): (WebCore::IdTargetObserverRegistry::IdTargetObserverRegistry): (WebCore::IdTargetObserverRegistry::notifyObservers): Calls idTargetChanged on all observers for an id. Inlining first part of function for performance. * dom/TreeScope.cpp: (WebCore::TreeScope::TreeScope): (WebCore::TreeScope::addElementById): Calls IdTargetObserverRegistry::notifyObservers because the id target might have changed. (WebCore::TreeScope::removeElementById): Ditto. * dom/TreeScope.h: (WebCore): (WebCore::TreeScope::idTargetObserverRegistry): (TreeScope): * html/FormAssociatedElement.cpp: Observer for id targets defined by the form attribute. (WebCore::FormAssociatedElement::didMoveToNewDocument): (WebCore::FormAssociatedElement::insertedInto): (WebCore::FormAssociatedElement::removedFrom): (WebCore::FormAssociatedElement::formAttributeChanged): (WebCore::FormAssociatedElement::resetFormAttributeTargetObserver): Creates and sets up a new FormAttributeTargetObserver. (WebCore): (WebCore::FormAssociatedElement::formAttributeTargetChanged): (WebCore::FormAttributeTargetObserver::create): (WebCore::FormAttributeTargetObserver::FormAttributeTargetObserver): (WebCore::FormAttributeTargetObserver::idTargetChanged): * html/FormAssociatedElement.h: (FormAssociatedElement): * html/FormController.cpp: * html/FormController.h: (FormController): * html/HTMLFormElement.cpp: (WebCore::HTMLFormElement::removedFrom): (WebCore::HTMLFormElement::formElementIndexWithFormAttribute): Modified to take a range. It scans the range and returns the index to insert the element in m_associatedElement. (WebCore::HTMLFormElement::formElementIndex): Modified to only scan the elements in m_associatedElement that precede and follow the form element. * html/HTMLFormElement.h: (HTMLFormElement): 2012-07-13 Gabor Rapcsanyi Optimizing blend filter to ARM-NEON with intrinsics https://bugs.webkit.org/show_bug.cgi?id=90949 Reviewed by Zoltan Herczeg. The feBlend SVG filter modes can be greatly fasten up with ARM-NEON since we are able to calculate with 2 pixels (8 channels) at the same time. The code is written with NEON intrinsics and it doesn't affect the general - it has the same behaviour as the original algorithm. With this NEON optimization the calculation is ~4.5 times faster for each mode. Existing tests cover this issue. * CMakeLists.txt: * GNUmakefile.list.am: * Target.pri: * WebCore.gypi: * WebCore.vcproj/WebCore.vcproj: * WebCore.xcodeproj/project.pbxproj: * platform/graphics/filters/FEBlend.cpp: (WebCore::FEBlend::platformApplyGeneric): (WebCore): (WebCore::FEBlend::platformApplySoftware): * platform/graphics/filters/FEBlend.h: (FEBlend): * platform/graphics/filters/arm/FEBlendNEON.h: Added. (WebCore): (FEBlendUtilitiesNEON): (WebCore::FEBlendUtilitiesNEON::div255): integer divison with 255 (WebCore::FEBlendUtilitiesNEON::normal): calculate normal mode blending for two pixels (WebCore::FEBlendUtilitiesNEON::multiply): calculate multiply mode blending for two pixels (WebCore::FEBlendUtilitiesNEON::screen): calculate screen mode blending for two pixels (WebCore::FEBlendUtilitiesNEON::darken): calculate darken mode blending for two pixels (WebCore::FEBlendUtilitiesNEON::lighten): calculate lighten mode blending for two pixels (WebCore::FEBlend::platformApplyNEON): 2012-07-13 Ilya Tikhonovsky Web Inspector: native memory instrumentation: extract instrumentation methods into MemoryClassInfo https://bugs.webkit.org/show_bug.cgi?id=91227 Reviewed by Pavel Feldman. void Node::reportMemoryUsage(MemoryObjectInfo* memoryObjectInfo) const { MemoryClassInfo info(memoryObjectInfo, this, MemoryInstrumentation::DOM); info.visitBaseClass(this); info.addMember(m_notInstrumentedPointer); // automatically detects poniter/reference info.addInstrumentedMember(m_next); info.addHashSet(m_aHash); // NonClass value_type (report only size of internal template structures) info.addHashSet(m_aHashSet); // not instrumented value_type (use sizeof) info.addHashSet(m_aHashSet); // instrumented value_type (call visit) } The change is covered by existing tests for native memory snapshot. * bindings/v8/DOMDataStore.cpp: (WebCore::DOMDataStore::reportMemoryUsage): * bindings/v8/IntrusiveDOMWrapperMap.h: (WebCore::ChunkedTable::reportMemoryUsage): * bindings/v8/ScriptWrappable.h: (WebCore::ScriptWrappable::reportMemoryUsage): * bindings/v8/V8Binding.cpp: (WebCore::V8BindingPerIsolateData::reportMemoryUsage): (WebCore::StringCache::reportMemoryUsage): * bindings/v8/V8DOMMap.h: * css/StylePropertySet.h: (WebCore::StylePropertySet::reportMemoryUsage): * dom/CharacterData.cpp: (WebCore::CharacterData::reportMemoryUsage): * dom/ContainerNode.h: (WebCore::ContainerNode::reportMemoryUsage): * dom/Document.cpp: (WebCore::Document::reportMemoryUsage): * dom/Element.h: (WebCore::Element::reportMemoryUsage): * dom/ElementAttributeData.h: (WebCore::ElementAttributeData::reportMemoryUsage): * dom/MemoryInstrumentation.h: (MemoryInstrumentation): (WebCore::MemoryObjectInfo::objectType): (WebCore::MemoryObjectInfo::objectSize): (WebCore::MemoryObjectInfo::memoryInstrumentation): (MemoryObjectInfo): (WebCore::MemoryObjectInfo::reportObjectInfo): (WebCore): (MemoryClassInfo): (WebCore::MemoryClassInfo::MemoryClassInfo): (WebCore::MemoryClassInfo::visitBaseClass): (WebCore::MemoryClassInfo::reportInstrumentedPointer): (WebCore::MemoryClassInfo::reportInstrumentedObject): (WebCore::MemoryClassInfo::reportPointer): (WebCore::MemoryClassInfo::reportObject): (WebCore::MemoryClassInfo::reportHashMap): (WebCore::MemoryClassInfo::reportHashSet): (WebCore::MemoryClassInfo::reportListHashSet): (WebCore::MemoryClassInfo::reportVector): (WebCore::MemoryClassInfo::reportString): * dom/Node.cpp: (WebCore::Node::reportMemoryUsage): * dom/QualifiedName.h: (WebCore::QualifiedName::QualifiedNameImpl::reportMemoryUsage): (WebCore::QualifiedName::reportMemoryUsage): * platform/TreeShared.h: (WebCore::TreeShared::reportMemoryUsage): 2012-07-13 Pavel Feldman Web Inspector: align scope filters https://bugs.webkit.org/show_bug.cgi?id=91213 Reviewed by Vsevolod Vlasov. * inspector/front-end/elementsPanel.css: (.crumbs): * inspector/front-end/inspector.css: (.status-bar > div): (.scope-bar): (.scope-bar li): (.scope-bar li.all): * inspector/front-end/networkLogView.css: 2012-07-13 Peter Rybin Web Inspector: too many hardcoded strings in InspectorBackendDispatcher. https://bugs.webkit.org/show_bug.cgi?id=89198 Reviewed by Yury Semikhatsky. Instead of generating error message string on every call (mostly for nothing), error message is generated deeper inside the handler and only command name is passed every time. * inspector/CodeGeneratorInspector.py: (Generator.process_command): 2012-07-13 Joshua Netterfield [BlackBerry] Update about:* pages https://bugs.webkit.org/show_bug.cgi?id=91121 Reviewed by Yong Li. Update the about:config pages, and improve the aesthetics of the about:build, about:version, about:credits, about:memory, about:config, and similar pages. No new tests, because there is no new funtionality. * platform/network/blackberry/NetworkJob.cpp: Update the aesthetics of about:* pages 2012-07-13 Olivier Blin Fix checking for optional DeviceOrientationEvent.absolute in JSC bindings https://bugs.webkit.org/show_bug.cgi?id=91225 Reviewed by Steve Block. This issue comes from r105036 * bindings/js/JSDeviceOrientationEventCustom.cpp: (WebCore::JSDeviceOrientationEvent::initDeviceOrientationEvent): 2012-07-13 Andrei Bucur [CSS Regions] Fix build for bug 89000 https://bugs.webkit.org/show_bug.cgi?id=91215 Reviewed by Kentaro Hara. Remove the unused variable m_state that was a leftover from a previous version of the patch. Tests: No new tests, build fix. * dom/WebKitNamedFlow.cpp: (WebCore::WebKitNamedFlow::WebKitNamedFlow): * dom/WebKitNamedFlow.h: (WebKitNamedFlow): 2012-07-13 Kenichi Ishibashi [Chromium] Fix bugs in HarfBuzzShaper https://bugs.webkit.org/show_bug.cgi?id=90951 Reviewed by Tony Chang. The current implementation has following problems: - Cannot render RTL text if the TextRun is divided into more than two HarfBuzzRun. - Script handling in TextRun partitioning is incorrect. - Inaccurate calculation of selection rect. - Wrong rendering position when the first glyph of the TextRun have non-zero offsets in terms of HarfBuzz. To fix these problems I rewrote HarfBuzzShaper class. Here is the summary: - Divide the whole range of TextRun first, then shape them in visual order. - Divide TextRun in the same way of old-harfbuzz's hb_utf16_script_run_next(). - Prefer float than int when calculating selection. - Adjust the drawing point after shaping. Added tests covers the fix except for the last problem. The last problem will be covered by fast/text/international/complex-joining-using-gpos.html after chromium linux port switches to use HarfBuzzShaper. Tests: fast/text/shaping/shaping-script-order.html fast/text/shaping/shaping-selection-rect.html * platform/graphics/harfbuzz/FontHarfBuzz.cpp: (WebCore::Font::drawComplexText): Adjusts point after shaping. * platform/graphics/harfbuzz/ng/HarfBuzzShaper.cpp: (WebCore::HarfBuzzShaper::HarfBuzzRun::HarfBuzzRun): (WebCore): (WebCore::HarfBuzzShaper::HarfBuzzRun::applyShapeResult): Added. (WebCore::HarfBuzzShaper::HarfBuzzRun::setGlyphAndAdvance): Offsets are no longer needed. (WebCore::HarfBuzzShaper::HarfBuzzRun::xPositionForOffset): Calculates character offset based on advance. (WebCore::normalizeCharacters): Added. (WebCore::HarfBuzzShaper::HarfBuzzShaper): (WebCore::HarfBuzzShaper::~HarfBuzzShaper): (WebCore::HarfBuzzShaper::shape): Divides TextRun first, then shapes them. (WebCore::HarfBuzzShaper::adjustStartPoint): Added. (WebCore::HarfBuzzShaper::collectHarfBuzzRuns): Added. (WebCore::HarfBuzzShaper::shapeHarfBuzzRuns): Added. (WebCore::HarfBuzzShaper::setGlyphPositionsForHarfBuzzRun): Followed other changes. (WebCore::HarfBuzzShaper::selectionRect): Use float for calculating selection. * platform/graphics/harfbuzz/ng/HarfBuzzShaper.h: (HarfBuzzShaper): Holds the start index of character. Removed unnecessary variables. (WebCore::HarfBuzzShaper::HarfBuzzRun::create): Ditto. (HarfBuzzRun): (WebCore::HarfBuzzShaper::HarfBuzzRun::fontData): Added. (WebCore::HarfBuzzShaper::HarfBuzzRun::startIndex): Ditto. (WebCore::HarfBuzzShaper::HarfBuzzRun::glyphs): Ditto. (WebCore::HarfBuzzShaper::HarfBuzzRun::advances): Ditto. 2012-07-13 Kentaro Hara Unreviewed, rolling out r122545. http://trac.webkit.org/changeset/122545 https://bugs.webkit.org/show_bug.cgi?id=91185 We found that this was a wrong fix * bindings/scripts/CodeGeneratorJS.pm: (GenerateImplementation): 2012-07-13 Kentaro Hara Unreviewed, rolling out r122553. http://trac.webkit.org/changeset/122553 https://bugs.webkit.org/show_bug.cgi?id=91198 We found that this was a wrong fix * bindings/scripts/CodeGeneratorJS.pm: (GenerateImplementation): 2012-07-13 Kent Tamura Change the timing of form state restore https://bugs.webkit.org/show_bug.cgi?id=89962 Reviewed by Hajime Morita. For a preparation to fix a form identification problem (Bug 91209), restore controls states when the parsing of their owner forms is completed. For controls without owners, their states are restored when their parsing is completed as ever. No new tests. This doesn't change observable behavior. * html/FormController.cpp: (WebCore::ownerFormForState): Added. This code was used in formKey(), and restoreControlState*() use it. (WebCore::FormKeyGenerator::formKey): Use ownerFormForState(). No behavior change. (WebCore::FormController::restoreControlStateFor): Moved some code from HTMLFormControlElementWithState::finishParsingChildren(). The difference is we don't resotre state if this control is owned by a form. (WebCore::FormController::restoreControlStateIn): Restore states of associated controls. This is called from finishParsingChildren() for
. * html/FormController.h: (FormController): - Declare restoreControlStateFor() and restoreControlStateIn(). - Make takeStateForFormElement() private. * html/FormAssociatedElement.cpp: (WebCore::FormAssociatedElement::isFormControlElementWithState): Added. The default implementation returns false. * html/FormAssociatedElement.h: (FormAssociatedElement): Added isFormControlElementWithState() for FormController::restoreControlStateIn(). * html/HTMLFormControlElementWithState.cpp: (WebCore::HTMLFormControlElementWithState::finishParsingChildren): Some code was moved to FormController:restoreControlStateFor(). (WebCore::HTMLFormControlElementWithState::isFormControlElementWithState): Added. Returns true. * html/HTMLFormControlElementWithState.h: (HTMLFormControlElementWithState): Declare isFormControlElementWithState(). * html/HTMLFormElement.cpp: (WebCore::HTMLFormElement::finishParsingChildren): Added. Calls FormController::restoreControlStateIn(). * html/HTMLFormElement.h: (HTMLFormElement): Declare finishParsingChildren(). 2012-07-13 Kent Tamura Make calendar pickers testable https://bugs.webkit.org/show_bug.cgi?id=84827 Reviewed by Hajime Morita. WebCore: - Add PagePopupDriver, an interface to open/close a PagePopup. - Add setPagePopupDriver() to ChromeClient in order to inject a PagePopupDriver for testing. Internals: Add MockPagePopupDriver, which creates a MockPagePopup, which creates a normal