2013-06-21 Mark Lam Fixed broken build: updated to match SmallStrings changes in r151864. Not reviewed. No new tests. * bindings/js/JSDOMBinding.h: (WebCore::jsStringWithCache): 2013-06-14 Mark Lam Rolling r151456, r151420 back in with some fixes. https://bugs.webkit.org/show_bug.cgi?id=117390. Reviewed by Geoffrey Garen. No new tests. * ForwardingHeaders/interpreter/StackIterator.h: Copied from Source/WebCore/ForwardingHeaders/interpreter/StackIterator.h. * bindings/js/JSXMLHttpRequestCustom.cpp: (WebCore::JSXMLHttpRequest::send): * bindings/js/ScriptCallStackFactory.cpp: (WebCore::createScriptCallStack): 2013-06-15 Filip Pizlo Concurrent JIT shouldn't try to recompute the CodeBlockHash as part of debug dumps, since doing so may fail if dealing with a CachedScript that doesn't have its script string handy https://bugs.webkit.org/show_bug.cgi?id=117676 Reviewed by Sam Weinig. Remove the broken hack for the concurrent JIT, since now the concurrent JIT won't use this code anymore. No new tests because no new behavior. * loader/cache/CachedScript.cpp: (WebCore::CachedScript::script): 2013-06-12 Mark Lam Unreviewed, rolled out r151456, r151420: It causes layout test failures. 2013-06-10 Mark Lam Introducing the StackIterator class. https://bugs.webkit.org/show_bug.cgi?id=117390. Reviewed by Geoffrey Garen. No new tests. * ForwardingHeaders/interpreter/StackIterator.h: Added. * bindings/js/JSXMLHttpRequestCustom.cpp: (WebCore::JSXMLHttpRequest::send): * bindings/js/ScriptCallStackFactory.cpp: (WebCore::createScriptCallStack): 2013-06-09 Filip Pizlo Unreviewed, fix build. Use at() instead of operator[] because of ambiguity on some compilers. * page/CaptionUserPreferencesMac.mm: (WebCore::languageIdentifier): 2013-06-04 Mark Lam Merged from http://svn.webkit.org/repository/webkit/trunk ------------------------------------------------------------------------ r150160 | oliver@apple.com | 2013-05-15 17:29:25 -0700 (Wed, 15 May 2013) | 42 lines RefCountedArray needs to use vector initialisers for its backing store https://bugs.webkit.org/show_bug.cgi?id=116194 ------------------------------------------------------------------------ 2013-06-03 Mark Lam Merged from http://svn.webkit.org/repository/webkit/trunk ------------------------------------------------------------------------ r148639 | mark.lam@apple.com | 2013-04-17 15:37:45 -0700 (Wed, 17 Apr 2013) | 127 lines Add LLINT and baseline JIT support for timing out scripts. https://bugs.webkit.org/show_bug.cgi?id=114577. ------------------------------------------------------------------------ 2013-06-03 Mark Lam Merged from http://svn.webkit.org/repository/webkit/trunk ------------------------------------------------------------------------ r148119 | ggaren@apple.com | 2013-04-10 11:51:47 -0700 (Wed, 10 Apr 2013) | 106 lines Removed bitrotted TimeoutChecker code https://bugs.webkit.org/show_bug.cgi?id=114336 ------------------------------------------------------------------------ 2013-06-03 Mark Lam Merged from http://svn.webkit.org/repository/webkit/trunk ------------------------------------------------------------------------ r147858 | oliver@apple.com | 2013-04-06 15:47:56 -0700 (Sat, 06 Apr 2013) | 62 lines Unify the many and varied stack trace mechanisms, and make the result sane. https://bugs.webkit.org/show_bug.cgi?id=114072 ------------------------------------------------------------------------ 2013-05-27 Filip Pizlo testRunner should be able to tell you if a function is DFG compiled https://bugs.webkit.org/show_bug.cgi?id=116847 Reviewed by Mark Hahnenberg. Bail early if we're in the compilation thread. This is only relevant for debug dumps. No new tests becase no new behavior. * loader/cache/CachedScript.cpp: (WebCore::CachedScript::script): 2013-05-25 Mark Lam Remove Interpreter::retrieveLastCaller(). https://bugs.webkit.org/show_bug.cgi?id=116753. Reviewed by Geoffrey Garen. This is part of the refactoring effort to get rid of functions walking the JS stack in their own way. No new tests. * bindings/js/JSXMLHttpRequestCustom.cpp: (WebCore::JSXMLHttpRequest::send): * bindings/js/ScriptCallStackFactory.cpp: (WebCore::createScriptCallStack): 2013-05-06 Geoffrey Garen Cherry-pick merged some patches to the FTL branch. Unreviewed. r147184 r147190 r147234 r147658 r147669 r147677 r147887 r147892 r149236 r149247 r149418 2013-05-06 Oliver Hunt Add bounds checking for WTF::Vector::operator[] https://bugs.webkit.org/show_bug.cgi?id=89600 Reviewed by Filip Pizlo. Fix exports * WebCore.exp.in: 2013-05-05 Geoffrey Garen Rolled back in r149527 with crash fixed. Reviewed by Oliver Hunt. Rationalized 'this' value conversion https://bugs.webkit.org/show_bug.cgi?id=115542 2013-05-03 Geoffrey Garen Rolled out r149527 because it caused a crash. Rationalized 'this' value conversion https://bugs.webkit.org/show_bug.cgi?id=115542 2013-05-03 Geoffrey Garen Rationalized 'this' value conversion https://bugs.webkit.org/show_bug.cgi?id=115542 Reviewed by Filip Pizlo. Updated to match JSC requirement that the callee performs 'this' value conversion. * WebCore.order: * bindings/js/JSErrorHandler.cpp: (WebCore::JSErrorHandler::handleEvent): * bindings/js/JSInjectedScriptHostCustom.cpp: (WebCore::JSInjectedScriptHost::internalConstructorName): * bindings/js/JSMainThreadExecState.h: (WebCore::JSMainThreadExecState::call): * bindings/scripts/CodeGeneratorJS.pm: (GenerateImplementation): * bridge/NP_jsobject.cpp: (_NPN_Invoke): 2013-04-29 Filip Pizlo fourthTier: String::utf8() should also be available as StringImpl::utf8() so that you don't have to ref() a StringImpl just to get its utf8() https://bugs.webkit.org/show_bug.cgi?id=115393 Reviewed by Geoffrey Garen. No new tests because no new behavior. * Modules/websockets/WebSocket.cpp: (WebCore::WebSocket::close): * Modules/websockets/WebSocketChannel.cpp: (WebCore::WebSocketChannel::send): * html/MediaFragmentURIParser.cpp: (WebCore::MediaFragmentURIParser::parseFragments): 2013-04-18 Geoffrey Garen Cherry-pick merged to the FTL branch, to ease merging back later. NOTE: Please skip this patch when merging from the FTL branch back to trunk. Reviewed by Phil Pizlo. 2013-03-20 Eric Carlson Allow ports specific text track menu https://bugs.webkit.org/show_bug.cgi?id=112800 Reviewed by Dean Jackson. No new tests, existing tests updated for changes. * English.lproj/Localizable.strings: Add localizable strings for text track names. * html/HTMLMediaElement.cpp: (WebCore::HTMLMediaElement::HTMLMediaElement): userPrefersCaptions -> shouldShowCaptions. (WebCore::HTMLMediaElement::setSelectedTextTrack): toggleTrackAtIndex -> setSelectedTextTrack. (WebCore::HTMLMediaElement::userPrefersCaptions): userPrefersCaptions -> shouldShowCaptions. (WebCore::HTMLMediaElement::userIsInterestedInThisTrackKind): Get preferences from CaptionUserPreferences instead of from Settings. (WebCore::HTMLMediaElement::setSelectedTextTrack): Renamed from toggleTrackAtIndex. Now takes a TextTrack* instead of an int. (WebCore::HTMLMediaElement::captionPreferencesChanged): Don't force a recalculation unless captions are enabled/disabled to avoid unnecessary thrash. * html/HTMLMediaElement.h: * html/shadow/MediaControlElements.cpp: (WebCore::MediaControlClosedCaptionsTrackListElement::defaultEventHandler): Use the menu to track map instead of just the track index. (WebCore::MediaControlClosedCaptionsTrackListElement::updateDisplay): Build and configure the menu from the menu to track map. (WebCore::MediaControlClosedCaptionsTrackListElement::rebuildTrackListMenu): Start with a list of tracks already sorted according to platform specific rules. Build a menu to track map so tracks are retained while the menu is visible. * html/shadow/MediaControlElements.h: * html/shadow/MediaControls.cpp: (WebCore::MediaControls::textTrackPreferencesChanged): Call closedCaptionTracksChanged so the track menu will be rebuilt before it is shown again. * html/track/InbandTextTrack.cpp: (WebCore::InbandTextTrack::containsOnlyForcedSubtitles): New, passthrough to the private track. (WebCore::InbandTextTrack::isMainProgramContent): Ditto. (WebCore::InbandTextTrack::isEasyToRead): Ditto. * html/track/InbandTextTrack.h: * html/track/TextTrack.h: * html/track/TextTrackList.cpp: (WebCore::TextTrackList::contains): New. * html/track/TextTrackList.h: * page/CaptionUserPreferences.cpp: (WebCore::CaptionUserPreferences::CaptionUserPreferences): Pull in from .h ditto. (WebCore::CaptionUserPreferences::~CaptionUserPreferences): Ditto. (WebCore::CaptionUserPreferences::shouldShowCaptions): Renamed from userPrefersCaptions. (WebCore::CaptionUserPreferences::setShouldShowCaptions): New. (WebCore::CaptionUserPreferences::userPrefersCaptions): Ditto. (WebCore::CaptionUserPreferences::setUserPrefersCaptions): Ditto. (WebCore::CaptionUserPreferences::userPrefersSubtitles): Ditto. (WebCore::CaptionUserPreferences::setUserPrefersSubtitles): Ditto. (WebCore::CaptionUserPreferences::userPrefersTextDescriptions): Ditto. (WebCore::CaptionUserPreferences::setUserPrefersTextDescriptions): Ditto. (WebCore::CaptionUserPreferences::displayNameForTrack): Ditto. (WebCore::CaptionUserPreferences::sortedTrackListForMenu): Ditto. * page/CaptionUserPreferences.h: * page/CaptionUserPreferencesMac.h: * page/CaptionUserPreferencesMac.mm: (WebCore::CaptionUserPreferencesMac::shouldShowCaptions): Renamed from userPrefersCaptions. (WebCore::CaptionUserPreferencesMac::userPrefersCaptions): New. (WebCore::CaptionUserPreferences::userPrefersSubtitles): Ditto. (WebCore::trackDisplayName): Update logic used to build track title. (WebCore::CaptionUserPreferencesMac::displayNameForTrack): Call trackDisplayName. (WebCore::textTrackCompare): Text track title sort comparison function. (WebCore::CaptionUserPreferencesMac::sortedTrackListForMenu): New. Sort the list of tracks according to title, language, and user preferences. * platform/Language.cpp: (WebCore::displayNameForLanguageLocale): Don't leak the CFLocale. * platform/LocalizedStrings.cpp: (WebCore::textTrackCountryAndLanguageMenuItemText): New. (WebCore::textTrackLanguageMenuItemText): Ditto. (WebCore::closedCaptionTrackMenuItemText): Ditto. (WebCore::sdhTrackMenuItemText): Ditto. (WebCore::easyReaderTrackMenuItemText): Ditto. * platform/LocalizedStrings.h: * platform/graphics/InbandTextTrackPrivate.h: * platform/graphics/avfoundation/objc/InbandTextTrackPrivateAVFObjC.h: * platform/graphics/avfoundation/objc/InbandTextTrackPrivateAVFObjC.mm: (WebCore::InbandTextTrackPrivateAVFObjC::containsOnlyForcedSubtitles): New, return AVFoundation property. (WebCore::InbandTextTrackPrivateAVFObjC::isMainProgramContent): Ditto. (WebCore::InbandTextTrackPrivateAVFObjC::isEasyToRead): Ditto. * testing/InternalSettings.cpp: (WebCore::InternalSettings::setShouldDisplayTrackKind): Set setting via CaptionUserPreferences instead of from Settings. (WebCore::InternalSettings::shouldDisplayTrackKind): Get setting from CaptionUserPreferences instead of from Settings. 2013-03-20 Zan Dobersek [GTK] Clean up TemporaryLinkStubs.cpp https://bugs.webkit.org/show_bug.cgi?id=112820 Reviewed by Philippe Normand. Clean up the TemporaryLinkStubs.cpp file, removing unnecessary includes and prettifying the code. No new tests - no new functionality. * platform/gtk/TemporaryLinkStubs.cpp: (WebCore): (WebCore::getSupportedKeySizes): (WebCore::signedPublicKeyAndChallengeString): (WebCore::userIdleTime): 2013-03-20 Yufeng Shen Remove PlatformEvent::GestureDoubleTap https://bugs.webkit.org/show_bug.cgi?id=93045 Reviewed by Antonio Gomes. PlatformEvent::GestureDoubleTap is not currently used in WebCore and replaced by GestureTap with tap count 2, so remove it. Test: We are removing something that is not used, so no new test. All existing tests pass. * dom/GestureEvent.cpp: (WebCore::GestureEvent::create): * page/EventHandler.cpp: (WebCore::EventHandler::handleGestureEvent): * platform/PlatformEvent.h: * platform/chromium/PopupContainer.cpp: (WebCore::PopupContainer::handleGestureEvent): 2013-03-20 Ojan Vafai Move repaint methods from RenderObject to RenderBox https://bugs.webkit.org/show_bug.cgi?id=112773 Reviewed by Julien Chaffraix. repaintOverhangingFloats and repaintDuringLayoutIfMoved are only ever called on RenderBoxes, so don't need to be on RenderObject. This also lets us devirtualize repaintDuringLayoutIfMoved. * rendering/RenderBox.h: (WebCore::RenderBox::repaintOverhangingFloats): * rendering/RenderObject.cpp: * rendering/RenderObject.h: 2013-03-20 Christian Biesinger Add a feature observer for RenderDeprecatedFlexibleBox https://bugs.webkit.org/show_bug.cgi?id=112740 Reviewed by Tony Chang. No new tests - only adding measurements. * page/FeatureObserver.h: Add constants for RenderDeprecatedFlexibleBox, and add separate constants for its use in the UI and in extensions. * rendering/RenderDeprecatedFlexibleBox.cpp: (WebCore::RenderDeprecatedFlexibleBox::RenderDeprecatedFlexibleBox): Call FeatureObserver. Check the document()->url() to see which constant to use. 2013-03-20 Tim Horton Autosize should use documentRect height instead of scrollHeight https://bugs.webkit.org/show_bug.cgi?id=112770 Reviewed by David Levin. Autosizing fails to compute the correct height if the root element is very small but the document has significant overflow. No new tests; autosizing is not currently exposed in a testable way on Mac. * page/FrameView.cpp: (WebCore::FrameView::autoSizeIfEnabled): 2013-03-20 Julien Chaffraix [CSS Grid Layout] Improper repainting when grid item change their position https://bugs.webkit.org/show_bug.cgi?id=112749 Reviewed by Ojan Vafai. Tests: fast/css-grid-layout/grid-element-change-columns-repaint.html fast/css-grid-layout/grid-element-change-rows-repaint.html fast/css-grid-layout/grid-item-change-column-repaint.html fast/css-grid-layout/grid-item-change-row-repaint.html * rendering/RenderGrid.cpp: (WebCore::RenderGrid::layoutGridItems): Added a call to repaintDuringLayoutIfMoved to repaint moving grid items. 2013-03-20 Arvid Nilsson [BlackBerry] compositing/iframes/scroll-fixed-transformed-element.html fails in manual testing https://bugs.webkit.org/show_bug.cgi?id=112806 Reviewed by Antonio Gomes. PR 283363 When scrolling the iframe, the position: fixed element is correctly positioned, that is, as if it was fixed with respect to the iframe's viewport. When scrolling the main frame however, the fixed pos element was positioned as if it was fixed with respect to the main frame's viewport. Fixed by falling back to using the WebKit-thread scroll position for fixed positioning in LayerRenderer, if the override doesn't have a position currently set, i.e. if we are not currently scrolling the iframe. The effects of the bug are only visual, i.e. not detectable by DRT. Manually testable using compositing/iframes/scroll-fixed-transformed-element.html * platform/graphics/blackberry/LayerRenderer.cpp: (WebCore::LayerRenderer::updateLayersRecursive): 2013-03-20 Michael Pruett [V8] Simplify implementation of EnforceRange conversions https://bugs.webkit.org/show_bug.cgi?id=112758 Reviewed by Kentaro Hara. Factor out EnforceRange conversion into a helper function. Simplify calculation for truncation. Tests: fast/js/webidl-type-mapping.html storage/indexeddb/cursor-advance.html storage/indexeddb/cursor-advance-workers.html storage/indexeddb/intversion-bad-parameters.html * bindings/v8/V8Binding.cpp: (WebCore::enforceRange): (WebCore): (WebCore::toInt32): (WebCore::toUInt32): (WebCore::toInt64): (WebCore::toUInt64): 2013-03-20 Harald Alvestrand Remove Local/Remote and RTCStatsElement from WebRTCStats API https://bugs.webkit.org/show_bug.cgi?id=112678 Reviewed by Adam Barth. Pure removal, remaining functionality covered by existing test. * Modules/mediastream/RTCStatsReport.cpp: * Modules/mediastream/RTCStatsReport.h: (RTCStatsReport): * Modules/mediastream/RTCStatsResponse.cpp: * Modules/mediastream/RTCStatsResponse.h: (RTCStatsResponse): * platform/chromium/support/WebRTCStatsResponse.cpp: * platform/mediastream/RTCStatsResponseBase.h: (RTCStatsResponseBase): 2013-03-20 Xingnan Wang ASSERTION FAILED: !m_renderingAutomaticPullNodes.size() https://bugs.webkit.org/show_bug.cgi?id=112777 Reviewed by Chris Rogers. * Modules/webaudio/AudioContext.cpp: (WebCore::AudioContext::~AudioContext): 2013-03-20 Rouslan Solomakhin Copy-paste should not spellcheck when continuous spellcheck is turned off https://bugs.webkit.org/show_bug.cgi?id=112464 Reviewed by Ryosuke Niwa. Test: editing/spelling/spellcheck-paste-continuous-disabled.html * WebCore.exp.in: Export WebCore::Editor::isContinuousSpellCheckingEnabled() and WebCore::Editor::toggleContinuousSpellChecking() for use by internals. * WebCore.order: Export WebCore::Editor::isContinuousSpellCheckingEnabled() and WebCore::Editor::toggleContinuousSpellChecking() for use by internals. * editing/Editor.cpp: (WebCore::Editor::replaceSelectionWithFragment): Do not spellcheck if continuous spellcheck is turned off. * testing/Internals.cpp: (WebCore::Internals::resetToConsistentState): Leave continuous spellcheck turned on after a test. (WebCore::Internals::setContinuousSpellCheckingEnabled): Let tests enable and disable continuous spellcheck. (WebCore): * testing/Internals.h: Let tests enable and disable continuous spellcheck. (Internals): * testing/Internals.idl: Let tests enable and disable continuous spellcheck. 2013-03-20 Aaron Colwell Add support for MediaSource::isTypeSupported() https://bugs.webkit.org/show_bug.cgi?id=112301 Reviewed by Darin Fisher. Test: http/tests/media/media-source/video-media-source-is-type-supported.html * Modules/mediasource/MediaSource.cpp: (WebCore::MediaSource::addSourceBuffer): Added isTypeSupported() call to verify parameters pass into this method. (WebCore::MediaSource::isTypeSupported): (WebCore): * Modules/mediasource/MediaSource.h: (MediaSource): * Modules/mediasource/MediaSource.idl: Added isTypeSupported(). * platform/MIMETypeRegistry.h: (MIMETypeRegistry): Added isSupportedMediaSourceMIMEType(). * platform/chromium/MIMETypeRegistryChromium.cpp: (WebCore): (WebCore::MIMETypeRegistry::isSupportedMediaSourceMIMEType): Implemented in terms of WebMimeRegistry::isSupportedMediaSourceMIMEType. 2013-03-20 Brent Fulgham [WinCairo] Unreviewed VS2010 build correction. * WebCore.vcxproj/WebCore.vcxproj: Enable build of NetworkStorageSessionStub.cpp for WinCairo port. * WebCore.vcxproj/WebCore.vcxproj.filters: Correct build type of CookieJarCurl from 'custom' to 'C++ source file' 2013-03-20 Marja Hölttä [V8] Rename DOMDataStore::isMainWorldObject https://bugs.webkit.org/show_bug.cgi?id=112817 Reviewed by Jochen Eisinger. No new tests (no changes in functionality). * bindings/v8/DOMDataStore.h: (WebCore::DOMDataStore::getWrapperFast): (WebCore::DOMDataStore::getWrapper): (WebCore::DOMDataStore::getWrapperForMainWorld): (WebCore::DOMDataStore::setWrapper): (WebCore::DOMDataStore::canExistInWorker): 2013-03-20 Ilya Tikhonovsky Web Inspector: Flame Chart. Provide Overview pane for better user expirience. https://bugs.webkit.org/show_bug.cgi?id=112496 Reviewed by Yury Semikhatsky. This patch implements basic part of Overview Pane in FlameChart. The idea of the patch is to move everything into chart-container element. And put OverviewGrid into new overview-container element. Drive by change: fix the layout of the flame chart elements. Drive by change: fix the drag window & drag resizer mechanics for the case when the parent element has zero offsetLeft. * inspector/front-end/FlameChart.js: (WebInspector.FlameChart): (WebInspector.FlameChart.OverviewCalculator): (WebInspector.FlameChart.OverviewCalculator.prototype._updateBoundaries): (WebInspector.FlameChart.OverviewCalculator.prototype.computePosition): (WebInspector.FlameChart.OverviewCalculator.prototype.formatTime): (WebInspector.FlameChart.OverviewCalculator.prototype.maximumBoundary): (WebInspector.FlameChart.OverviewCalculator.prototype.minimumBoundary): (WebInspector.FlameChart.OverviewCalculator.prototype.boundarySpan): (WebInspector.FlameChart.prototype._onWindowChanged): (WebInspector.FlameChart.prototype._adjustXScale): (WebInspector.FlameChart.prototype.update): * inspector/front-end/OverviewGrid.js: (WebInspector.OverviewGrid.Window): (WebInspector.OverviewGrid.Window.prototype._resizerElementStartDragging): (WebInspector.OverviewGrid.Window.prototype._leftResizeElementDragging): (WebInspector.OverviewGrid.Window.prototype._rightResizeElementDragging): (WebInspector.OverviewGrid.Window.prototype._startWindowSelectorDragging): (WebInspector.OverviewGrid.Window.prototype._windowSelectorDragging): (WebInspector.OverviewGrid.Window.prototype._endWindowSelectorDragging): (WebInspector.OverviewGrid.Window.prototype._setWindowPosition): (WebInspector.OverviewGrid.Window.prototype._onMouseWheel): (WebInspector.OverviewGrid.WindowSelector): * inspector/front-end/TimelineOverviewPane.js: * inspector/front-end/flameChart.css: (.chart-container .item-anchor): (.overview-container): (.chart-container): (#flame-chart-overview-grid .resources-dividers-label-bar): * inspector/front-end/inspectorCommon.css: (.resources-divider-label): 2013-03-20 Sergey Ryazanov Web Inspector: Plumbing CSS warnings https://bugs.webkit.org/show_bug.cgi?id=111334 Reviewed by Pavel Feldman. Adding a framework for plumbing CSS warnings from CSSParser/grammar to the Inspector console. * css/CSSParser.cpp: (WebCore::CSSParser::CSSParser): (WebCore::CSSParser::parseSheet): (WebCore::CSSParser::syntaxError): (WebCore): (WebCore::CSSParser::isLoggingErrors): (WebCore::CSSParser::logError): * css/CSSParser.h: (CSSParser): (CSSParser::Location): (WebCore): * css/StyleSheetContents.cpp: (WebCore::StyleSheetContents::parseAuthorStyleSheet): (WebCore::StyleSheetContents::parseString): (WebCore::StyleSheetContents::parseStringAtLine): * css/StyleSheetContents.h: (StyleSheetContents): * dom/StyleElement.cpp: (WebCore::StyleElement::createSheet): * page/PageConsole.cpp: (WebCore::PageConsole::addMessage): 2013-03-20 Justin Novosad [Chromium] Code cleanup: removing support for non-deferred 2d canvas rendering https://bugs.webkit.org/show_bug.cgi?id=112605 Reviewed by James Robinson. Deleting all the code that was used for propagating and supporting the Chromium setting for disabling deferred 2d canvas rendering. No new tests: Affected code paths covered by existing tests. * html/HTMLCanvasElement.cpp: (WebCore::HTMLCanvasElement::createImageBuffer): * html/HTMLCanvasElement.h: * page/Settings.in: * platform/graphics/ImageBuffer.h: (WebCore::ImageBuffer::create): (ImageBuffer): * platform/graphics/blackberry/ImageBufferBlackBerry.cpp: (WebCore::ImageBuffer::ImageBuffer): * platform/graphics/cairo/ImageBufferCairo.cpp: (WebCore::ImageBuffer::ImageBuffer): * platform/graphics/cg/ImageBufferCG.cpp: (WebCore::ImageBuffer::ImageBuffer): * platform/graphics/chromium/Canvas2DLayerBridge.cpp: (WebCore::Canvas2DLayerBridge::Canvas2DLayerBridge): (WebCore::Canvas2DLayerBridge::~Canvas2DLayerBridge): (WebCore::Canvas2DLayerBridge::prepareForDraw): (WebCore::Canvas2DLayerBridge::storageAllocatedForRecordingChanged): (WebCore::Canvas2DLayerBridge::storageAllocatedForRecording): (WebCore::Canvas2DLayerBridge::freeMemoryIfPossible): (WebCore::Canvas2DLayerBridge::flush): (WebCore::Canvas2DLayerBridge::skCanvas): (WebCore::Canvas2DLayerBridge::prepareTexture): (WebCore::Canvas2DLayerBridge::contextAcquired): * platform/graphics/chromium/Canvas2DLayerBridge.h: (WebCore::Canvas2DLayerBridge::create): (Canvas2DLayerBridge): * platform/graphics/qt/ImageBufferQt.cpp: (WebCore::ImageBuffer::ImageBuffer): * platform/graphics/skia/ImageBufferSkia.cpp: (WebCore::createAcceleratedCanvas): (WebCore::ImageBuffer::ImageBuffer): * platform/graphics/wince/ImageBufferWinCE.cpp: (WebCore::ImageBuffer::ImageBuffer): * platform/graphics/wx/ImageBufferWx.cpp: (WebCore::ImageBuffer::ImageBuffer): 2013-03-20 Mike West Drop full URLs from cross-domain access errors caused by 'document.domain' mismatches. https://bugs.webkit.org/show_bug.cgi?id=112813 Reviewed by Timothy Hatcher. Following up on http://wkbug.com/112042, this patch brings 'document.domain' mismatch error messages into line with the newly origin-only default message. There will probably be two or three more patches in this series just to keep the rebaselines down to something managably reviewable. * page/DOMWindow.cpp: (WebCore::DOMWindow::crossDomainAccessErrorMessage): Move the default message redefinition up out of the final 'return' so that 'document.domain' mismatch errors grab the new text. 2013-03-20 Ken Kania Web Inspector: Add promptText param to Page.handleJavaScriptDialog https://bugs.webkit.org/show_bug.cgi?id=112706 Reviewed by Pavel Feldman. * inspector/Inspector.json: * inspector/InspectorClient.h: (WebCore::InspectorClient::handleJavaScriptDialog): * inspector/InspectorPageAgent.cpp: (WebCore::InspectorPageAgent::handleJavaScriptDialog): * inspector/InspectorPageAgent.h: 2013-03-20 Andrey Lushnikov Web Inspector: fix SourceFrame.js compilation warning https://bugs.webkit.org/show_bug.cgi?id=112804 Reviewed by Yury Semikhatsky. No new tests: no change in behavior. - Explicitly parse lineNumber from object property name. - Add type annotations to ensure addMessageToSource is monomorphic. * inspector/front-end/SourceFrame.js: (WebInspector.SourceFrame.prototype.clearMessages): 2013-03-20 Dan Carney [v8] unsafe persistent access in V8LazyEventListener https://bugs.webkit.org/show_bug.cgi?id=112807 Reviewed by Kentaro Hara. No new tests. * bindings/v8/V8LazyEventListener.cpp: (WebCore::toObjectWrapper): 2013-03-20 Arvid Nilsson [BlackBerry] Enable appropriate vertex attribute arrays in LayerRenderer::useProgram() https://bugs.webkit.org/show_bug.cgi?id=112757 Reviewed by Rob Buis. PR 306465 Make the LayerRenderer and associated code more bullet-proof when it comes to enabling vertex attribute arrays, by enabling them already when LayerRenderer::useProgram() is called. This fixes a bug where the video hole punch rectangle wasn't punched when preceding rendering caused the vertex attribute array at index 0 to be disabled, such as when rendering the text selection overlay immediately before video. A number of places where the position attribute index was hard-coded to 0 were also fixed. This causes no change in behavior, the position attribute was really at 0, but nonetheless that shouldn't be hardcoded. The effects of this patch are only manually testable. * platform/graphics/blackberry/LayerCompositingThread.cpp: (WebCore::LayerCompositingThread::drawTextures): (WebCore::LayerCompositingThread::drawSurface): * platform/graphics/blackberry/LayerRenderer.cpp: (WebCore::LayerRenderer::compositeBuffer): (WebCore::LayerRenderer::drawColor): (WebCore::LayerRenderer::drawDebugBorder): (WebCore::LayerRenderer::drawHolePunchRect): (WebCore::LayerRenderer::compositeLayersRecursive): (WebCore::LayerRenderer::useProgram): 2013-03-20 Andrey Lushnikov Web Inspector: [CodeMirror] implement highlightRange method https://bugs.webkit.org/show_bug.cgi?id=112802 Reviewed by Vsevolod Vlasov. - Implement highlightRange/removeHighlight methods in CodeMirrorTextEditor. - Update TextEditor interface closure annotations. No new tests. * inspector/front-end/CodeMirrorTextEditor.js: (WebInspector.CodeMirrorTextEditor.prototype.removeHighlight): (WebInspector.CodeMirrorTextEditor.prototype.highlightRange): * inspector/front-end/DefaultTextEditor.js: * inspector/front-end/TextEditor.js: 2013-03-20 Andrey Lushnikov Web Inspector: [CodeMirror] show source location for codemirror text editor https://bugs.webkit.org/show_bug.cgi?id=112798 Reviewed by Vsevolod Vlasov. No new tests. - Implement CodeMirrorTextEditor.copyRange method - Fire "selectionChange" event for text editor delegate from CodeMirrorTextEditor. * inspector/front-end/CodeMirrorTextEditor.js: (WebInspector.CodeMirrorTextEditor): (WebInspector.CodeMirrorTextEditor.prototype.copyRange): (WebInspector.CodeMirrorTextEditor.prototype._cursorActivity): 2013-03-20 Sheriff Bot Unreviewed, rolling out r146331. http://trac.webkit.org/changeset/146331 https://bugs.webkit.org/show_bug.cgi?id=112795 Does not work as expected (Requested by carewolf on #webkit). * platform/graphics/qt/FontQt.cpp: (WebCore::Font::initFormatForTextLayout): 2013-03-20 Eugene Klyuchnikov Web Inspector: [Resources] Local Storage: "Add item" row height doesn't match underlying grid. https://bugs.webkit.org/show_bug.cgi?id=112433 Reviewed by Pavel Feldman. Fixed cell height to correspond grid step. * inspector/front-end/dataGrid.css: (.data-grid td): Fixed cell height to correspond grid step. 2013-03-20 Allan Sandfeld Jensen [Qt] New fast/text/word-space-with-kerning-3.html fails on Qt https://bugs.webkit.org/show_bug.cgi?id=112668 Reviewed by Jocelyn Turcotte. Kerning is on by default in Qt. This means we need to disable it when WebCore does not request it. * platform/graphics/qt/FontQt.cpp: (WebCore::Font::initFormatForTextLayout): 2013-03-20 Ilya Tikhonovsky Web Inspector: OverviewGrid rename classes according to names of js classes. https://bugs.webkit.org/show_bug.cgi?id=112786 Reviewed by Yury Semikhatsky. It is a part of meta bug 'extract OverviewGrid from TimelineOverviewPane'. As the last step it renames timeline-...... classes to overview-grid-...... classes and moves them to inspectorCommon.css * inspector/front-end/OverviewGrid.js: (WebInspector.OverviewGrid): (WebInspector.OverviewGrid.Window): (WebInspector.OverviewGrid.Window.prototype._startWindowSelectorDragging): (WebInspector.OverviewGrid.WindowSelector): (WebInspector.OverviewGrid.WindowSelector.prototype._createSelectorElement): * inspector/front-end/inspectorCommon.css: (.overview-grid-window-selector): (.overview-grid-window): (.overview-grid-dividers-background): (.overview-grid-window-rulers): (.overview-grid-window-resizer): * inspector/front-end/timelinePanel.css: (.timeline-frame-overview .overview-grid-window): (.timeline-frame-overview .overview-grid-dividers-background): 2013-03-20 Dmitry Zvorygin Web Inspector: Switch Drawer animation from JavaScript to CSS transitions. https://bugs.webkit.org/show_bug.cgi?id=112586 This is prerequisite to make Drawer work in overlay mode. Reviewed by Vsevolod Vlasov. * inspector/front-end/Drawer.js: (WebInspector.Drawer): (WebInspector.Drawer.prototype.show): (WebInspector.Drawer.prototype.hide.this.animationFinished): (WebInspector.Drawer.prototype.hide): (WebInspector.Drawer.prototype.immediatelyFinishAnimation): (WebInspector.Drawer.prototype._getAnimationStyles): * inspector/front-end/UIUtils.js: * inspector/front-end/inspector.css: (.animate-slow *): (.animate #main): (.animate #floating-status-bar-container): (.animate #drawer): (.animate #bottom-status-bar-container > *): 2013-03-19 Eugene Klyuchnikov Web Inspector: [DataGrid] Refactorings. https://bugs.webkit.org/show_bug.cgi?id=112690 Reviewed by Pavel Feldman. 1. Avoid using string literals; 2. Remove unused notifications; turn "populate" to method invocation; 3. Replace some getters with regular functions. * inspector/front-end/DataGrid.js: Applied refactorings. * inspector/front-end/ApplicationCacheItemsView.js: Adopted changes. * inspector/front-end/BottomUpProfileDataGridTree.js: Ditto. * inspector/front-end/CPUProfileView.js: Ditto. * inspector/front-end/CSSSelectorProfileView.js: Ditto. * inspector/front-end/CookiesTable.js: Ditto. * inspector/front-end/DirectoryContentView.js: Ditto. * inspector/front-end/HeapSnapshotDataGrids.js: Ditto. * inspector/front-end/HeapSnapshotGridNodes.js: Ditto. * inspector/front-end/NativeMemorySnapshotView.js: Ditto. * inspector/front-end/NetworkPanel.js: Ditto. * inspector/front-end/ProfileDataGridTree.js: Ditto. * inspector/front-end/ResourceWebSocketFrameView.js: Ditto. * inspector/front-end/TopDownProfileDataGridTree.js: Ditto. * inspector/front-end/dataGrid.css: Ditto. 2013-03-19 Allan Sandfeld Jensen [Qt] Support -webkit-font-smoothing https://bugs.webkit.org/show_bug.cgi?id=106009 Reviewed by Jocelyn Turcotte. Set QFont antialiasing settings based on the font smoothing settings in FontDescription. * platform/graphics/qt/FontPlatformDataQt.cpp: (WebCore::FontPlatformData::FontPlatformData): 2013-03-20 Alexei Filippov Web Inspector: Allow toolbar customization https://bugs.webkit.org/show_bug.cgi?id=112440 Adds a tools menu item that allows the user to show/hide inspector panels on the toolbar. Reviewed by Yury Semikhatsky. * inspector/front-end/InspectorView.js: * inspector/front-end/Settings.js: (WebInspector.Settings): (WebInspector.ExperimentsSettings): * inspector/front-end/Toolbar.js: (WebInspector.Toolbar): (WebInspector.Toolbar.prototype.addPanel): (WebInspector.Toolbar.prototype._isPanelVisibleByDefault): (WebInspector.Toolbar.prototype.set _hidePanel): (WebInspector.Toolbar.prototype._showPanel): (WebInspector.Toolbar.prototype._togglePanelsMenu): * inspector/front-end/inspector.css: (#toolbar-panels-menu): (#toolbar-panels-menu:hover): (#toolbar-panels-menu:active): * inspector/front-end/inspector.html: 2013-03-20 Eugene Klyuchnikov Web Inspector: [Settings] Add "storage" parameter to WebInspector.Setting https://bugs.webkit.org/show_bug.cgi?id=112667 Reviewed by Pavel Feldman. New parameter will allow more options on how long setting will persist. Possible options are: localStorage, sessionStorage and no-storage. Additional change: use delete instead of .removeItem to make it possible use any object as storage. * inspector/front-end/Settings.js: Added "storage" parameter and used is instead of "window.localStorage". 2013-03-20 Pan Deng Web Inspector: [Network] Fix the bug of WebSocketFrameView crash. https://bugs.webkit.org/show_bug.cgi?id=112771. Reviewed by Pavel Feldman. WebSocketFrameView crashes when websocket receives an error message, this patch fixes this problem, and error message will be shown in dataGrid as expected. No new tests. * inspector/front-end/ResourceWebSocketFrameView.js: (WebInspector.ResourceWebSocketFrameView): Handle the errorMessage case. 2013-03-20 Dmitry Zvorygin Remove remainings of obsolete LogLevels and MessageSources from inspector JS part. https://bugs.webkit.org/show_bug.cgi?id=112709 By the way tuned messagesources in ApplicationCacheGroup. Reviewed by Pavel Feldman. * inspector/front-end/ConsoleMessage.js: (WebInspector.ConsoleMessageImpl.prototype.toMessageElement): (WebInspector.ConsoleMessageImpl.prototype.toString): * inspector/front-end/ConsoleModel.js: * inspector/front-end/ExtensionAPI.js: (defineCommonExtensionSymbols): * inspector/front-end/ExtensionServer.js: (WebInspector.ExtensionServer.prototype._onAddConsoleMessage): (WebInspector.ExtensionServer.prototype._makeConsoleMessage): * loader/appcache/ApplicationCacheGroup.cpp: (WebCore::ApplicationCacheGroup::didReceiveResponse): (WebCore::ApplicationCacheGroup::didFinishLoading): (WebCore::ApplicationCacheGroup::didFail): 2013-03-20 Krzysztof Czech [GTK] accessibility/aria-scrollbar-role.html is failing https://bugs.webkit.org/show_bug.cgi?id=98358 Reviewed by Martin Robinson. Adds support for checking an orientation attribute of accessibility object. AccessibilityObject that represents ScrollBar element should be ATK_VALUE type. ScrollBar element can be considered as a Range Widget that is able to expose some range values. Test: accessibility/aria-scrollbar-role.html * accessibility/atk/WebKitAccessibleWrapperAtk.cpp: (setAtkStateSetFromCoreObject): (getInterfaceMaskFromObject): 2013-03-20 Zan Dobersek Unreviewed. Fixing a typo in libLevelDB_la_CFLAGS assignment - cxflags -> cflags. * GNUmakefile.am: 2013-03-20 Robert Hogan Absolute position div without width specified does not reflow its text when it is moved (and computed width changes) https://bugs.webkit.org/show_bug.cgi?id=112052 Reviewed by Emil A Eklund. If a positioned block has auto width then any movement means the block needs to be resized. Test: fast/block/positioned-block-auto-width-movement.html * rendering/style/RenderStyle.cpp: (WebCore::positionedObjectMoved): (WebCore::RenderStyle::diff): 2013-03-19 Sheriff Bot Unreviewed, rolling out r146301. http://trac.webkit.org/changeset/146301 https://bugs.webkit.org/show_bug.cgi?id=112776 Caused hundreds of tests to hit assertions on Windows debug bots (Requested by rniwa on #webkit). * CMakeLists.txt: * GNUmakefile.list.am: * Target.pri: * WebCore.exp.in: * WebCore.gypi: * WebCore.vcproj/WebCore.vcproj: * WebCore.vcxproj/WebCore.vcxproj: * WebCore.vcxproj/WebCore.vcxproj.filters: * WebCore.xcodeproj/project.pbxproj: * loader/DocumentLoader.cpp: (WebCore::DocumentLoader::DocumentLoader): (WebCore::DocumentLoader::mainResourceLoader): (WebCore::DocumentLoader::~DocumentLoader): (WebCore::DocumentLoader::mainResourceData): (WebCore::DocumentLoader::stopLoading): (WebCore::DocumentLoader::finishedLoading): (WebCore::DocumentLoader::handleSubstituteDataLoadNow): (WebCore::DocumentLoader::continueAfterNavigationPolicy): (WebCore::DocumentLoader::responseReceived): (WebCore::DocumentLoader::continueAfterContentPolicy): (WebCore::DocumentLoader::reportMemoryUsage): (WebCore::DocumentLoader::receivedData): (WebCore::DocumentLoader::clearMainResourceLoader): (WebCore::DocumentLoader::setDefersLoading): (WebCore::DocumentLoader::setMainResourceDataBufferingPolicy): (WebCore::DocumentLoader::addSubresourceLoader): (WebCore::DocumentLoader::isLoadingMainResource): (WebCore): (WebCore::DocumentLoader::maybeLoadEmpty): (WebCore::DocumentLoader::startLoadingMainResource): * loader/DocumentLoader.h: (WebCore): (DocumentLoader): * loader/MainResourceLoader.cpp: Added. (WebCore): (WebCore::MainResourceLoader::MainResourceLoader): (WebCore::MainResourceLoader::~MainResourceLoader): (WebCore::MainResourceLoader::create): (WebCore::MainResourceLoader::clearResource): (WebCore::MainResourceLoader::frameLoader): (WebCore::MainResourceLoader::request): (WebCore::MainResourceLoader::resourceData): (WebCore::MainResourceLoader::redirectReceived): (WebCore::MainResourceLoader::responseReceived): (WebCore::MainResourceLoader::dataReceived): (WebCore::MainResourceLoader::notifyFinished): (WebCore::MainResourceLoader::reportMemoryUsage): (WebCore::MainResourceLoader::load): (WebCore::MainResourceLoader::setDefersLoading): (WebCore::MainResourceLoader::defersLoading): (WebCore::MainResourceLoader::setDataBufferingPolicy): (WebCore::MainResourceLoader::loader): (WebCore::MainResourceLoader::identifier): * loader/MainResourceLoader.h: Added. (WebCore): (MainResourceLoader): (WebCore::MainResourceLoader::cachedMainResource): (WebCore::MainResourceLoader::documentLoader): * loader/mac/DocumentLoaderMac.cpp: (WebCore::DocumentLoader::schedule): (WebCore::DocumentLoader::unschedule): 2013-03-19 Mike West CSP 1.1: Stub out SecurityPolicyViolationEvent interface. https://bugs.webkit.org/show_bug.cgi?id=112681 Reviewed by Adam Barth. A first pass at a SecurityPolicyViolationEvent interface is defined in CSP 1.1's editor's draft[1]. This patch puts the big components into place so that we can start getting some implementation experience with the new event interface as it's defined, and feed that back into the working group. Here, we're only defining the interface, and creating a listener on the Document. Events aren't yet being fired when Content Security Policy violations occur. I'll tackle that in a future patch; adding files is a big enough annoyance to do it separately. This patch has only two web-visible impacts: - Document objects now have an 'onsecuritypolicyviolation' attribute. - A SecurityPolicyViolationEvent constructor is accessible on the Window object. Ports that have not enabled the CSP_NEXT flag should experience no change. [1]: https://dvcs.w3.org/hg/content-security-policy/raw-file/tip/csp-specification.dev.html#securitypolicyviolationevent-events Test: http/tests/security/contentSecurityPolicy/1.1/securitypolicyviolation-basics.html * CMakeLists.txt: * GNUmakefile.list.am: * WebCore.gypi: * WebCore.vcproj/WebCore.vcproj: * WebCore.xcodeproj/project.pbxproj: Wow! A new file! This is so exciting! I'm going to tell ALL my build systems about this! * dom/Document.h: * dom/Document.idl: Define an 'onsecuritypolicyviolation' event handler on Document objects. * dom/EventNames.h: * dom/EventNames.in: Define a 'securitypolicyviolation' event type. * dom/SecurityPolicyViolationEvent.h: Added. (WebCore::SecurityPolicyViolationEventInit::SecurityPolicyViolationEventInit): (SecurityPolicyViolationEventInit): (SecurityPolicyViolationEvent): (WebCore::SecurityPolicyViolationEvent::create): (WebCore::SecurityPolicyViolationEvent::documentURI): (WebCore::SecurityPolicyViolationEvent::referrer): (WebCore::SecurityPolicyViolationEvent::blockedURI): (WebCore::SecurityPolicyViolationEvent::violatedDirective): (WebCore::SecurityPolicyViolationEvent::effectiveDirective): (WebCore::SecurityPolicyViolationEvent::originalPolicy): (WebCore::SecurityPolicyViolationEvent::sourceURL): (WebCore::SecurityPolicyViolationEvent::lineNumber): (WebCore::SecurityPolicyViolationEvent::interfaceName): (WebCore::SecurityPolicyViolationEvent::SecurityPolicyViolationEvent): * dom/SecurityPolicyViolationEvent.idl: Added. Define the SecurityPolicyViolationEvent's IDL, and then create all the boilerplate necessary to properly initialize a SecurityPolicyViolationEvent object with the relevant properties. * page/DOMWindow.idl: Add the new SecurityPolicyViolationEvent constructor to the Window object so it's available on a page. 2013-03-19 Eugene Klyuchnikov Web Inspector: [Timeline] Tune status bar UI for limited-width window. https://bugs.webkit.org/show_bug.cgi?id=112702 Reviewed by Pavel Feldman. Reduce filter titles when there is not enough space. * inspector/front-end/TimelinePanel.js: Add classnames to elements. * inspector/front-end/timelinePanel.css: Specify "flex" behaviour. 2013-03-19 Nate Chapin Merge MainResourceLoader into DocumentLoader https://bugs.webkit.org/show_bug.cgi?id=104969 Reviewed by Adam Barth. No new tests, refactor only. * CMakeLists.txt: * GNUmakefile.list.am: * Target.pri: * WebCore.exp.in: * WebCore.gypi: * WebCore.vcproj/WebCore.vcproj: * WebCore.vcxproj/WebCore.vcxproj: * WebCore.vcxproj/WebCore.vcxproj.filters: * WebCore.xcodeproj/project.pbxproj: * loader/DocumentLoader.cpp: (WebCore::DocumentLoader::DocumentLoader): (WebCore::DocumentLoader::mainResourceLoader): (WebCore::DocumentLoader::~DocumentLoader): Move main resource clearing from ~MainResourceLoader. (WebCore::DocumentLoader::mainResourceData): (WebCore::DocumentLoader::stopLoading): (WebCore::DocumentLoader::notifyFinished): Moved from MainResourceLoader::notifyFinished. (WebCore): (WebCore::DocumentLoader::finishedLoading): (WebCore::DocumentLoader::handleSubstituteDataLoadNow): (WebCore::DocumentLoader::redirectReceived): (WebCore::DocumentLoader::continueAfterNavigationPolicy): (WebCore::DocumentLoader::responseReceived): (WebCore::DocumentLoader::continueAfterContentPolicy): (WebCore::DocumentLoader::reportMemoryUsage): (WebCore::DocumentLoader::dataReceived): (WebCore::DocumentLoader::clearMainResourceLoader): (WebCore::DocumentLoader::setDefersLoading): (WebCore::DocumentLoader::setMainResourceDataBufferingPolicy): (WebCore::DocumentLoader::addSubresourceLoader): (WebCore::DocumentLoader::maybeLoadEmpty): (WebCore::DocumentLoader::startLoadingMainResource): Don't keep separate checks for normal and empty loads, just use a single boolean. * loader/DocumentLoader.h: (WebCore::DocumentLoader::isLoadingMainResource): * loader/MainResourceLoader.cpp: Removed. * loader/MainResourceLoader.h: Removed. * loader/mac/DocumentLoaderMac.cpp: (WebCore::DocumentLoader::schedule): (WebCore::DocumentLoader::unschedule): 2013-03-19 Ankur Taly Cache a pointer to V8DOMActivityLogger in PerContextData. https://bugs.webkit.org/show_bug.cgi?id=112719 Reviewed by Kentaro Hara. Adds a data member (and getter, setter methods) to V8PerContextData that holds a pointer to a V8DOMActivityLogger. This member is set while initializing the context for a V8DOMWindowShell. Ownership of the pointer is still retained by the HashMap in DOMWrapperWorld. As a result of this patch, subsequent patches that will implement logging for DOM API access (See bug 107207) will be able to obtain a reference to the logger directly from PerContextData. This will benefit performance as it will be faster than looking up the logger in the DOMActivityLoggerMap in DOMWrapperWorld. There are no new tests as there is no change in behavior. * bindings/v8/V8DOMWindowShell.cpp: (WebCore::V8DOMWindowShell::initializeIfNeeded): * bindings/v8/V8PerContextData.h: (WebCore::V8PerContextData::activityLogger): (V8PerContextData): (WebCore::V8PerContextData::setActivityLogger): 2013-03-19 Arnaud Renevier do not use string reference for enum support in CodeGeneratorJS.pm https://bugs.webkit.org/show_bug.cgi?id=112760 Reviewed by Kentaro Hara. Do use string references in generated JS bindings for enum values. Test: bindings/scripts/test/TestObj.idl * bindings/scripts/CodeGeneratorJS.pm: (GenerateImplementation): (GenerateParametersCheck): * bindings/scripts/test/JS/JSTestObj.cpp: (WebCore::setJSTestObjEnumAttr): (WebCore::jsTestObjPrototypeFunctionMethodWithEnumArg): 2013-03-19 Simon Fraser Make RLC::haveNonMainLayersWithTiledBacking() public and fix the name https://bugs.webkit.org/show_bug.cgi?id=112763 Reviewed by Tim Horton. Downstream code needs to call hasNonMainLayersWithTiledBacking(). * rendering/RenderLayerCompositor.h: (WebCore::RenderLayerCompositor::hasNonMainLayersWithTiledBacking): (RenderLayerCompositor): 2013-03-19 David Levin FrameLoader::didChangeIcons isn't called when the favicon is changed. https://bugs.webkit.org/show_bug.cgi?id=112080 Reviewed by Dmitry Titov. Test: fast/dom/icon-url-property.html * dom/Document.cpp: (WebCore::Document::addIconURL): Made the callback for didChangeIcons happen whenever there are favicon changes instead of filtering it and have to be in sync about what hosts care about. As far as I could tell no hosts rely on this callback except for Chromium, so in general doing less work here may potentially help a small amount for other ports. 2013-03-19 Michael Pruett Don't throw on infinity or NaN index in HTMLOptionsCollection.add() https://bugs.webkit.org/show_bug.cgi?id=112612 Reviewed by Kentaro Hara. HTMLOptionsCollection.add() should not throw a type error when its optional index argument is infinity or NaN. Such values should instead be converted to 0 with no error. Tests: fast/dom/non-numeric-values-numeric-parameters.html fast/js/select-options-add.html * bindings/js/JSHTMLOptionsCollectionCustom.cpp: (WebCore::JSHTMLOptionsCollection::add): 2013-03-19 Dominic Mazzoni Security: Heap-use-after-free in WebCore::AXObjectCache::getOrCreate https://bugs.webkit.org/show_bug.cgi?id=112044 Reviewed by Chris Fleizach. Always call recalcSectionsIfNeeded before accessing table sections. Test: accessibility/table-remove-cell-crash.html * accessibility/AccessibilityTable.cpp: (WebCore::AccessibilityTable::addChildren): 2013-03-19 Arnaud Renevier [v8] add IDL 'enum' in DOM methods https://bugs.webkit.org/show_bug.cgi?id=112644 Reviewed by Kentaro Hara. This adds V8 support for enumerations in method parameters. Test: bindings/scripts/test/TestObj.idl * bindings/scripts/CodeGeneratorV8.pm: (GenerateParametersCheck): * bindings/scripts/test/V8/V8TestObj.cpp: (WebCore::TestObjV8Internal::methodWithEnumArgMethod): 2013-03-19 Kenneth Russell Unreviewed, rolling out r146277. http://trac.webkit.org/changeset/146277 https://bugs.webkit.org/show_bug.cgi?id=111695 Broke Chromium Android build * Modules/speech/SpeechSynthesis.cpp: (WebCore::SpeechSynthesis::boundaryEventOccurred): (WebCore::SpeechSynthesis::didStartSpeaking): (WebCore::SpeechSynthesis::didPauseSpeaking): (WebCore::SpeechSynthesis::didResumeSpeaking): (WebCore::SpeechSynthesis::didFinishSpeaking): (WebCore::SpeechSynthesis::speakingErrorOccurred): (WebCore): * Modules/speech/SpeechSynthesis.h: (SpeechSynthesis): * Modules/speech/SpeechSynthesisUtterance.cpp: (WebCore::SpeechSynthesisUtterance::SpeechSynthesisUtterance): (WebCore::SpeechSynthesisUtterance::setVoice): * Modules/speech/SpeechSynthesisUtterance.h: (WebCore::SpeechSynthesisUtterance::text): (WebCore::SpeechSynthesisUtterance::setText): (WebCore::SpeechSynthesisUtterance::lang): (WebCore::SpeechSynthesisUtterance::setLang): (WebCore::SpeechSynthesisUtterance::volume): (WebCore::SpeechSynthesisUtterance::setVolume): (WebCore::SpeechSynthesisUtterance::rate): (WebCore::SpeechSynthesisUtterance::setRate): (WebCore::SpeechSynthesisUtterance::pitch): (WebCore::SpeechSynthesisUtterance::setPitch): (WebCore::SpeechSynthesisUtterance::startTime): (WebCore::SpeechSynthesisUtterance::setStartTime): (WebCore::SpeechSynthesisUtterance::platformUtterance): (SpeechSynthesisUtterance): * Modules/speech/SpeechSynthesisVoice.h: * WebCore.exp.in: * WebCore.gypi: * platform/PlatformSpeechSynthesis.h: (PlatformSpeechSynthesis): * platform/PlatformSpeechSynthesisUtterance.cpp: * platform/PlatformSpeechSynthesisUtterance.h: (PlatformSpeechSynthesisUtterance): * platform/PlatformSpeechSynthesisVoice.cpp: (WebCore::PlatformSpeechSynthesisVoice::create): * platform/PlatformSpeechSynthesisVoice.h: (PlatformSpeechSynthesisVoice): * platform/PlatformSpeechSynthesizer.cpp: (WebCore::PlatformSpeechSynthesizer::create): (WebCore::PlatformSpeechSynthesizer::PlatformSpeechSynthesizer): (WebCore): * platform/PlatformSpeechSynthesizer.h: (PlatformSpeechSynthesizerClient): (WebCore::PlatformSpeechSynthesizer::~PlatformSpeechSynthesizer): (PlatformSpeechSynthesizer): * platform/chromium/PlatformSpeechSynthesizerChromium.cpp: Removed. * platform/chromium/support/WebSpeechSynthesisUtterance.cpp: Removed. * platform/chromium/support/WebSpeechSynthesisVoice.cpp: Removed. * platform/chromium/support/WebSpeechSynthesizerClientImpl.cpp: Removed. * platform/chromium/support/WebSpeechSynthesizerClientImpl.h: Removed. * platform/mac/PlatformSpeechSynthesizerMac.mm: (-[WebSpeechSynthesisWrapper speakUtterance:WebCore::]): (-[WebSpeechSynthesisWrapper speechSynthesizer:didFinishSpeaking:]): (WebCore::PlatformSpeechSynthesizer::speak): * platform/mock/PlatformSpeechSynthesizerMock.cpp: (WebCore::PlatformSpeechSynthesizerMock::create): (WebCore::PlatformSpeechSynthesizerMock::PlatformSpeechSynthesizerMock): (WebCore::PlatformSpeechSynthesizerMock::speakingFinished): (WebCore::PlatformSpeechSynthesizerMock::speak): * platform/mock/PlatformSpeechSynthesizerMock.h: (PlatformSpeechSynthesizerMock): 2013-03-19 Antti Koivisto Don't compute background obscuration on every repaint https://bugs.webkit.org/show_bug.cgi?id=112457 Reviewed by Simon Fraser. Test: fast/backgrounds/obscured-background-child-style-change.html It is generally enough to compute background obscuration status once per layout rather than doing it on every repaint. Since there are fewer layouts than repaints this will allow more expensive checks in the future. With this patch adds caching and invalidation of the obscuration status. * rendering/RenderBlock.cpp: (WebCore::RenderBlock::layout): Invalidate the obscuration status on layout. * rendering/RenderBox.cpp: (WebCore::RenderBox::styleDidChange): Invalidate the parent obscuration status if there is repaint-only style change (often background related). Tested by the new fast/css/obscured-background-child-style-change.html. (WebCore::RenderBox::layout): (WebCore::RenderBox::computeBackgroundIsKnownToBeObscured): * rendering/RenderBox.h: * rendering/RenderImage.cpp: (WebCore::RenderImage::imageChanged): (WebCore::RenderImage::notifyFinished): (WebCore::RenderImage::boxShadowShouldBeAppliedToBackground): (WebCore::RenderImage::computeBackgroundIsKnownToBeObscured): Use CachedImage::currentFrameKnownToBeOpaque which ensures that the frame is decoded and we get the real status. Tested by an additional case in fast/css/obscured-background-child-style-change.html. * rendering/RenderImage.h: * rendering/RenderObject.cpp: (WebCore::RenderObject::styleWillChange): * rendering/RenderObject.h: (WebCore::RenderObject::hasBoxDecorations): (WebCore::RenderObject::computeBackgroundIsKnownToBeObscured): (WebCore::RenderObject::RenderObjectBitfields::RenderObjectBitfields): (RenderObjectBitfields): (WebCore::RenderObject::RenderObjectBitfields::boxDecorationState): (WebCore::RenderObject::RenderObjectBitfields::setBoxDecorationState): Combine box decoration bit and the obscuration status so we only need one extra bit. (WebCore::RenderObject::setNeedsSimplifiedNormalFlowLayout): (WebCore::RenderObject::setHasBoxDecorations): (WebCore::RenderObject::invalidateBackgroundObscurationStatus): (WebCore::RenderObject::backgroundIsKnownToBeObscured): * rendering/RenderReplaced.cpp: (WebCore::RenderReplaced::layout): 2013-03-19 Dominic Mazzoni Implement Web Speech Synthesis for Chromium https://bugs.webkit.org/show_bug.cgi?id=111695 Reviewed by Adam Barth. Straightforward implementation of speech synthesis for Chromium by exposing interfaces for the platform to implement. * Modules/speech/SpeechSynthesis.cpp: (WebCore::SpeechSynthesis::boundaryEventOccurred): (WebCore::SpeechSynthesis::didStartSpeaking): (WebCore::SpeechSynthesis::didPauseSpeaking): (WebCore::SpeechSynthesis::didResumeSpeaking): (WebCore::SpeechSynthesis::didFinishSpeaking): (WebCore::SpeechSynthesis::speakingErrorOccurred): (WebCore): * Modules/speech/SpeechSynthesis.h: (SpeechSynthesis): * Modules/speech/SpeechSynthesisUtterance.cpp: (WebCore::SpeechSynthesisUtterance::SpeechSynthesisUtterance): (WebCore): (WebCore::SpeechSynthesisUtterance::~SpeechSynthesisUtterance): (WebCore::SpeechSynthesisUtterance::setVoice): * Modules/speech/SpeechSynthesisUtterance.h: (SpeechSynthesisUtterance): (WebCore::SpeechSynthesisUtterance::text): (WebCore::SpeechSynthesisUtterance::setText): (WebCore::SpeechSynthesisUtterance::lang): (WebCore::SpeechSynthesisUtterance::setLang): (WebCore::SpeechSynthesisUtterance::volume): (WebCore::SpeechSynthesisUtterance::setVolume): (WebCore::SpeechSynthesisUtterance::rate): (WebCore::SpeechSynthesisUtterance::setRate): (WebCore::SpeechSynthesisUtterance::pitch): (WebCore::SpeechSynthesisUtterance::setPitch): (WebCore::SpeechSynthesisUtterance::startTime): (WebCore::SpeechSynthesisUtterance::setStartTime): (WebCore::SpeechSynthesisUtterance::platformUtterance): * Modules/speech/SpeechSynthesisVoice.h: (WebCore::SpeechSynthesisVoice::~SpeechSynthesisVoice): * WebCore.exp.in: * WebCore.gypi: * platform/PlatformSpeechSynthesis.h: (PlatformSpeechSynthesis): * platform/PlatformSpeechSynthesisUtterance.cpp: (WebCore): (WebCore::PlatformSpeechSynthesisUtterance::create): * platform/PlatformSpeechSynthesisUtterance.h: (PlatformSpeechSynthesisUtterance): (WebCore::PlatformSpeechSynthesisUtterance::setClient): * platform/PlatformSpeechSynthesisVoice.cpp: (WebCore): (WebCore::PlatformSpeechSynthesisVoice::create): (WebCore::PlatformSpeechSynthesisVoice::PlatformSpeechSynthesisVoice): * platform/PlatformSpeechSynthesisVoice.h: (PlatformSpeechSynthesisVoice): (WebCore::PlatformSpeechSynthesisVoice::setVoiceURI): (WebCore::PlatformSpeechSynthesisVoice::setName): (WebCore::PlatformSpeechSynthesisVoice::setLang): (WebCore::PlatformSpeechSynthesisVoice::setLocalService): (WebCore::PlatformSpeechSynthesisVoice::setIsDefault): * platform/PlatformSpeechSynthesizer.cpp: (WebCore::PlatformSpeechSynthesizer::create): (WebCore::PlatformSpeechSynthesizer::setVoiceList): (WebCore): * platform/PlatformSpeechSynthesizer.h: (WebKit): (PlatformSpeechSynthesizerClient): (PlatformSpeechSynthesizer): * platform/chromium/PlatformSpeechSynthesizerChromium.cpp: Added. (WebCore): (WebCore::PlatformSpeechSynthesizer::PlatformSpeechSynthesizer): (WebCore::PlatformSpeechSynthesizer::~PlatformSpeechSynthesizer): (WebCore::PlatformSpeechSynthesizer::initializeVoiceList): (WebCore::PlatformSpeechSynthesizer::speak): (WebCore::PlatformSpeechSynthesizer::pause): (WebCore::PlatformSpeechSynthesizer::resume): (WebCore::PlatformSpeechSynthesizer::cancel): * platform/chromium/support/WebSpeechSynthesisUtterance.cpp: Added. (WebKit): (WebKit::WebSpeechSynthesisUtterance::WebSpeechSynthesisUtterance): (WebKit::WebSpeechSynthesisUtterance::operator=): (WebKit::WebSpeechSynthesisUtterance::assign): (WebKit::WebSpeechSynthesisUtterance::reset): (WebKit::WebSpeechSynthesisUtterance::operator PassRefPtr): (WebKit::WebSpeechSynthesisUtterance::operator PlatformSpeechSynthesisUtterance*): (WebKit::WebSpeechSynthesisUtterance::text): (WebKit::WebSpeechSynthesisUtterance::lang): (WebKit::WebSpeechSynthesisUtterance::voice): (WebKit::WebSpeechSynthesisUtterance::volume): (WebKit::WebSpeechSynthesisUtterance::rate): (WebKit::WebSpeechSynthesisUtterance::pitch): (WebKit::WebSpeechSynthesisUtterance::startTime): * platform/chromium/support/WebSpeechSynthesisVoice.cpp: Added. (WebKit): (WebKit::WebSpeechSynthesisVoice::assign): (WebKit::WebSpeechSynthesisVoice::reset): (WebKit::WebSpeechSynthesisVoice::setVoiceURI): (WebKit::WebSpeechSynthesisVoice::setName): (WebKit::WebSpeechSynthesisVoice::setLanguage): (WebKit::WebSpeechSynthesisVoice::setIsLocalService): (WebKit::WebSpeechSynthesisVoice::setIsDefault): (WebKit::WebSpeechSynthesisVoice::operator PassRefPtr): * platform/chromium/support/WebSpeechSynthesizerClientImpl.cpp: Added. (WebCore): (WebCore::WebSpeechSynthesizerClientImpl::WebSpeechSynthesizerClientImpl): (WebCore::WebSpeechSynthesizerClientImpl::~WebSpeechSynthesizerClientImpl): (WebCore::WebSpeechSynthesizerClientImpl::setVoiceList): (WebCore::WebSpeechSynthesizerClientImpl::didStartSpeaking): (WebCore::WebSpeechSynthesizerClientImpl::didFinishSpeaking): (WebCore::WebSpeechSynthesizerClientImpl::didPauseSpeaking): (WebCore::WebSpeechSynthesizerClientImpl::didResumeSpeaking): (WebCore::WebSpeechSynthesizerClientImpl::speakingErrorOccurred): (WebCore::WebSpeechSynthesizerClientImpl::wordBoundaryEventOccurred): (WebCore::WebSpeechSynthesizerClientImpl::sentenceBoundaryEventOccurred): * platform/chromium/support/WebSpeechSynthesizerClientImpl.h: Added. (WebCore): (WebSpeechSynthesizerClientImpl): * platform/mac/PlatformSpeechSynthesizerMac.mm: (-[WebSpeechSynthesisWrapper speakUtterance:WebCore::]): (-[WebSpeechSynthesisWrapper speechSynthesizer:didFinishSpeaking:]): (WebCore::PlatformSpeechSynthesizer::PlatformSpeechSynthesizer): (WebCore): (WebCore::PlatformSpeechSynthesizer::~PlatformSpeechSynthesizer): (WebCore::PlatformSpeechSynthesizer::speak): * platform/mock/PlatformSpeechSynthesizerMock.cpp: (WebCore::PlatformSpeechSynthesizerMock::PlatformSpeechSynthesizerMock): (WebCore::PlatformSpeechSynthesizerMock::speakingFinished): (WebCore::PlatformSpeechSynthesizerMock::speak): * platform/mock/PlatformSpeechSynthesizerMock.h: (PlatformSpeechSynthesizerMock): 2013-03-19 Ryosuke Niwa Another build fix after r146220. * English.lproj/localizedStrings.js: 2013-03-19 Julien Chaffraix [CSS Grid Layout] Add parsing for grid-auto-{row|column} https://bugs.webkit.org/show_bug.cgi?id=112724 Reviewed by Tony Chang. This change is a first step towards handling grid-auto-{row|column}. For now, only the parsing, storing and getComputedStyle bits are implemented. In order to do so without duplicating code, the functions handling (named in the code based on a previous version of the grammar) have been tweaked to be called in a standalone fashion. The code was also updated to match the grammar more closely: - is now . - was renmoved, folded into . Test: fast/css-grid-layout/grid-auto-columns-rows-get-set.html * css/CSSComputedStyleDeclaration.cpp: (WebCore::valueForGridTrackSize): Renamed from valueForGridTrackMinMax. (WebCore::valueForGridTrackList): Folded valueForGridTrackGroup here. (WebCore::CSSComputedStyleDeclaration::getPropertyCSSValue): * css/CSSParser.cpp: (WebCore::CSSParser::parseValue): Added the parsing for grid-auto-{rows|columns}. (WebCore::CSSParser::parseGridTrackSize): Renamed from parseGridTrackMinMax. Changed to return the parsed value (or 0 in case of error). This enables us to reuse it in parseValue. Note that this function now moves the parser value list instead of the caller. (WebCore::CSSParser::parseGridTrackList): Updated after parseGridTrackSize changes and parseGridTrackGroup removal. * css/CSSParser.h: Updated the names. * css/CSSProperty.cpp: (WebCore::CSSProperty::isInheritedProperty): * css/CSSPropertyNames.in: Added the 2 new non-inherited properties. * css/StyleResolver.cpp: (WebCore::createGridTrackSize): Renamed from createGridTrackMinMax. Also simplified to ensure code reuse (applyProperty hands down a CSSValue) and consistency (the state wasn't consistently the last argument). (WebCore::createGridTrackList): Folded createGridTrackGroup into this function. (WebCore::StyleResolver::applyProperty): Added the code for the new properties. * rendering/style/RenderStyle.h: * rendering/style/StyleGridData.cpp: (WebCore::StyleGridData::StyleGridData): * rendering/style/StyleGridData.h: (WebCore::StyleGridData::operator==): Added the storage and boiler-plate code for the new properties. 2013-03-19 Geoffrey Garen Removed a using declaration to avoid name conflicts https://bugs.webkit.org/show_bug.cgi?id=112752 Reviewed by Ryosuke Niwa. * html/ClassList.cpp: Put the using declaration here instead. * html/ClassList.h: Don't put a using declaration in this header because it can cause name conflicts with SVGNames. 2013-03-18 Ojan Vafai Make intrinsic size keywords on flexboxes work https://bugs.webkit.org/show_bug.cgi?id=112652 Reviewed by Tony Chang. Tests: fast/css-intrinsic-dimensions/intrinsic-sized-column-flex-items.html fast/css-intrinsic-dimensions/intrinsic-sized-flex-items.html * platform/Length.h: (WebCore::Length::isSpecifiedOrIntrinsic): * rendering/RenderBox.cpp: (WebCore::RenderBox::constrainLogicalWidthInRegionByMinMax): (WebCore::RenderBox::computeLogicalWidthInRegion): (WebCore::RenderBox::computeLogicalWidthInRegionUsing): Pass in the Length so that RenderFlexibleBox can call this method and avoid doing a bunch of code duplication. * rendering/RenderBox.h: * rendering/RenderFlexibleBox.cpp: (WebCore::RenderFlexibleBox::computeMainAxisExtentForChild): Instead of just calling valueForLength, call computeLogicalWidthInRegionUsing so that we properly resolve intrinsic Length types. Incidentally, this should also make viewport percentage units work. (WebCore::RenderFlexibleBox::adjustChildSizeForMinAndMax): Resolve intrinsic min/max Lengths. Also, instead of calling minPreferredLogicalWidth for the min-width: auto case, call computeMainAxisExtentForChild to correctly compute the min intrinsic size. 2013-03-19 Geoffrey Garen Try to fix the Windows build. * svg/SVGAnimateMotionElement.cpp: (WebCore::SVGAnimateMotionElement::hasValidAttributeType): Qualify the namespace to avoid conflicts. 2013-03-19 Ryosuke Niwa Windows build fix after r146264. * svg/SVGAnimateMotionElement.cpp: (WebCore::SVGAnimateMotionElement::hasValidAttributeType): 2013-03-19 Nate Chapin REGRESSION(r146223): chromium asserts/crashes in DocumentLoader https://bugs.webkit.org/show_bug.cgi?id=112745 Reviewed by Kenneth Russell. Fixes layout tests on chromium debug * loader/DocumentLoader.cpp: (WebCore::DocumentLoader::mainReceivedError): Frame might be detached, get defersLoading() from mainResourceLoader(). (WebCore::DocumentLoader::responseReceived): RefPtr got dropped, it's really needed. (WebCore::DocumentLoader::receivedData): Frame might be detached, get defersLoading() from mainResourceLoader(). (WebCore::DocumentLoader::cancelMainResourceLoad): The ResourceError parameter can be null if coming from the WebKit layer, we should have a default just in case. 2013-03-19 Geoffrey Garen Refactored script content removal in the fragment parser for clarity and speed https://bugs.webkit.org/show_bug.cgi?id=112734 Reviewed by Enrica Casucci. * WebCore.exp.in: Export! * dom/DocumentFragment.cpp: (WebCore::DocumentFragment::parseHTML): (WebCore::DocumentFragment::parseXML): * dom/DocumentFragment.h: (DocumentFragment): Updated for rename of FragmentScriptingPermission to ParserContentPolicy. * dom/Element.cpp: (WebCore::isEventHandlerAttribute): (WebCore::Element::isJavaScriptURLAttribute): (WebCore::Element::isJavaScriptAttribute): Fixed a FIXME by factoring out some helper functions that reuse isURLAttribute(). This makes our attribute removal slightly more precise, as reflected in test changes. (WebCore::Element::stripJavaScriptAttributes): Factored this function out of parserSetAttributes to clarify that the parser is responsible for fully removing scripts before inserting anything into the DOM. Now that this is a helper function, we can avoid doing any work in the common case, where script content is allowed. Also, when we do have to strip attributes, we use "two finger compaction" to avoid copying the vector, and to avoid O(N) vector removal operations when there is something to remove. (WebCore::Element::parserSetAttributes): * dom/Element.h: * dom/FragmentScriptingPermission.h: (WebCore::scriptingContentIsAllowed): (WebCore::disallowScriptingContent): (WebCore::pluginContentIsAllowed): (WebCore::allowPluginContent): Renamed for clarity, and added some helper functions for reading values out of this enum. * dom/ScriptableDocumentParser.cpp: (WebCore::ScriptableDocumentParser::ScriptableDocumentParser): Moved a settings check into the parser constructor so we're sure that all clients get the right behavior. * dom/ScriptableDocumentParser.h: (WebCore::ScriptableDocumentParser::parserContentPolicy): (ScriptableDocumentParser): * editing/markup.cpp: (WebCore::createFragmentFromMarkup): (WebCore::createFragmentFromMarkupWithContext): (WebCore::createFragmentForInnerOuterHTML): (WebCore::createContextualFragment): * editing/markup.h: Updated for renames. * html/HTMLAnchorElement.cpp: (WebCore::HTMLAnchorElement::isURLAttribute): Fixed a bug where isURLAttribute would ignore href attributes in other namespaces, like xlink:href. * html/HTMLBaseElement.cpp: (WebCore::HTMLBaseElement::isURLAttribute): Same bug. * html/HTMLElement.cpp: (WebCore::HTMLElement::isURLAttribute): Fixed a logic error where HTMLElement wouldn't call through to its base class. * html/HTMLLinkElement.cpp: (WebCore::HTMLLinkElement::isURLAttribute): Same isURLAttribute namespace bug as above. * html/parser/HTMLConstructionSite.cpp: (WebCore::setAttributes): Helper function for optionally stripping disallowed attributes before setting them on an element. This helps all clients get the right behavior without sprinkling checks everywhere. (WebCore::HTMLConstructionSite::HTMLConstructionSite): (WebCore::HTMLConstructionSite::insertHTMLHtmlStartTagBeforeHTML): (WebCore::HTMLConstructionSite::insertScriptElement): Don't schedule the element for insertion into the document if the element is forbidden. This is slightly clearer than leaving an empty forbidden element in the document. (WebCore::HTMLConstructionSite::createElement): (WebCore::HTMLConstructionSite::createHTMLElement): * html/parser/HTMLConstructionSite.h: (HTMLConstructionSite): (WebCore::HTMLConstructionSite::parserContentPolicy): * html/parser/HTMLDocumentParser.cpp: (WebCore::HTMLDocumentParser::HTMLDocumentParser): (WebCore::HTMLDocumentParser::runScriptsForPausedTreeBuilder): (WebCore::HTMLDocumentParser::parseDocumentFragment): * html/parser/HTMLDocumentParser.h: (HTMLDocumentParser): (WebCore::HTMLDocumentParser::create): * html/parser/HTMLTreeBuilder.cpp: (WebCore::HTMLTreeBuilder::HTMLTreeBuilder): (WebCore::HTMLTreeBuilder::FragmentParsingContext::FragmentParsingContext): Updated for renames and interface changes above. (WebCore::HTMLTreeBuilder::processStartTagForInBody): (WebCore::HTMLTreeBuilder::processEndTag): Removed isParsingFragment() checks to make it possible to use ParserContentPolicy in more places. Removed call to removeChildren() because, if an element is forbidden, we fully remove the element now. This brings behavior for tag when not in foreign content mode. We need to do the same. This involved creating a namespace stack where we push upon entering each namespace and pop upon leaving. We are in foreign content if the topmost namespace is SVG or MathML. This fixes svg/in-html/script-write.html and likely others. * html/parser/BackgroundHTMLParser.cpp: (WebCore::BackgroundHTMLParser::simulateTreeBuilder): * html/parser/BackgroundHTMLParser.h: (BackgroundHTMLParser): * html/parser/CompactHTMLToken.cpp: (WebCore::CompactHTMLToken::getAttributeItem): Returns the attribute of the given name. Necessary to test for attributes in simulateTreeBuilder. (WebCore): * html/parser/CompactHTMLToken.h: (WebCore): (CompactHTMLToken): 2013-02-13 Andreas Kling Remove Element::getAttributeItem() overload that returned a mutable Attribute*. Reviewed by Antti Koivisto. Remove this to prevent callers from accidentally causing elements to convert to UniqueElementData. There are two call sites (Attr and HTMLSelectElement) that legitimately need to mutate Attribute objects in-place, they now use Element::ensureUniqueElementData()->getAttributeItem() directly instead. Small progression on Membuster3, mostly for peace of mind. * dom/Attr.cpp: (WebCore::Attr::elementAttribute): * dom/Element.h: (Element): * html/HTMLInputElement.cpp: (WebCore::HTMLInputElement::updateType): * html/HTMLSelectElement.cpp: (WebCore::HTMLSelectElement::parseAttribute): * svg/SVGStyledElement.cpp: (WebCore::SVGStyledElement::getPresentationAttribute): 2013-02-13 Andreas Kling Stronger ElementData pointer typing. Reviewed by Antti Koivisto. Use ShareableElementData/UniqueElementData pointers instead of generic ElementData pointers where possible. Moved some methods from base class into leaf classes that don't make sense for both classes. * dom/DocumentSharedObjectPool.cpp: (WebCore::ShareableElementDataCacheEntry::ShareableElementDataCacheEntry): (ShareableElementDataCacheEntry): (WebCore::DocumentSharedObjectPool::cachedShareableElementDataWithAttributes): * dom/DocumentSharedObjectPool.h: (DocumentSharedObjectPool): * dom/Element.cpp: (WebCore::Element::parserSetAttributes): (WebCore::Element::setAttributeNode): (WebCore::Element::removeAttributeInternal): (WebCore::Element::cloneAttributesFromElement): (WebCore::Element::createUniqueElementData): (WebCore::ShareableElementData::createWithAttributes): (WebCore::UniqueElementData::create): (WebCore::ElementData::makeUniqueCopy): (WebCore::UniqueElementData::makeShareableCopy): * dom/Element.h: (ElementData): (ShareableElementData): (UniqueElementData): (Element): (WebCore::Element::ensureUniqueElementData): * dom/StyledElement.cpp: (WebCore::StyledElement::rebuildPresentationAttributeStyle): 2013-02-13 Antti Koivisto Reschedule shared CFRunLoopTimer instead of reconstructing it https://bugs.webkit.org/show_bug.cgi?id=109765 Reviewed by Andreas Kling and Anders Carlsson. Using CFRunLoopTimerSetNextFireDate is over 2x faster than deleting and reconstructing timers. * platform/mac/SharedTimerMac.mm: (WebCore): (WebCore::PowerObserver::restartSharedTimer): (WebCore::sharedTimer): (WebCore::setSharedTimerFireInterval): (WebCore::stopSharedTimer): 2013-02-13 Emil A Eklund getComputedStyle returns truncated value for margin-right https://bugs.webkit.org/show_bug.cgi?id=109759 Reviewed by Tony Chang. Due to an unfortunate cast in CSSComputedStyleDeclaration:: getPropertyCSSValue getComputedStyle returns truncated styles for margin-right in cases where it isn't set to a specific pixel value. Test: fast/sub-pixel/computedstylemargin.html * css/CSSComputedStyleDeclaration.cpp: (WebCore::CSSComputedStyleDeclaration::getPropertyCSSValue): Change type of temporary value variable to float to prevent loss of precision. 2013-02-13 Max Vujovic [CSS Filters] Refactor filter outsets into a class https://bugs.webkit.org/show_bug.cgi?id=109330 Reviewed by Dean Jackson. In filters related code, we're often operating on 4 ints representing the top, right, bottom, and left filter outsets. These outsets come from a filter like blur or drop-shadow. This patch packages those ints and their related operations into a class called IntRectExtent. Here are some signs that we should make a class to hold those 4 ints: 1) In RenderLayer.cpp, we have a expandRectForFilterOutsets function, which looks like feature envy. 2) RenderStyle and other classes have methods like getFilterOutsets which set the 4 ints by reference. The calling code has to define 4 ints, which looks bloated. 3) To fix bug 109098, we will need to check if filter outsets changed, which sounds like a nice job for an inequality operator. (https://bugs.webkit.org/show_bug.cgi?id=109098) No new tests. No change in behavior. Just refactoring. * GNUmakefile.list.am: * Target.pri: * WebCore.gypi: * WebCore.xcodeproj/project.pbxproj: * platform/graphics/IntRectExtent.h: Added. (WebCore): (IntRectExtent): (WebCore::IntRectExtent::IntRectExtent): (WebCore::IntRectExtent::top): (WebCore::IntRectExtent::setTop): (WebCore::IntRectExtent::right): (WebCore::IntRectExtent::setRight): (WebCore::IntRectExtent::bottom): (WebCore::IntRectExtent::setBottom): (WebCore::IntRectExtent::left): (WebCore::IntRectExtent::setLeft): (WebCore::IntRectExtent::expandRect): (WebCore::IntRectExtent::isZero): (WebCore::operator==): (WebCore::operator!=): (WebCore::operator+=): * platform/graphics/filters/FilterOperations.cpp: (WebCore::FilterOperations::outsets): * platform/graphics/filters/FilterOperations.h: (FilterOperations): * platform/graphics/texmap/TextureMapperLayer.cpp: (WebCore::TextureMapperLayer::intermediateSurfaceRect): * rendering/FilterEffectRenderer.cpp: (WebCore::FilterEffectRenderer::FilterEffectRenderer): (WebCore::FilterEffectRenderer::build): (WebCore::FilterEffectRenderer::computeSourceImageRectForDirtyRect): * rendering/FilterEffectRenderer.h: (FilterEffectRenderer): * rendering/RenderLayer.cpp: (WebCore::RenderLayer::setFilterBackendNeedsRepaintingInRect): (WebCore::transparencyClipBox): (WebCore::RenderLayer::calculateLayerBounds): * rendering/style/RenderStyle.h: 2013-02-13 Adam Barth Factor HTMLTokenScanner out of HTMLPreloadScanner https://bugs.webkit.org/show_bug.cgi?id=109754 Reviewed by Eric Seidel. This patch is just a mechanical separation of the per-token "scanning" logic from HTMLPreloadScanner into a separate class. HTMLPreloadScanner's job is now to keep track of the input stream and to pump the tokenizer. This factorization class will let us use HTMLTokenScanner on the background thread (once we finish making it thread-safe). In a follow up patch, I'll move HTMLTokenScanner to its own file. * html/parser/HTMLPreloadScanner.cpp: (WebCore::HTMLTokenScanner::HTMLTokenScanner): (WebCore::HTMLTokenScanner::~HTMLTokenScanner): (WebCore::HTMLTokenScanner::processPossibleTemplateTag): (WebCore::HTMLTokenScanner::processPossibleStyleTag): (WebCore::HTMLTokenScanner::processPossibleBaseTag): (WebCore::HTMLTokenScanner::scan): (WebCore::HTMLPreloadScanner::HTMLPreloadScanner): (WebCore): (WebCore::HTMLPreloadScanner::~HTMLPreloadScanner): (WebCore::HTMLPreloadScanner::appendToEnd): (WebCore::HTMLPreloadScanner::scan): * html/parser/HTMLPreloadScanner.h: (HTMLTokenScanner): (WebCore::HTMLTokenScanner::setPredictedBaseElementURL): (HTMLPreloadScanner): (WebCore): 2013-02-13 Elliott Sprehn ASSERT(!renderer()->needsLayout()) when calling Element::focus() with generated content https://bugs.webkit.org/show_bug.cgi?id=109616 Reviewed by Julien Chaffraix. Test: fast/css-generated-content/quote-layout-focus-crash.html In some cases RenderQuote may mark itself and containing blocks as needing layout during a layout, but then one of it's containing blocks will mark itself as having finished layout so the RenderQuote and potentially some of it's ancestor renderers needLayout(), but the ancestors above those do not. Until we have proper pre-layout tasks we should just walk the list of quotes right before layout and mark all their ancestors as needing layout if the quote needs layout. * dom/Document.cpp: (WebCore::Document::updateLayout): Call markQuoteContainingBlocksForLayoutIfNeeded. (WebCore::Document::implicitClose): Call markQuoteContainingBlocksForLayoutIfNeeded. * rendering/RenderQuote.h: (WebCore::RenderQuote::next): Added. * rendering/RenderView.cpp: (WebCore::RenderView::markQuoteContainingBlocksForLayoutIfNeeded): Added. * rendering/RenderView.h: (RenderView): 2013-02-13 Jer Noble EME: MediaPlayer::keyNeede() should return a bool indicating whether an event listener was triggered. https://bugs.webkit.org/show_bug.cgi?id=109701 Reviewed by Eric Carlson. Clients of MediaPlayer may need to do cleanup if calling keyNeeded() results in no event listener being triggered. Return a bool (like the v1 equivalent keyNeeded method) to indicate this. * html/HTMLMediaElement.cpp: (WebCore::HTMLMediaElement::mediaPlayerKeyNeeded): * html/HTMLMediaElement.h: * platform/graphics/MediaPlayer.cpp: (WebCore::MediaPlayer::keyNeeded): * platform/graphics/MediaPlayer.h: (WebCore::MediaPlayerClient::mediaPlayerKeyNeeded): 2013-02-13 Abhishek Arya ASSERTION FAILED: !object || object->isBox(), Bad cast in RenderBox::computeLogicalHeight https://bugs.webkit.org/show_bug.cgi?id=107748 Reviewed by Levi Weintraub. Make sure that body renderer is not an inline-block display when determining that it stretches to viewport or when paginated content needs base height. Test: fast/block/body-inline-block-crash.html * rendering/RenderBox.cpp: (WebCore::RenderBox::computeLogicalHeight): * rendering/RenderBox.h: (WebCore::RenderBox::stretchesToViewport): 2013-02-13 Shawn Singh Fix debug assertion being triggered because we may access dirty normalFlowList. https://bugs.webkit.org/show_bug.cgi?id=109740 A debug assertion in RenderLayer.h is being hit when trying to access the normalFlowList when it is dirty. This is caused by a new recursion that I added in RenderLayerBacking::hasVisibleNonCompositingDescendant(), but I overlooked the need to call updateLayerListsIfNeeded() recursively as well. Reviewed by Simon Fraser. No test, because there's no reliable way to test this (same as bug 85512). * rendering/RenderLayerBacking.cpp: (WebCore::hasVisibleNonCompositingDescendant): (WebCore::RenderLayerBacking::hasVisibleNonCompositingDescendantLayers): 2013-02-13 Antti Koivisto Don't restart shared timer if both the current and the new fire time are in the past https://bugs.webkit.org/show_bug.cgi?id=109731 Reviewed by Andreas Kling. In 40-50% of cases we reschedule the shared timer both the old and the new fire time have already passed. This can happen at least when rescheduling a zero duration timer and when stopping a timer that was ready to fire. We can skip rescheduling in this case, the shared timer will fire immediately anyway. Scheduling timers calls into platform layer and can be slow. This about halves the time under setSharedTimerFireInterval in PLT3 for ~0.1% total CPU time reduction. * platform/ThreadTimers.cpp: (WebCore::ThreadTimers::ThreadTimers): (WebCore::ThreadTimers::setSharedTimer): (WebCore::ThreadTimers::updateSharedTimer): (WebCore::ThreadTimers::sharedTimerFiredInternal): * platform/ThreadTimers.h: (ThreadTimers): 2013-02-13 Zan Dobersek The 'global isinf/isnan' compiler quirk required when using clang with libstdc++ https://bugs.webkit.org/show_bug.cgi?id=109325 Reviewed by Anders Carlsson. Prefix calls to the isinf and isnan methods with std::, declaring we want to use the two methods as they're provided by the C++ standard library being used. No new tests as there's no change in functionality. * Modules/mediasource/MediaSource.cpp: (WebCore::MediaSource::setDuration): * Modules/webaudio/AudioBufferSourceNode.cpp: (WebCore::AudioBufferSourceNode::totalPitchRate): * Modules/webaudio/AudioParam.cpp: (WebCore::AudioParam::setValue): * Modules/webaudio/AudioParamTimeline.cpp: (WebCore::isValidNumber): * Modules/webaudio/PannerNode.cpp: (WebCore::fixNANs): * bindings/js/IDBBindingUtilities.cpp: (WebCore::createIDBKeyFromValue): * bindings/js/JSDataViewCustom.cpp: (WebCore::getDataViewMember): * bindings/js/JSGeolocationCustom.cpp: (WebCore::setTimeout): (WebCore::setMaximumAge): * bindings/js/JSHTMLOptionsCollectionCustom.cpp: (WebCore::JSHTMLOptionsCollection::setLength): * bindings/js/JSWebKitPointCustom.cpp: (WebCore::JSWebKitPointConstructor::constructJSWebKitPoint): * bindings/scripts/CodeGeneratorJS.pm: (GenerateImplementation): (GenerateParametersCheck): * bindings/scripts/CodeGeneratorV8.pm: (GenerateParametersCheck): * bindings/scripts/test/JS/JSFloat64Array.cpp: (WebCore::JSFloat64Array::getByIndex): * bindings/scripts/test/JS/JSTestObj.cpp: (WebCore::jsTestObjPrototypeFunctionClassMethodWithClamp): * bindings/scripts/test/V8/V8TestObj.cpp: (WebCore::TestObjV8Internal::classMethodWithClampCallback): * bindings/v8/IDBBindingUtilities.cpp: (WebCore::createIDBKeyFromValue): * bindings/v8/V8Binding.cpp: (WebCore::toInt32): (WebCore::toUInt32): * bindings/v8/custom/V8GeolocationCustom.cpp: (WebCore::createPositionOptions): * bindings/v8/custom/V8HTMLOptionsCollectionCustom.cpp: (WebCore::V8HTMLOptionsCollection::lengthAccessorSetter): * bindings/v8/custom/V8WebKitPointCustom.cpp: (WebCore::V8WebKitPoint::constructorCallbackCustom): * bridge/qt/qt_runtime.cpp: (JSC::Bindings::convertValueToQVariant): * css/WebKitCSSMatrix.cpp: (WebCore::WebKitCSSMatrix::translate): (WebCore::WebKitCSSMatrix::scale): (WebCore::WebKitCSSMatrix::rotate): (WebCore::WebKitCSSMatrix::rotateAxisAngle): (WebCore::WebKitCSSMatrix::skewX): (WebCore::WebKitCSSMatrix::skewY): * html/HTMLMediaElement.cpp: (WebCore::HTMLMediaElement::percentLoaded): (WebCore::HTMLMediaElement::mediaPlayerTimeChanged): (WebCore::HTMLMediaElement::endedPlayback): * html/MediaController.cpp: (MediaController::duration): * html/canvas/WebGLRenderingContext.cpp: (WebCore): (WebCore::WebGLRenderingContext::clearColor): * html/track/TextTrack.cpp: (WebCore::TextTrack::addCue): * html/track/TextTrackCue.cpp: (WebCore::TextTrackCue::setStartTime): (WebCore::TextTrackCue::setEndTime): * page/DOMWindow.cpp: (WebCore::DOMWindow::adjustWindowRect): * page/WindowFeatures.cpp: (WebCore::WindowFeatures::floatFeature): Also include an opportunistic style fix. * platform/CalculationValue.cpp: (WebCore::CalculationValue::evaluate): * platform/Decimal.cpp: (WebCore::Decimal::fromDouble): * platform/Length.cpp: (WebCore::Length::nonNanCalculatedValue): * platform/audio/AudioResampler.cpp: (WebCore::AudioResampler::setRate): * platform/audio/DynamicsCompressorKernel.cpp: (WebCore::DynamicsCompressorKernel::process): * platform/audio/Reverb.cpp: (WebCore::calculateNormalizationScale): * platform/graphics/Font.cpp: (WebCore::Font::width): * platform/graphics/avfoundation/MediaPlayerPrivateAVFoundation.h: (WebCore::MediaPlayerPrivateAVFoundation::isLiveStream): * platform/graphics/gpu/LoopBlinnMathUtils.cpp: (LoopBlinnMathUtils): * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp: (WebCore::MediaPlayerPrivateGStreamer::buffered): (WebCore::MediaPlayerPrivateGStreamer::maxTimeSeekable): * platform/graphics/mac/MediaPlayerPrivateQTKit.mm: (WebCore::MediaPlayerPrivateQTKit::maxTimeSeekable): * platform/graphics/opentype/OpenTypeVerticalData.cpp: (WebCore::OpenTypeVerticalData::getVerticalTranslationsForGlyphs): * platform/graphics/transforms/TransformationMatrix.cpp: (WebCore::clampEdgeValue): (WebCore::TransformationMatrix::clampedBoundsOfProjectedQuad): * platform/network/ResourceResponseBase.cpp: (WebCore::ResourceResponseBase::parseCacheControlDirectives): * rendering/RenderMediaControlsChromium.cpp: (WebCore::paintMediaSlider): (WebCore::paintMediaVolumeSlider): * rendering/RenderThemeMac.mm: (WebCore::RenderThemeMac::paintMediaSliderTrack): * svg/SVGAnimationElement.cpp: (WebCore::SVGAnimationElement::beginElementAt): (WebCore::SVGAnimationElement::endElementAt): * svg/SVGSVGElement.cpp: (WebCore::SVGSVGElement::setCurrentTime): * svg/animation/SMILTime.h: (WebCore::SMILTime::SMILTime): * svg/animation/SVGSMILElement.cpp: (WebCore::SVGSMILElement::addBeginTime): (WebCore::SVGSMILElement::addEndTime): * xml/XPathFunctions.cpp: (WebCore::XPath::FunSubstring::evaluate): (WebCore::XPath::FunRound::round): * xml/XPathValue.cpp: (WebCore::XPath::Value::toBoolean): Also include an opportunistic style fix. (WebCore::XPath::Value::toString): 2013-02-13 Eric Carlson [Mac] Caption menu should have only one item selected https://bugs.webkit.org/show_bug.cgi?id=109730 Reviewed by Dean Jackson. No new tests, media/track/track-user-preferences.html was modified to test the changes. * CMakeLists.txt: Add CaptionUserPreferences.cpp. * GNUmakefile.list.am: Ditto. * Target.pri: Ditto. * WebCore.gypi: Ditto. * WebCore.vcproj/WebCore.vcproj: Ditto. * WebCore.vcxproj/WebCore.vcxproj: Ditto. * WebCore.xcodeproj/project.pbxproj: Ditto. * html/HTMLMediaElement.cpp: (WebCore::HTMLMediaElement::HTMLMediaElement): Initialize m_processingPreferenceChange. (WebCore::HTMLMediaElement::configureTextTrackGroup): Only end up with one selected track when called because of a preferences change. (WebCore::HTMLMediaElement::captionPreferencesChanged): Call setClosedCaptionsVisible instead of calling markCaptionAndSubtitleTracksAsUnconfigured directly. (WebCore::HTMLMediaElement::markCaptionAndSubtitleTracksAsUnconfigured): Process all tracks, not just track elements. * html/HTMLMediaElement.h: * page/CaptionUserPreferences.cpp: Added so the functionality can be tested in DRT. (WebCore::CaptionUserPreferences::registerForPreferencesChangedCallbacks): (WebCore::CaptionUserPreferences::unregisterForPreferencesChangedCallbacks): (WebCore::CaptionUserPreferences::setUserPrefersCaptions): (WebCore::CaptionUserPreferences::captionPreferencesChanged): (WebCore::CaptionUserPreferences::preferredLanguages): (WebCore::CaptionUserPreferences::setPreferredLanguage): (WebCore::CaptionUserPreferences::displayNameForTrack): * page/CaptionUserPreferences.h: * page/CaptionUserPreferencesMac.h: * page/CaptionUserPreferencesMac.mm: (WebCore::CaptionUserPreferencesMac::registerForPreferencesChangedCallbacks): Moved some logic to base class. (WebCore::CaptionUserPreferencesMac::captionPreferencesChanged): Ditto. 2013-02-13 Hans Muller [CSS Exclusions] ExclusionPolygon reflex vertices should constrain the first fit location. https://bugs.webkit.org/show_bug.cgi?id=107568 Reviewed by Dirk Schulze. The ExclusionPolygon::firstIncludedIntervalLogicalTop() method now includes offset edges for each of the polygon's reflex vertices. The motivation for this change is explained here: http://hansmuller-webkit.blogspot.com/2013/01/getting-to-point-reflex-vertices.html. Test: fast/exclusions/shape-inside/shape-inside-first-fit-reflex.html * rendering/ExclusionPolygon.cpp: (WebCore::isReflexVertex): Given three vertices that represent a pair of connected polygon edges, return true if the second vertex is a reflex vertex. (WebCore::ExclusionPolygon::firstIncludedIntervalLogicalTop): This method now includes offset edges for reflex vertices. * rendering/ExclusionPolygon.h: (WebCore::OffsetPolygonEdge::OffsetPolygonEdge): Added a constructor for creating an OffsetPolygonEdge given a reflex vertex. (WebCore::OffsetPolygonEdge::edgeIndex): Changed this property from unsigned to int. Now using -1 to indicate that the offset edge doesn't correspond to a single polygon edge. 2013-02-13 Adam Barth CSSPreloadScanner should not depend on HTMLToken https://bugs.webkit.org/show_bug.cgi?id=109742 Reviewed by Eric Seidel. There's no need for the CSSPreloadScanner to depend on HTMLToken. On the background thread, we'll likely want to use a CompactHTMLToken for preload scanning, so this dependency is problematic. This patch also teaches the CSSPreloadScanner how to scan LChars. * html/parser/CSSPreloadScanner.cpp: (WebCore::CSSPreloadScanner::~CSSPreloadScanner): (WebCore): (WebCore::CSSPreloadScanner::scan): * html/parser/CSSPreloadScanner.h: (CSSPreloadScanner): * html/parser/HTMLPreloadScanner.cpp: (WebCore::HTMLPreloadScanner::processToken): 2013-02-13 Julien Chaffraix [CSS Grid Layout] Adding or removing grid items doesn't properly recompute the track sizes https://bugs.webkit.org/show_bug.cgi?id=109100 Reviewed by Ojan Vafai. Test: fast/css-grid-layout/grid-item-removal-track-breadth-update.html The test uncovered several bugs in our implementation that is fixed as part of this change. They will be detailed below. * rendering/RenderGrid.cpp: (WebCore::RenderGrid::logicalContentHeightForChild): Added this function to share the code between minContentForChild and maxContentForChild. Also forced a relayout in this case to avoid getting a wrong answer (e.g. the logical height constrained by the previous layout's grid breadth). (WebCore::RenderGrid::minContentForChild): (WebCore::RenderGrid::maxContentForChild): Updated to use logicalContentHeightForChild. (WebCore::RenderGrid::resolveContentBasedTrackSizingFunctions): Updated to match the specification and set max breadth to current breadth per the specification. This made us over-grow some cases in the test. (WebCore::RenderGrid::distributeSpaceToTracks): Updated to match the specification and use an extra variable to do the intermediate spreading. Also removed a now unneeded max. This fixes the case of multiple grid items in the same grid area that was completely broken. (WebCore::RenderGrid::layoutGridItems): Added a FIXME about always relaying out content sized tracks' children. * rendering/RenderGrid.h: Added logicalContentHeightForChild. 2013-02-13 Adam Barth Clean up some style nits in HTMLPreloadScanner https://bugs.webkit.org/show_bug.cgi?id=109738 Reviewed by Tony Gentilcore. This patch just fixes a few style nits I noticed when reading through the code. * html/parser/HTMLPreloadScanner.cpp: (WebCore::StartTagScanner::StartTagScanner): (WebCore::HTMLPreloadScanner::processPossibleStyleTag): (WebCore::HTMLPreloadScanner::processPossibleBaseTag): * html/parser/HTMLResourcePreloader.cpp: (WebCore::PreloadRequest::isSafeToSendToAnotherThread): * html/parser/HTMLResourcePreloader.h: (PreloadRequest): (WebCore::PreloadRequest::PreloadRequest): (WebCore::HTMLResourcePreloader::HTMLResourcePreloader): 2013-02-13 Sheriff Bot Unreviewed, rolling out r142747. http://trac.webkit.org/changeset/142747 https://bugs.webkit.org/show_bug.cgi?id=109746 broke component build (Requested by alecf_gardening on #webkit). * inspector/HeapGraphSerializer.cpp: (WebCore::HeapGraphSerializer::HeapGraphSerializer): (WebCore::HeapGraphSerializer::pushUpdate): (WebCore::HeapGraphSerializer::reportNode): (WebCore::HeapGraphSerializer::toNodeId): (WebCore::HeapGraphSerializer::addRootNode): * inspector/HeapGraphSerializer.h: (WebCore): (HeapGraphSerializer): * inspector/InspectorMemoryAgent.cpp: (WebCore::InspectorMemoryAgent::getProcessMemoryDistributionImpl): 2013-02-13 Levi Weintraub Bidi-Isolated inlines can cause subsequent content to not be rendered https://bugs.webkit.org/show_bug.cgi?id=108137 Reviewed by Eric Seidel. First step in fixing how inline isolates behave with collapsed spaces. webkit.org/b/109624 tracks the overarching issue. Test: fast/text/content-following-inline-isolate-with-collapsed-whitespace.html * rendering/InlineIterator.h: (WebCore::IsolateTracker::addFakeRunIfNecessary): If we enter an isolate while ignoring spaces, ensure we leave it considering them again. This can result in including spaces that should be ignored following the isolate on the line, but failing to do so results in those contents not being rendered at all. 2013-02-13 Andreas Kling Better names for ElementAttributeData & subclasses. Reviewed by Antti Koivisto. - ElementAttributeData => ElementData Because ElementAttributeData won't be a good name once we move some non-attribute related things to this structure. - ImmutableElementAttributeData => ShareableElementData These objects can be shared with other Elements that have the same attribute name/value pairs. - MutableElementAttributeData => UniqueElementData These objects contain data that is unique to a specific Element, and cannot be shared with other Elements. This is what's important about it, not that its underlying storage is mutable. - attributeData() -> elementData() - updatedAttributeData() -> elementDataWithSynchronizedAttributes() - ensureUpdatedAttributeData() -> ensureElementDataWithSynchronizedAttributes() - mutableAttributeData() -> ensureUniqueElementData() Ride-along renames. Much less vague than previous names IMO. * css/StyleResolver.cpp: (WebCore::StyleResolver::canShareStyleWithControl): (WebCore::StyleResolver::sharingCandidateHasIdenticalStyleAffectingAttributes): * dom/Attr.cpp: (WebCore::Attr::elementAttribute): * dom/DocumentSharedObjectPool.cpp: (WebCore::ShareableElementDataCacheKey::ShareableElementDataCacheKey): (WebCore::ShareableElementDataCacheKey::operator!=): (WebCore::ShareableElementDataCacheEntry::ShareableElementDataCacheEntry): (ShareableElementDataCacheEntry): (WebCore::DocumentSharedObjectPool::cachedShareableElementDataWithAttributes): * dom/DocumentSharedObjectPool.h: (DocumentSharedObjectPool): * dom/Element.cpp: (WebCore::Element::detachAttribute): (WebCore::Element::removeAttribute): (WebCore::Element::attributes): (WebCore::Element::getAttribute): (WebCore::Element::setAttribute): (WebCore::Element::setSynchronizedLazyAttribute): (WebCore::Element::setAttributeInternal): (WebCore::Element::attributeChanged): (WebCore::Element::classAttributeChanged): (WebCore::Element::shouldInvalidateDistributionWhenAttributeChanged): (WebCore::Element::parserSetAttributes): (WebCore::Element::hasAttributes): (WebCore::Element::hasEquivalentAttributes): (WebCore::Element::setAttributeNode): (WebCore::Element::removeAttributeNode): (WebCore::Element::removeAttributeInternal): (WebCore::Element::addAttributeInternal): (WebCore::Element::getAttributeNode): (WebCore::Element::getAttributeNodeNS): (WebCore::Element::hasAttribute): (WebCore::Element::hasAttributeNS): (WebCore::Element::computeInheritedLanguage): (WebCore::Element::getURLAttribute): (WebCore::Element::getNonEmptyURLAttribute): (WebCore::Element::cloneAttributesFromElement): (WebCore::Element::createUniqueElementData): (WebCore::Element::reportMemoryUsage): (WebCore::ElementData::deref): (WebCore::ElementData::ElementData): (WebCore::sizeForShareableElementDataWithAttributeCount): (WebCore::ElementData::createShareableWithAttributes): (WebCore::ElementData::createUnique): (WebCore::ShareableElementData::ShareableElementData): (WebCore::ShareableElementData::~ShareableElementData): (WebCore::UniqueElementData::UniqueElementData): (WebCore::ElementData::makeMutableCopy): (WebCore::ElementData::makeImmutableCopy): (WebCore::ElementData::setPresentationAttributeStyle): (WebCore::ElementData::addAttribute): (WebCore::ElementData::removeAttribute): (WebCore::ElementData::isEquivalent): (WebCore::ElementData::reportMemoryUsage): (WebCore::ElementData::getAttributeItemIndexSlowCase): * dom/Element.h: (ElementData): (WebCore::ElementData::isUnique): (ShareableElementData): (UniqueElementData): (WebCore::Element::getAttributeItemIndex): (WebCore::Element::elementData): (Element): (WebCore::Element::elementDataWithSynchronizedAttributes): (WebCore::Element::ensureElementDataWithSynchronizedAttributes): (WebCore::Element::fastHasAttribute): (WebCore::Element::fastGetAttribute): (WebCore::Element::hasAttributesWithoutUpdate): (WebCore::Element::idForStyleResolution): (WebCore::Element::classNames): (WebCore::Element::attributeCount): (WebCore::Element::attributeItem): (WebCore::Element::getAttributeItem): (WebCore::Element::updateInvalidAttributes): (WebCore::Element::hasID): (WebCore::Element::hasClass): (WebCore::Element::ensureUniqueElementData): (WebCore::ElementData::mutableAttributeVector): (WebCore::ElementData::immutableAttributeArray): (WebCore::ElementData::length): (WebCore::ElementData::presentationAttributeStyle): (WebCore::ElementData::getAttributeItem): (WebCore::ElementData::getAttributeItemIndex): (WebCore::ElementData::attributeItem): * dom/Node.cpp: (WebCore::Node::dumpStatistics): (WebCore::Node::compareDocumentPosition): * dom/StyledElement.cpp: (WebCore::StyledElement::updateStyleAttribute): (WebCore::StyledElement::ensureMutableInlineStyle): (WebCore::StyledElement::attributeChanged): (WebCore::StyledElement::inlineStyleCSSOMWrapper): (WebCore::StyledElement::setInlineStyleFromString): (WebCore::StyledElement::styleAttributeChanged): (WebCore::StyledElement::inlineStyleChanged): (WebCore::StyledElement::addSubresourceAttributeURLs): (WebCore::StyledElement::rebuildPresentationAttributeStyle): * dom/StyledElement.h: (WebCore::StyledElement::inlineStyle): (WebCore::StyledElement::invalidateStyleAttribute): (WebCore::StyledElement::presentationAttributeStyle): * html/ClassList.cpp: (WebCore::ClassList::classNames): * html/HTMLInputElement.cpp: (WebCore::HTMLInputElement::updateType): * html/parser/HTMLConstructionSite.cpp: (WebCore::HTMLConstructionSite::mergeAttributesFromTokenIntoElement): * svg/SVGElement.cpp: (WebCore::SVGElement::updateAnimatedSVGAttribute): * svg/SVGElement.h: (WebCore::SVGElement::invalidateSVGAttributes): * xml/parser/XMLDocumentParserQt.cpp: (WebCore::XMLDocumentParser::XMLDocumentParser): 2013-02-13 Christian Biesinger Crash when encountering https://bugs.webkit.org/show_bug.cgi?id=109728 See also https://code.google.com/p/chromium/issues/detail?id=175535 This bug can be reproduced on http://dramalink.net/tudou.y/?xink=162601060 Reviewed by Eric Seidel. Test: fast/css/resize-object-crash.html * rendering/RenderWidget.cpp: (WebCore::RenderWidget::paint): Only call paintResizer() if we have a layer and canResize() is true 2013-02-13 Arko Saha [Microdata] HTMLPropertiesCollection code cleanup https://bugs.webkit.org/show_bug.cgi?id=109721 Reviewed by Ryosuke Niwa. Removed forward declaration of DOMStringList class. Removed unused findRefElements() method declaration. Also Removed unused parameter Element* from updatePropertyCache() method. No new test since no change in behavior. * html/HTMLPropertiesCollection.cpp: (WebCore::HTMLPropertiesCollection::updateNameCache): * html/HTMLPropertiesCollection.h: (WebCore): (HTMLPropertiesCollection): (WebCore::HTMLPropertiesCollection::updatePropertyCache): 2013-02-13 Kondapally Kalyan [WebGL][EFL][GTK][Qt]Add support for OES_vertex_array_object. https://bugs.webkit.org/show_bug.cgi?id=109382 Reviewed by Kenneth Russell. Covered by fast/canvas/webgl/oes-vertex-array-object.html This patch adds support for using Vertex Array Object with OpenGl. The patch adds support for loading necessary opengl functions and support for checking GL_ARB_vertex_array_object. The support for OES_vertex_array_object is advertised if GL_ARB_vertex_array_object is supported. * platform/graphics/OpenGLShims.cpp: (WebCore::initializeOpenGLShims): * platform/graphics/OpenGLShims.h: (_OpenGLFunctionTable): Added support for loading the necessary functions. * platform/graphics/opengl/Extensions3DOpenGL.cpp: (WebCore::Extensions3DOpenGL::createVertexArrayOES): (WebCore::Extensions3DOpenGL::deleteVertexArrayOES): (WebCore::Extensions3DOpenGL::isVertexArrayOES): (WebCore::Extensions3DOpenGL::bindVertexArrayOES): (WebCore::Extensions3DOpenGL::supportsExtension): (WebCore): (WebCore::Extensions3DOpenGL::isVertexArrayObjectSupported): * platform/graphics/opengl/Extensions3DOpenGL.h: (Extensions3DOpenGL): 2013-02-13 Eberhard Graether chromium: remove CompositorHUDFontAtlas https://bugs.webkit.org/show_bug.cgi?id=109328 Reviewed by James Robinson. After switching the HudLayer to use skia's font rendering the CompositorHUDFontAtlas has become obsolete. This change removes this class and the related WebLayerTreeView API. No new tests. * WebCore.gypi: * platform/graphics/chromium/CompositorHUDFontAtlas.cpp: Removed. * platform/graphics/chromium/CompositorHUDFontAtlas.h: Removed. 2013-02-13 Dean Jackson Small update to speech bubble for captions menu [Mac] https://bugs.webkit.org/show_bug.cgi?id=109641 Reviewed by Eric Carlson Small adjustment to the embedded SVG that draws a speech bubble for the captions button. Remove a polygon that was so small it looked like a rendering error. * css/mediaControlsQuickTime.css: (video::-webkit-media-controls-toggle-closed-captions-button): 2013-02-13 Dean Jackson Clicking outside captions menu should dismiss it https://bugs.webkit.org/show_bug.cgi?id=109648 Reviewed by Eric Carlson. Add a virtual override to the platform-specific defaultEventHandler to intercept any click in the controls, and hide the captions menu if it is showing. Test: media/video-controls-captions-trackmenu-hide-on-click.html * html/shadow/MediaControlsApple.cpp: (WebCore::MediaControlsApple::defaultEventHandler): Override from MediaControls. Hide captions menu if a click event comes in. * html/shadow/MediaControlsApple.h: 2013-02-13 Tommy Widenflycht MediaStream API: Use the source id when creating new tracks https://bugs.webkit.org/show_bug.cgi?id=109688 Reviewed by Adam Barth. This patch reuses the ids from the source when creating tracks instead of creating a new one. This was requested by the chromium port to greatly simplify their implementation. In the longer run the API should be rewritten to only use tracks instead of sources. Covered by existing tests. * platform/chromium/support/WebMediaStream.cpp: (WebKit::WebMediaStream::audioTracks): (WebKit::WebMediaStream::videoTracks): (WebKit::WebMediaStream::initialize): (WebKit): * platform/chromium/support/WebMediaStreamTrack.cpp: (WebKit::WebMediaStreamTrack::initialize): (WebKit): * platform/mediastream/MediaStreamComponent.h: (WebCore::MediaStreamComponent::create): (MediaStreamComponent): (WebCore::MediaStreamComponent::MediaStreamComponent): (WebCore): * platform/mediastream/MediaStreamDescriptor.h: (WebCore::MediaStreamDescriptor::create): (MediaStreamDescriptor): (WebCore::MediaStreamDescriptor::MediaStreamDescriptor): 2013-02-13 Eric Seidel Use fancy new Vector-based String constructors in the WebVTT parser https://bugs.webkit.org/show_bug.cgi?id=109619 Reviewed by Benjamin Poulain. No change in behavior. Added some FIXMEs for future perf optimization. * html/track/WebVTTParser.cpp: (WebCore::WebVTTParser::constructTreeFromToken): 2013-02-13 Morten Stenshorne WebKit ignores column-rules wider than column-gap https://bugs.webkit.org/show_bug.cgi?id=15553 Paint column rules even if they are wider than the gap. Rules wider than the gap should just overlap with column contents. Reviewed by Eric Seidel. Test: fast/multicol/rule-thicker-than-gap.html * rendering/RenderBlock.cpp: (WebCore::RenderBlock::paintColumnRules): 2013-02-13 Philip Rogers Replace SVG bitmap cache with directly-rendered SVG https://bugs.webkit.org/show_bug.cgi?id=106159 Reviewed by Tim Horton. This patch removes the caching of SVG bitmaps so SVG images are rendered directly. This enables WebKit to pass the IE Chalkboard demo in 10s on a Z620: http://ie.microsoft.com/testdrive/Performance/Chalkboard/ On a simple scaled SVG benchmark similar to the IE10 Chalkboard demo (http://philbit.com/SvgImagePerformance/viewport.html): without patch: ~20FPS with patch: ~55FPS The bitmap SVG image cache had several shortcomings: - The bitmap cache prevented viewport rendering. (WK104693) - Bitmap memory usage was high. (WK106484) - Caching animating images was expensive. This change removes almost all of the SVGImageCache implementation, replacing it with directly-rendered SVG. Instead of caching bitmaps, an SVGImageForContainer is cached which is a thin wrapper around an SVG image with the associated container size and scale. When rendering patterns (e.g., tiled backgrounds), a temporary bitmap is used for performance. This change also removes the redraw timer of the old cache, instead relying on the SVG image to notify clients if the image changes (e.g., during animations). This patch fixes two existing bugs (WK99481 and WK104189) that were due to caching bitmaps at a fixed size. A test has been added for each of these bugs. Tests: svg/as-image/svg-image-scaled.html svg/as-image/svg-image-viewbox.html * CMakeLists.txt: * GNUmakefile.list.am: * Target.pri: * WebCore.gypi: * WebCore.vcproj/WebCore.vcproj: * WebCore.xcodeproj/project.pbxproj: * loader/cache/CachedImage.cpp: (WebCore::CachedImage::lookupOrCreateImageForRenderer): (WebCore::CachedImage::setContainerSizeForRenderer): (WebCore::CachedImage::clear): (WebCore::CachedImage::changedInRect): SVG images are no longer special-cased here. When the SVG image changes, users are notified through this function, and users can then request their content to be redrawn. * svg/graphics/SVGImage.cpp: (WebCore::SVGImage::setContainerSize): (WebCore::SVGImage::drawForContainer): drawForContainer lays out the SVG content for a specific container size and renders it. The logic is fairly straightforward but a note about the scales and zooms here: the destination rect parameter is zoomed but not scaled the source rect parameter is zoomed but not scaled the context is scaled but not zoomed SVGImage::draw(...) only accepts a source and destination rect but does not consider scale or zoom. Therefore, drawForContainer removes the zoom component from the source so SVGImage::draw(...) will draw from the pre-zoom source to the post-zoom destination. (WebCore::SVGImage::drawPatternForContainer): For performance, drawPatternForContainer renders the SVG content onto a bitmap, then has the bitmap image draw the pattern. This is necessary because drawPattern is used for tiling. (WebCore): (WebCore::SVGImage::startAnimation): (WebCore::SVGImage::stopAnimation): (WebCore::SVGImage::resetAnimation): (WebCore::SVGImage::reportMemoryUsage): * svg/graphics/SVGImage.h: (WebCore): (SVGImage): * svg/graphics/SVGImageCache.cpp: Instead of storing a SizeAndScales values for each renderer, a SVGImageForContainer is stored which is just a thin wrapper around an SVG image that contains container sizing information. By combining the image and size information, the two maps of SVGImageCache have been merged into one. To make this patch easier to review, SVGImageCache still exists and works similar to how it did before the patch. Now, SVGImageCache simply stores the SVGImageForContainers. In a followup patch it will be removed. Note: the redraw timer of SVGImageCache has been removed because animation invalidation is now properly propagated back to the image clients. (WebCore): (WebCore::SVGImageCache::SVGImageCache): (WebCore::SVGImageCache::~SVGImageCache): (WebCore::SVGImageCache::removeClientFromCache): (WebCore::SVGImageCache::setContainerSizeForRenderer): (WebCore::SVGImageCache::imageSizeForRenderer): Previously, this function returned the scaled image size which was incorrect. The image size is used by clients such as GraphicsContext2D to determine the source size for drawing the image. draw() accepts zoomed but not scaled values, so this has been changed. (WebCore::SVGImageCache::imageForRenderer): A FIXME has been added here to not set the scale on every lookup. This can be improved by setting the page scale factor in setContainerSizeForRenderer() in a future patch. * svg/graphics/SVGImageCache.h: (WebCore): (SVGImageCache): * svg/graphics/SVGImageForContainer.cpp: Added. (WebCore): SVGImageForContainer is a thin wrapper around an SVG image. The lifetime of the SVGImage will be longer than the image cache. (WebCore::SVGImageForContainer::size): This is the only logic in SVGImageForContainer. The size returned needs to be zoomed but not scaled because it is used (e.g., by RenderImage) to pass back into draw() which takes zoomed but not scaled values. (WebCore::SVGImageForContainer::draw): (WebCore::SVGImageForContainer::drawPattern): * svg/graphics/SVGImageForContainer.h: Added. (WebCore): (SVGImageForContainer): In a future patch SVGImageForContainer can be made immutable but without a refactoring for not setting the page scale factor in SVGImageCache::lookupOrCreateImageForRenderer, setters are needed. (WebCore::SVGImageForContainer::create): (WebCore::SVGImageForContainer::containerSize): (WebCore::SVGImageForContainer::pageScale): (WebCore::SVGImageForContainer::zoom): (WebCore::SVGImageForContainer::setSize): (WebCore::SVGImageForContainer::setZoom): (WebCore::SVGImageForContainer::setPageScale): (WebCore::SVGImageForContainer::SVGImageForContainer): (WebCore::SVGImageForContainer::destroyDecodedData): (WebCore::SVGImageForContainer::decodedSize): 2013-02-12 Antti Koivisto Avoid updating timer heap when nothing changes https://bugs.webkit.org/show_bug.cgi?id=109630 Reviewed by Andreas Kling. When the fire time of a Timer is changed we remove it from the timer heap and reinsert it. This is pretty slow. Turns out that in ~80% of cases we are already in the heap and the insertion position is the same as the original position. We can check if anything is actually going to change before doing this work. This makes starting a timer ~30% faster in average, ~0.1% progression in PLT3. * platform/Timer.cpp: (TimerHeapLessThanFunction): (WebCore::TimerHeapLessThanFunction::operator()): (WebCore::parentHeapPropertyHolds): (WebCore): (WebCore::childHeapPropertyHolds): (WebCore::TimerBase::hasValidHeapPosition): The code here assumes that STL heap is a normal binary heap. If there is a different implementation somewhere the assertions will catch it. (WebCore::TimerBase::updateHeapIfNeeded): Skip updating the heap if it is already valid. (WebCore::TimerBase::setNextFireTime): * platform/Timer.h: (TimerBase): 2013-02-13 Martin Robinson [GTK] Remove remaining dead code from the GLib unicode backend https://bugs.webkit.org/show_bug.cgi?id=109707 Reviewed by Philippe Normand. * platform/KURL.cpp: (WebCore::appendEncodedHostname): * platform/text/TextEncoding.cpp: (WebCore::TextEncoding::encode): * platform/text/TextEncodingRegistry.cpp: (WebCore::buildBaseTextCodecMaps): (WebCore::extendTextCodecMaps): 2013-02-13 Xianzhu Wang Heap-use-after-free in WebCore::ScrollingCoordinator::hasVisibleSlowRepaintViewportConstrainedObjects https://bugs.webkit.org/show_bug.cgi?id=108695 See comments of RenderLayerModelObject::willBeDestroyed() below for details. Reviewed by Abhishek Arya. Test: ManulTests/scrolling-coordinator-viewport-constrained-crash.html Unable to write a normal layout test because 1) must waitUntilDone() to reproduce the crash but the redirected URL can't notifyDone(); 2) Can't use a frame to contain the test because ScrollingCoordinator handles only the main frame. * rendering/RenderBoxModelObject.cpp: (WebCore::RenderBoxModelObject::willBeDestroyed): Moved removeViewportConstrainedObject() call into RenderLayerModelObject::willBeDestroyed() because only RenderLayerModelObjects can be added as viewportConstrainedObjects. * rendering/RenderLayerModelObject.cpp: (WebCore::RenderLayerModelObject::willBeDestroyed): Changed this->view() (then view->frameView()) to this->frame() (then frame->view()) because when willBeDestroyed() is called, the document has set its renderView to 0 thus this->view() will return 0, causing removeViewportConstrainedObject() not called and a deleted RenderLayerModelObject in FrameView's viewportConstrainedObjects. 2013-02-13 Florin Malita [SVG] OOB access in SVGListProperty::replaceItemValues() https://bugs.webkit.org/show_bug.cgi?id=109293 Replacing a list property item with itself should be a no-op. This patch updates the related APIs and logic to detect the self-replace case and prevent removal of the item from the list. To avoid scanning the list multiple times, removeItemFromList() is updated to operate on indices and a findItem() method is added to resolve an item to an index. Reviewed by Dirk Schulze. No new tests: updated existing tests cover the change. * svg/properties/SVGAnimatedListPropertyTearOff.h: (WebCore::SVGAnimatedListPropertyTearOff::findItem): (SVGAnimatedListPropertyTearOff): (WebCore::SVGAnimatedListPropertyTearOff::removeItemFromList): * svg/properties/SVGAnimatedPathSegListPropertyTearOff.h: (WebCore::SVGAnimatedPathSegListPropertyTearOff::findItem): (SVGAnimatedPathSegListPropertyTearOff): (WebCore::SVGAnimatedPathSegListPropertyTearOff::removeItemFromList): Add a findItem() delegating method, and update removeItemFromList() to use the new index-based API. * svg/properties/SVGListProperty.h: (WebCore::SVGListProperty::insertItemBeforeValues): (WebCore::SVGListProperty::insertItemBeforeValuesAndWrappers): (WebCore::SVGListProperty::replaceItemValues): (WebCore::SVGListProperty::replaceItemValuesAndWrappers): (SVGListProperty): Updated to handle the no-op case for insertItemBefore() & replaceItem(). * svg/properties/SVGListPropertyTearOff.h: (WebCore::SVGListPropertyTearOff::findItem): (WebCore::SVGListPropertyTearOff::removeItemFromList): Index-based API updates. (WebCore::SVGListPropertyTearOff::processIncomingListItemValue): (WebCore::SVGListPropertyTearOff::processIncomingListItemWrapper): * svg/properties/SVGPathSegListPropertyTearOff.cpp: (WebCore::SVGPathSegListPropertyTearOff::processIncomingListItemValue): Detect the self-replace case and return without removing the item from the list. * svg/properties/SVGPathSegListPropertyTearOff.h: (WebCore::SVGPathSegListPropertyTearOff::findItem): (WebCore::SVGPathSegListPropertyTearOff::removeItemFromList): (SVGPathSegListPropertyTearOff): (WebCore::SVGPathSegListPropertyTearOff::processIncomingListItemWrapper): * svg/properties/SVGStaticListPropertyTearOff.h: (WebCore::SVGStaticListPropertyTearOff::processIncomingListItemValue): (WebCore::SVGStaticListPropertyTearOff::processIncomingListItemWrapper): Index-based API updates. 2013-02-13 Takashi Sakamoto [Refactoring] StyleResolver::State should have methods to access its member variables. https://bugs.webkit.org/show_bug.cgi?id=108563 Reviewed by Antti Koivisto. Made all member variables private and added methods to access the variables, because most of the member variables are read-only. We don't need to update those read-only variables while resolving styles. No new tests, because just refactoring. * css/SVGCSSStyleSelector.cpp: (WebCore::StyleResolver::applySVGProperty): * css/StyleResolver.cpp: (WebCore): (WebCore::StyleResolver::collectMatchingRules): (WebCore::StyleResolver::collectMatchingRulesForRegion): (WebCore::StyleResolver::sortAndTransferMatchedRules): (WebCore::StyleResolver::matchScopedAuthorRules): (WebCore::StyleResolver::styleSharingCandidateMatchesHostRules): (WebCore::StyleResolver::matchHostRules): (WebCore::StyleResolver::matchAuthorRules): (WebCore::StyleResolver::matchUserRules): (WebCore::StyleResolver::matchUARules): (WebCore::StyleResolver::collectMatchingRulesForList): (WebCore::StyleResolver::sortMatchedRules): (WebCore::StyleResolver::matchAllRules): (WebCore::StyleResolver::State::initElement): (WebCore::StyleResolver::initElement): Modified to invoke m_state.initElement if a given element is different from current m_state's element. (WebCore::StyleResolver::State::initForStyleResolve): Moved from StyleResolver. (WebCore::StyleResolver::styleSharingCandidateMatchesRuleSet): (WebCore::StyleResolver::canShareStyleWithControl): (WebCore::StyleResolver::sharingCandidateHasIdenticalStyleAffectingAttributes): (WebCore::StyleResolver::canShareStyleWithElement): (WebCore::StyleResolver::locateSharedStyle): (WebCore::StyleResolver::styleForElement): (WebCore::StyleResolver::styleForKeyframe): (WebCore::StyleResolver::keyframeStylesForAnimation): (WebCore::StyleResolver::pseudoStyleForElement): Changed ASSERT in the first line. ASSERT(m_state.parentStyle) would be wrong, because it depends on previous resolving. However, initForStyleResolve will also update m_state.parentStyle. No code in pseudoStyleForElement depends on previous resolving state. (WebCore::StyleResolver::styleForPage): (WebCore::StyleResolver::defaultStyleForElement): (WebCore::StyleResolver::adjustRenderStyle): (WebCore::StyleResolver::updateFont): (WebCore::StyleResolver::pseudoStyleRulesForElement): (WebCore::StyleResolver::ruleMatches): Added one more parameter, dynamicPseudo, because dynamicPseudo in State class is just used for returning matched pseudo style from this ruleMatches to collectMatchingRulesForList. No need to keep dynamicPseudo while resolving styles. (WebCore::StyleResolver::checkRegionSelector): Removed m_pseudoStyle = NOPSEUDO, because this method uses just SelectorChecker::matched. SelectorChecker doesn't see StyleResolver's m_pseudoStyle directly. Need to use SelectorCheckerContext. So no need to set m_pseudoStyle to be NOPSEUDO. (WebCore::StyleResolver::applyProperties): (WebCore::StyleResolver::applyMatchedProperties): (WebCore::StyleResolver::isLeftPage): (WebCore::StyleResolver::applyPropertyToStyle): (WebCore::StyleResolver::useSVGZoomRules): (WebCore::createGridTrackBreadth): (WebCore::StyleResolver::resolveVariables): (WebCore::StyleResolver::applyProperty): (WebCore::StyleResolver::cachedOrPendingFromValue): (WebCore::StyleResolver::generatedOrPendingFromValue): (WebCore::StyleResolver::setOrPendingFromValue): (WebCore::StyleResolver::cursorOrPendingFromValue): (WebCore::StyleResolver::checkForTextSizeAdjust): (WebCore::StyleResolver::initializeFontStyle): (WebCore::StyleResolver::setFontSize): (WebCore::StyleResolver::colorFromPrimitiveValue): (WebCore::StyleResolver::loadPendingSVGDocuments): (WebCore::StyleResolver::cachedOrPendingStyleShaderFromValue): (WebCore::StyleResolver::loadPendingShaders): (WebCore::StyleResolver::parseCustomFilterTransformParameter): (WebCore::StyleResolver::createFilterOperations): (WebCore::StyleResolver::loadPendingImage): (WebCore::StyleResolver::loadPendingImages): * css/StyleResolver.h: (WebCore::StyleResolver::style): (WebCore::StyleResolver::parentStyle): (WebCore::StyleResolver::rootElementStyle): (WebCore::StyleResolver::element): (WebCore::StyleResolver::hasParentNode): (StyleResolver): (WebCore::StyleResolver::State::State): (State): (WebCore::StyleResolver::State::clear): Modified to use clear at the end of styleForElement. (WebCore::StyleResolver::State::document): (WebCore::StyleResolver::State::element): (WebCore::StyleResolver::State::styledElement): (WebCore::StyleResolver::State::setStyle): (WebCore::StyleResolver::State::style): (WebCore::StyleResolver::State::takeStyle): (WebCore::StyleResolver::State::ensureRuleList): (WebCore::StyleResolver::State::takeRuleList): (WebCore::StyleResolver::State::parentNode): (WebCore::StyleResolver::State::setParentStyle): (WebCore::StyleResolver::State::parentStyle): (WebCore::StyleResolver::State::rootElementStyle): (WebCore::StyleResolver::State::regionForStyling): (WebCore::StyleResolver::State::setSameOriginOnly): (WebCore::StyleResolver::State::isSameOriginOnly): (WebCore::StyleResolver::State::pseudoStyle): (WebCore::StyleResolver::State::elementLinkState): (WebCore::StyleResolver::State::distributedToInsertionPoint): (WebCore::StyleResolver::State::setElementAffectedByClassRules): (WebCore::StyleResolver::State::elementAffectedByClassRules): (WebCore::StyleResolver::State::setApplyPropertyToRegularStyle): (WebCore::StyleResolver::State::setApplyPropertyToVisitedLinkStyle): (WebCore::StyleResolver::State::applyPropertyToRegularStyle): (WebCore::StyleResolver::State::applyPropertyToVisitedLinkStyle): (WebCore::StyleResolver::State::pendingImageProperties): (WebCore::StyleResolver::State::pendingSVGDocuments): (WebCore::StyleResolver::State::setHasPendingShaders): (WebCore::StyleResolver::State::hasPendingShaders): (WebCore::StyleResolver::State::setLineHeightValue): (WebCore::StyleResolver::State::lineHeightValue): (WebCore::StyleResolver::State::setFontDirty): (WebCore::StyleResolver::State::fontDirty): (WebCore::StyleResolver::State::cacheBorderAndBackground): (WebCore::StyleResolver::State::hasUAAppearance): (WebCore::StyleResolver::State::borderData): (WebCore::StyleResolver::State::backgroundData): (WebCore::StyleResolver::State::backgroundColor): (WebCore::StyleResolver::State::fontDescription): (WebCore::StyleResolver::State::parentFontDescription): (WebCore::StyleResolver::State::setFontDescription): (WebCore::StyleResolver::State::setZoom): (WebCore::StyleResolver::State::setEffectiveZoom): (WebCore::StyleResolver::State::setTextSizeAdjust): (WebCore::StyleResolver::State::setWritingMode): (WebCore::StyleResolver::State::setTextOrientation): fontDescription, ... and setTextOrientation were moved from StyleResolver. (WebCore::StyleResolver::State::matchedRules): (WebCore::StyleResolver::State::addMatchedRule): Moved from StyleResolver. (WebCore::StyleResolver::applyPropertyToRegularStyle): (WebCore::StyleResolver::applyPropertyToVisitedLinkStyle): (WebCore::StyleResolver::fontDescription): (WebCore::StyleResolver::parentFontDescription): (WebCore::StyleResolver::setFontDescription): (WebCore::StyleResolver::setZoom): (WebCore::StyleResolver::setEffectiveZoom): (WebCore::StyleResolver::setTextSizeAdjust): (WebCore::StyleResolver::setWritingMode): (WebCore::StyleResolver::setTextOrientation): These fontDescription, ..., setTextOrientation are wrappers to invoke State's methods. StyleBuilder still depends on StyleResolver and invokes these methods. So we need these wrappers. 2013-02-13 Allan Sandfeld Jensen [Qt] window.open passes height and width parameters even if not defined in a page https://bugs.webkit.org/show_bug.cgi?id=107705 Reviewed by Kenneth Rohde Christiansen. Do not override width or height of 0, as that indicates default size, and not minimum size. Tested by tst_qwebpage. * page/DOMWindow.cpp: (WebCore::DOMWindow::adjustWindowRect): 2013-02-13 Rashmi Shyamasundar The 2D Canvas functions fillText()/strokeText() should display nothing when maxWidth is less then or equal to zero https://bugs.webkit.org/show_bug.cgi?id=102656 Reviewed by Dirk Schulze. The functions fillText()/strokeText() should not display anything when maxWidth is less than or equal to zero, according to spec : http://www.w3.org/TR/2dcontext/#text-preparation-algorithm Test: fast/canvas/canvas-fillText-maxWidth-zero.html * html/canvas/CanvasRenderingContext2D.cpp: (WebCore::CanvasRenderingContext2D::drawTextInternal): 2013-02-13 ChangSeok Oh [GTK][AC] Implement basic transform animations with clutter ac backend https://bugs.webkit.org/show_bug.cgi?id=109363 Reviewed by Gustavo Noronha Silva. Implement basic transform animation with clutter ac backend. GraphicsLayerClutter is almost same with GraphicsLayerCA. And PlatformClutterAnimation interfaces are also similar with PlatformCAAnimation, but they are implemented with native clutter APIs. Clutter backend AC supports a basic single transform animation with this patch now, but additive animation combination and keyframe animation are not supported yet. Covered by existing animation tests. * platform/graphics/clutter/GraphicsLayerActor.cpp: (graphicsLayerActorSetTransform): * platform/graphics/clutter/GraphicsLayerClutter.cpp: (WebCore::isTransformTypeTransformationMatrix): (WebCore): (WebCore::isTransformTypeFloatPoint3D): (WebCore::isTransformTypeNumber): (WebCore::getTransformFunctionValue): (WebCore::getValueFunctionNameForTransformOperation): (WebCore::GraphicsLayerClutter::setTransformAnimationEndpoints): (WebCore::GraphicsLayerClutter::appendToUncommittedAnimations): (WebCore::GraphicsLayerClutter::createTransformAnimationsFromKeyframes): * platform/graphics/clutter/GraphicsLayerClutter.h: (GraphicsLayerClutter): * platform/graphics/clutter/PlatformClutterAnimation.cpp: (WebCore::toClutterActorPropertyString): (WebCore): (WebCore::PlatformClutterAnimation::supportsValueFunction): (WebCore::PlatformClutterAnimation::duration): (WebCore::PlatformClutterAnimation::setDuration): (WebCore::PlatformClutterAnimation::setAdditive): (WebCore::PlatformClutterAnimation::valueFunction): (WebCore::PlatformClutterAnimation::setValueFunction): (WebCore::PlatformClutterAnimation::setFromValue): (WebCore::PlatformClutterAnimation::setToValue): (WebCore::PlatformClutterAnimation::timeline): (WebCore::PlatformClutterAnimation::addClutterTransitionForProperty): (WebCore::PlatformClutterAnimation::addOpacityTransition): (WebCore::PlatformClutterAnimation::addTransformTransition): (WebCore::PlatformClutterAnimation::addAnimationForKey): * platform/graphics/clutter/PlatformClutterAnimation.h: (PlatformClutterAnimation): 2013-02-13 Ilya Tikhonovsky Web Inspector: Native Memory Instrumentation: reportLeaf method doesn't report the leaf node properly. https://bugs.webkit.org/show_bug.cgi?id=109554 In some cases leaves have no pointer so with the old schema we can't generate nodeId for them because we can't insert 0 into hashmap. It happens when we call addPrivateBuffer method. Drive by fix: I introduced a client interface for the HeapGraphSerializer. It helps me to do the tests for the serializer. Reviewed by Yury Semikhatsky. It is covered by newly added tests in TestWebKitAPI. * inspector/HeapGraphSerializer.cpp: (WebCore::HeapGraphSerializer::HeapGraphSerializer): (WebCore::HeapGraphSerializer::pushUpdate): (WebCore::HeapGraphSerializer::reportNode): (WebCore::HeapGraphSerializer::toNodeId): (WebCore::HeapGraphSerializer::addRootNode): * inspector/HeapGraphSerializer.h: (HeapGraphSerializer): (Client): (WebCore::HeapGraphSerializer::Client::~Client): * inspector/InspectorMemoryAgent.cpp: (WebCore): (WebCore::InspectorMemoryAgent::getProcessMemoryDistributionImpl): 2013-02-13 Yury Semikhatsky Web Inspector: add experimental native heap graph to Timeline panel https://bugs.webkit.org/show_bug.cgi?id=109687 Reviewed by Alexander Pavlov. Added experimentatl support for native heap graph on the Timeline panel. Native memory usage data is collected after each top level task and can be displayed instead of DOM counters graph on the Timeline panel if corresponding experiment is enabled in the inspector settings. * inspector/Inspector.json: * inspector/InspectorController.cpp: (WebCore::InspectorController::InspectorController): * inspector/InspectorTimelineAgent.cpp: (TimelineAgentState): (WebCore::InspectorTimelineAgent::setIncludeDomCounters): (WebCore): (WebCore::InspectorTimelineAgent::setIncludeNativeMemoryStatistics): (WebCore::InspectorTimelineAgent::innerAddRecordToTimeline): (WebCore::InspectorTimelineAgent::setDOMCounters): (WebCore::InspectorTimelineAgent::setNativeHeapStatistics): (WebCore::InspectorTimelineAgent::InspectorTimelineAgent): * inspector/InspectorTimelineAgent.h: (WebCore): (WebCore::InspectorTimelineAgent::create): (InspectorTimelineAgent): * inspector/WorkerInspectorController.cpp: (WebCore::WorkerInspectorController::WorkerInspectorController): * inspector/front-end/MemoryStatistics.js: (WebInspector.MemoryStatistics): * inspector/front-end/NativeMemoryGraph.js: (WebInspector.NativeMemoryGraph): (WebInspector.NativeMemoryGraph.prototype._onRecordAdded.addStatistics): (WebInspector.NativeMemoryGraph.prototype._onRecordAdded): * inspector/front-end/Settings.js: (WebInspector.ExperimentsSettings): * inspector/front-end/TimelinePanel.js: 2013-02-13 Vladislav Kaznacheev Web Inspector: Fixed colorpicker editing and scrolling. https://bugs.webkit.org/show_bug.cgi?id=109434. Reviewed by Alexander Pavlov. The color picker scrolling logic relied on the fixed DOM structure which changed with the introduction of SidebarPaneStack (https://bugs.webkit.org/show_bug.cgi?id=108183). Added a special CSS class to mark the scroll target. No new tests. * inspector/front-end/SplitView.js: (WebInspector.SplitView): * inspector/front-end/StylesSidebarPane.js: (WebInspector.StylePropertyTreeElement.prototype.updateTitle.): * inspector/front-end/TabbedPane.js: (WebInspector.TabbedPane): 2013-02-13 Andrey Lushnikov Web Inspector: fix js compilation warnings in TextPrompt https://bugs.webkit.org/show_bug.cgi?id=109685 Reviewed by Alexander Pavlov. Mark last argument of _applySuggestion function as optional. No new tests: no change in behaviour. * inspector/front-end/TextPrompt.js: 2013-02-13 Pablo Flouret Implement css-conditional's CSS.supports() https://bugs.webkit.org/show_bug.cgi?id=100324 Reviewed by Antti Koivisto. http://dev.w3.org/csswg/css3-conditional/#the-css-interface The supports() method provides the css @supports rule's corresponding dom api. The patch also adds the CSS interface on DOMWindow, which holds "useful CSS-related functions that do not belong elsewhere". This is where supports() lives. Test: css3/supports-dom-api.html * CMakeLists.txt: * DerivedSources.cpp: * DerivedSources.make: * DerivedSources.pri: * GNUmakefile.list.am: * Target.pri: * WebCore.exp.in: * WebCore.gypi: * WebCore.vcproj/WebCore.vcproj: * WebCore.xcodeproj/project.pbxproj: * bindings/gobject/GNUmakefile.am: * bindings/scripts/CodeGeneratorGObject.pm: (SkipFunction): Add DOMWindowCSS.* to the build systems. * bindings/scripts/CodeGenerator.pm: (WK_lcfirst): Handle CSS prefixes correctly (s/cSS/css/). * css/CSSGrammar.y.in: * css/CSSParser.cpp: (WebCore::CSSParser::CSSParser): (WebCore::CSSParser::parseSupportsCondition): (WebCore::CSSParser::detectAtToken): * css/CSSParser.h: webkit_supports_condition parses just the condition part of an @supports rule and evaluates it, outputting whether the condition is supported or not. * css/CSSAllInOne.cpp: * css/DOMWindowCSS.cpp: Added. * css/DOMWindowCSS.h: Added. * css/DOMWindowCSS.idl: Added. The CSS interface object. * page/DOMWindow.cpp: (WebCore::DOMWindow::css): * page/DOMWindow.h: * page/DOMWindow.idl: window.CSS 2013-02-13 Vladislav Kaznacheev Web Inspector: Simplify SplitView to rely more on CSS https://bugs.webkit.org/show_bug.cgi?id=109426 Reviewed by Vsevolod Vlasov. Simplified Javascript code by moving large part of the layout logic into CSS rules. The patch is larger than it should be because one of the clients (TimelinePanel) is breaking SplitView incapsulation by reparenting its resizer. No new tests. * inspector/front-end/SidebarView.js: (WebInspector.SidebarView): * inspector/front-end/SplitView.js: (WebInspector.SplitView): (WebInspector.SplitView.prototype._innerSetVertical): (WebInspector.SplitView.prototype.setSecondIsSidebar): (WebInspector.SplitView.prototype._showOnly): (WebInspector.SplitView.prototype._removeAllLayoutProperties): * inspector/front-end/TimelinePanel.js: * inspector/front-end/cssNamedFlows.css: (.css-named-flow-collections-view .split-view-sidebar): (.css-named-flow-collections-view .split-view-sidebar .sidebar-content): (.css-named-flow-collections-view .split-view-sidebar .selection): (.css-named-flow-collections-view .split-view-sidebar .named-flow-overflow::before, .css-named-flow-collections-view .region-empty:before, .css-named-flow-collections-view .region-fit::before, .css-named-flow-collections-view .region-overset::before): (.css-named-flow-collections-view .split-view-sidebar .named-flow-overflow::before): * inspector/front-end/splitView.css: (.split-view-contents.maximized): (.split-view-vertical .split-view-contents): (.split-view-vertical .split-view-contents-first): (.split-view-vertical .split-view-contents-first.maximized): (.split-view-vertical .split-view-contents-second): (.split-view-vertical .split-view-contents-second.maximized): (.split-view-horizontal .split-view-contents): (.split-view-horizontal .split-view-contents-first): (.split-view-horizontal .split-view-contents-first.maximized): (.split-view-horizontal .split-view-contents-second): (.split-view-horizontal .split-view-contents-second.maximized): (.split-view-vertical .split-view-sidebar.split-view-contents-first:not(.maximized)): (.split-view-vertical .split-view-sidebar.split-view-contents-second:not(.maximized)): (.split-view-horizontal .split-view-sidebar.split-view-contents-first:not(.maximized)): (.split-view-horizontal .split-view-sidebar.split-view-contents-second:not(.maximized)): (.split-view-vertical .split-view-resizer): (.split-view-horizontal .split-view-resizer): * inspector/front-end/timelinePanel.css: (.timeline.split-view-vertical .split-view-resizer): (#timeline-container .split-view-sidebar): 2013-02-13 Kentaro Hara Unreviewed, rolling out r142730. http://trac.webkit.org/changeset/142730 https://bugs.webkit.org/show_bug.cgi?id=109666 chromium browser tests are failing * bindings/scripts/CodeGeneratorV8.pm: (GenerateNormalAttrGetter): (GenerateNormalAttrSetter): (GenerateSingleBatchedAttribute): (GenerateImplementation): * bindings/scripts/test/V8/V8TestInterface.cpp: (TestInterfaceV8Internal): (WebCore): * bindings/scripts/test/V8/V8TestObj.cpp: (WebCore): 2013-02-13 Tamas Czene OpenCL implementation of Flood SVG filters. https://bugs.webkit.org/show_bug.cgi?id=109580 Reviewed by Zoltan Herczeg. * Target.pri: * platform/graphics/filters/FEFlood.h: (FEFlood): * platform/graphics/gpu/opencl/FilterContextOpenCL.cpp: (WebCore): (WebCore::PROGRAM_STR): (WebCore::FilterContextOpenCL::compileFill): (WebCore::FilterContextOpenCL::fill): * platform/graphics/gpu/opencl/FilterContextOpenCL.h: (WebCore::FilterContextOpenCL::FilterContextOpenCL): (FilterContextOpenCL): * platform/graphics/gpu/opencl/OpenCLFEFlood.cpp: Added. (WebCore): (WebCore::FEFlood::platformApplyOpenCL): 2013-02-13 Mike West location.href does not throw SECURITY_ERR when accessed across origins with JSC bindings https://bugs.webkit.org/show_bug.cgi?id=43891 Reviewed by Adam Barth. Other browsers (IE, Firefox, and Opera) throw an exception when accessing properties of a Location object across origins, as the spec suggests[1]. WebKit is currently the outlier. This has a few negative effects: developers are forced to hack around access violations in two ways rather than having a single code path, and (more annoyingly) developers are unable to avoid generating the error message. See every ad on the internet for the effect on the console. :) This patch adds a SECURITY_ERR exception to these access violations, which is the first step towards getting rid of the console spam. Getting rid of the message entirely will require a solution to http://wkbug.com/98050. A fairly inconclusive thread[2] on webkit-dev popped up in 2010 and trailed off without reaching conclusion. A more recent thread reached agreement that this patch seems like a reasonable thing to do[3]. This is the JSC half of the patch. V8 is coming in http://wkbug.com/43892 [1]: http://www.whatwg.org/specs/web-apps/current-work/multipage/history.html#security-location [2]: https://lists.webkit.org/pipermail/webkit-dev/2010-August/013880.html [2]: https://lists.webkit.org/pipermail/webkit-dev/2012-February/023636.html * bindings/js/JSLocationCustom.cpp: (WebCore::JSLocation::getOwnPropertySlotDelegate): 2013-02-13 Andrew Wilson Unreviewed Chromium gyp-file cleanup after glib backend removal. https://bugs.webkit.org/show_bug.cgi?id=109672 Removed references to GLib unicode backend: * WebCore.gypi: 2013-02-12 Kentaro Hara [V8] Generate wrapper methods for custom getters/setters https://bugs.webkit.org/show_bug.cgi?id=109666 Reviewed by Adam Barth. Currently V8 directly calls back custom getters/setters written in custom binding files. This makes it impossible for code generators to hook custom getters/setters (e.g. Code generators cannot insert a code for FeatureObservation into custom getters/setters). We should generate wrapper methods for custom getters/setters. In the future, I will insert TRACE_EVENT() macros into these wrapper methods to profile DOM getters/setters/methods. * bindings/scripts/CodeGeneratorV8.pm: (GenerateNormalAttrGetter): (GenerateNormalAttrSetter): (GenerateSingleBatchedAttribute): (GenerateImplementation): * bindings/scripts/test/V8/V8TestInterface.cpp: (WebCore::TestInterfaceV8Internal::supplementalStr3AttrGetter): (TestInterfaceV8Internal): (WebCore::TestInterfaceV8Internal::supplementalStr3AttrSetter): (WebCore): * bindings/scripts/test/V8/V8TestObj.cpp: (WebCore::TestObjV8Internal::customAttrAttrGetter): (TestObjV8Internal): (WebCore::TestObjV8Internal::customAttrAttrSetter): (WebCore): 2013-02-13 Sheriff Bot Unreviewed, rolling out r142611. http://trac.webkit.org/changeset/142611 https://bugs.webkit.org/show_bug.cgi?id=109668 Suggest box is not shown anymore when user types "window." in inspector console. (Requested by vsevik on #webkit). * inspector/front-end/TextPrompt.js: (WebInspector.TextPrompt.prototype.complete): 2013-02-13 Kentaro Hara [V8] There is no XXXConstructor that requires a custom getter https://bugs.webkit.org/show_bug.cgi?id=109667 Reviewed by Adam Barth. Currently '[Custom] attribute XXXConstructor xxx' generates XXXAttrGetter(). However, there is no XXXConstructor with [Custom]. In addition, it does make no sense to generate XXXAttrGetter() for such cases. We can remove the logic from CodeGeneratorV8.pm. * bindings/scripts/CodeGeneratorV8.pm: (GenerateSingleBatchedAttribute): 2013-02-12 Hajime Morrita [Internals] setShadowDOMEnabled() shouldn't be used except a few tests. https://bugs.webkit.org/show_bug.cgi?id=109642 Reviewed by Kent Tamura. InternalSettings.setShadowDOMEnabled() shouldn't be called after any relevant DOM bindings are touched. However for fuzzers, it isn't trivial to regulate its behavior. This change whitelists the URL of running test for prevent unintended API calls. This doesn't hurt the Internals usability since the API is called from just a couple of tests and the number isn't expected to grow. Test: fast/dom/shadow/shadow-dom-enabled-flag-whitelist.html * testing/InternalSettings.cpp: (WebCore::urlIsWhitelisted): (WebCore): (WebCore::InternalSettings::setShadowDOMEnabled): 2013-02-12 Vsevolod Vlasov Web Inspector: Introduce version controller to migrate settings versions. https://bugs.webkit.org/show_bug.cgi?id=109553 Reviewed by Yury Semikhatsky. This patch introduces version controller that could be used to migrate inspector settings. Test: inspector/version-controller.html * inspector/front-end/Settings.js: (WebInspector.Settings): (WebInspector.VersionController): (WebInspector.VersionController.prototype.set _methodsToRunToUpdateVersion): (WebInspector.VersionController.prototype._updateVersionFrom0To1): * inspector/front-end/inspector.js: 2013-02-12 Martin Robinson [GTK] Remove the GLib unicode backend https://bugs.webkit.org/show_bug.cgi?id=109627 Reviewed by Benjamin Poulain. Remove references to the GLib unicode backend from WebCore. * GNUmakefile.list.am: Update the source list. * platform/text/gtk/TextBreakIteratorGtk.cpp: Removed. * platform/text/gtk/TextCodecGtk.cpp: Removed. * platform/text/gtk/TextCodecGtk.h: Removed. 2013-02-12 Chris Fleizach AX: crash when accessing AccessibilityScrollbar after page has been unloaded https://bugs.webkit.org/show_bug.cgi?id=109524 Reviewed by Ryosuke Niwa. AX clients can hold onto AccesibilityScrollbar references that reference parent AccessibilityScrollViews that have already gone away. AccessibilityScrollView is not calling detachFromParent after it is removed, which leads to a crash. The fix is to clearChildren() when an object is deallocated. I could not create a test because the crash only manifests over multiple page loads. * accessibility/AccessibilityObject.cpp: (WebCore::AccessibilityObject::detach): 2013-02-12 Hayato Ito Use FocusEvent.relatedTarget in {FocusIn,FocusOut,Focus,Blur}EventDispatchMediator. https://bugs.webkit.org/show_bug.cgi?id=109650 Reviewed by Dimitri Glazkov. Set FocusEvent.relatedTarget in its constructor so that each EventDispatchMediator can use FocusEvent.relatedTarget rather than its redundant m_{old,new}FocusedNode member variable. I've also removed FIXME comments, mentioning bug 109261, since I can not reproduce the issue. No new tests. No change in functionality. * dom/FocusEvent.cpp: (WebCore::FocusEventDispatchMediator::create): (WebCore::FocusEventDispatchMediator::FocusEventDispatchMediator): (WebCore::FocusEventDispatchMediator::dispatchEvent): (WebCore::BlurEventDispatchMediator::create): (WebCore::BlurEventDispatchMediator::BlurEventDispatchMediator): (WebCore::BlurEventDispatchMediator::dispatchEvent): (WebCore::FocusInEventDispatchMediator::create): (WebCore::FocusInEventDispatchMediator::FocusInEventDispatchMediator): (WebCore::FocusInEventDispatchMediator::dispatchEvent): (WebCore::FocusOutEventDispatchMediator::create): (WebCore::FocusOutEventDispatchMediator::FocusOutEventDispatchMediator): (WebCore::FocusOutEventDispatchMediator::dispatchEvent): * dom/FocusEvent.h: (FocusEventDispatchMediator): (BlurEventDispatchMediator): (FocusInEventDispatchMediator): (FocusOutEventDispatchMediator): * dom/Node.cpp: (WebCore::Node::dispatchFocusInEvent): (WebCore::Node::dispatchFocusOutEvent): (WebCore::Node::dispatchFocusEvent): (WebCore::Node::dispatchBlurEvent): 2013-02-12 Takashi Sakamoto [Refactoring] Make SelectorChecker::mode a constructor parameter. https://bugs.webkit.org/show_bug.cgi?id=109653 Reviewed by Dimitri Glazkov. No new tests, because just refactoring. * css/SelectorChecker.cpp: (WebCore::SelectorChecker::SelectorChecker): Made mode a constructor parameter. * css/SelectorChecker.h: Removed setMode. (SelectorChecker): * css/StyleResolver.cpp: (WebCore::StyleResolver::ruleMatches): (WebCore::StyleResolver::checkRegionSelector): * dom/SelectorQuery.cpp: (WebCore::SelectorQuery::matches): (WebCore::SelectorQuery::queryAll): (WebCore::SelectorQuery::queryFirst): * html/shadow/ContentSelectorQuery.cpp: (WebCore::ContentSelectorChecker::ContentSelectorChecker): 2013-02-12 Andreas Kling Remove Element::ensureAttributeData(). Reviewed by Anders Carlsson. * dom/Element.h: * dom/Element.cpp: (WebCore::Element::classAttributeChanged): (WebCore::Element::shouldInvalidateDistributionWhenAttributeChanged): Use attributeData() instead of ensureAttributeData(), it's already guaranteed to exist in both these functions as they are called in response to attribute changes. * svg/SVGElement.h: (WebCore::SVGElement::invalidateSVGAttributes): Use mutableAttributeData() instead of ensureAttributeData() when invalidating animated SVG attributes. While I can't find any bugs caused by this, an element with property animations shouldn't share attribute data with other elements. 2013-02-12 Hayato Ito Make {FocusIn,FocusOut,Focus,Blur}EventDispatchMediator type safe. https://bugs.webkit.org/show_bug.cgi?id=109561 Reviewed by Dimitri Glazkov. Use FocusEvent rather than Event in {FocusIn,FocusOut,Focus,Blur}EventDispatchMediator. No new tests. No change in functionality. * dom/FocusEvent.cpp: (WebCore::FocusEventDispatchMediator::create): (WebCore::FocusEventDispatchMediator::FocusEventDispatchMediator): (WebCore::BlurEventDispatchMediator::create): (WebCore::BlurEventDispatchMediator::BlurEventDispatchMediator): (WebCore::FocusInEventDispatchMediator::create): (WebCore::FocusInEventDispatchMediator::FocusInEventDispatchMediator): (WebCore::FocusOutEventDispatchMediator::create): (WebCore::FocusOutEventDispatchMediator::FocusOutEventDispatchMediator): * dom/FocusEvent.h: (FocusEventDispatchMediator): (WebCore::FocusEventDispatchMediator::event): (BlurEventDispatchMediator): (WebCore::BlurEventDispatchMediator::event): (FocusInEventDispatchMediator): (WebCore::FocusInEventDispatchMediator::event): (FocusOutEventDispatchMediator): (WebCore::FocusOutEventDispatchMediator::event): 2013-02-12 Eric Seidel Fix HTMLToken::Attribute member naming and update callsites to use Vector-based String functions https://bugs.webkit.org/show_bug.cgi?id=109638 Reviewed by Adam Barth. Darin Adler noted in: https://bugs.webkit.org/show_bug.cgi?id=109408#c4 that HTMLToken::Attribute (then MarkupTokenBase::Attribute) was a struct, yet incorrectly used m_ for its public members. This patch fixes the members to not have the m_, and since I was touching all callers, I also updated all callers to use modern Vector-based String creation/append functions instead of manually calling UChar*, size_t versions. There should be no behavior change to this patch. Where I saw performance/memory bugs, I noted them with FIXMEs to keep this change simple. * html/HTMLViewSourceDocument.cpp: (WebCore::HTMLViewSourceDocument::processTagToken): * html/parser/AtomicHTMLToken.h: (WebCore::AtomicHTMLToken::publicIdentifier): (WebCore::AtomicHTMLToken::systemIdentifier): (WebCore::AtomicHTMLToken::AtomicHTMLToken): (WebCore::AtomicHTMLToken::initializeAttributes): * html/parser/CompactHTMLToken.cpp: (WebCore::CompactHTMLToken::CompactHTMLToken): * html/parser/HTMLMetaCharsetParser.cpp: (WebCore::HTMLMetaCharsetParser::processMeta): (WebCore::HTMLMetaCharsetParser::checkForMetaCharset): * html/parser/HTMLPreloadScanner.cpp: (WebCore::StartTagScanner::processAttributes): (WebCore::HTMLPreloadScanner::scan): (WebCore::HTMLPreloadScanner::processPossibleBaseTag): (WebCore::HTMLPreloadScanner::processToken): * html/parser/HTMLToken.h: (Range): (Attribute): (WebCore::HTMLToken::clear): (WebCore::HTMLToken::startIndex): (WebCore::HTMLToken::endIndex): (WebCore::HTMLToken::end): (WebCore::HTMLToken::nameString): (WebCore::HTMLToken::addNewAttribute): (WebCore::HTMLToken::beginAttributeName): (WebCore::HTMLToken::endAttributeName): (WebCore::HTMLToken::beginAttributeValue): (WebCore::HTMLToken::endAttributeValue): (WebCore::HTMLToken::appendToAttributeName): (WebCore::HTMLToken::appendToAttributeValue): (WebCore::HTMLToken::eraseValueOfAttribute): * html/parser/HTMLTokenizer.cpp: (WebCore::AtomicHTMLToken::nameForAttribute): * html/parser/HTMLViewSourceParser.cpp: (WebCore::HTMLViewSourceParser::updateTokenizerState): * html/parser/XSSAuditor.cpp: (WebCore::findAttributeWithName): (WebCore::XSSAuditor::filterParamToken): (WebCore::XSSAuditor::eraseDangerousAttributesIfInjected): (WebCore::XSSAuditor::eraseAttributeIfInjected): (WebCore::XSSAuditor::decodedSnippetForAttribute): 2013-02-12 Ryosuke Niwa Build fix. * editing/Editor.h: (WebCore::Editor::avoidIntersectionWithDeleteButtonController): 2013-02-12 Nate Chapin REGRESSION: Reloading a local file doesn't pick up changes https://bugs.webkit.org/show_bug.cgi?id=109344 Reviewed by Alexey Proskuryakov. Test: http/tests/cache/reload-main-resource.php * loader/cache/CachedResource.cpp: (WebCore::CachedResource::load): * loader/cache/CachedResourceLoader.cpp: (WebCore::CachedResourceLoader::determineRevalidationPolicy): (WebCore::CachedResourceLoader::cachePolicy): Don't use subresourceCachePolicy() for main resources. * loader/cache/CachedResourceLoader.h: (CachedResourceLoader): 2013-02-12 Ryosuke Niwa Turn avoidIntersectionWithNode into Editor member functions to encapsulate delete button controller https://bugs.webkit.org/show_bug.cgi?id=109549 Reviewed by Tony Chang. Renamed avoidIntersectionWithNode to Editor::avoidIntersectionWithDeleteButtonController and added trivial implementations when delete button controllers are disabled (ENABLE_DELETION_UI is 0). * editing/DeleteButtonController.cpp: * editing/EditCommand.cpp: (WebCore::EditCommand::EditCommand): * editing/Editor.cpp: (WebCore::Editor::avoidIntersectionWithDeleteButtonController): Moved from htmlediting.cpp and renamed. The version that takes VisibleSelection has been updated to use updatePositionForNodeRemoval to share mode code with that function. (WebCore::Editor::rangeForPoint): * editing/Editor.h: (WebCore::Editor::avoidIntersectionWithDeleteButtonController): Added; trivial implementations. * editing/htmlediting.cpp: * editing/htmlediting.h: * editing/markup.cpp: (WebCore::createMarkupInternal): Extracted from createMarkup. (WebCore::createMarkup): 2013-02-12 Joseph Pecoraro [iOS] Enable PAGE_VISIBILITY_API https://bugs.webkit.org/show_bug.cgi?id=109399 Reviewed by David Kilzer. * Configurations/FeatureDefines.xcconfig: 2013-02-12 Andreas Kling Move ElementAttributeData into Element.cpp/h Reviewed by Anders Carlsson. Removed ElementAttributeData.cpp/h and moved the class itself into Element headquarters. In the near future, Element should be the only client of this class, and thus it won't be necessary for other classes to know anything about it. * dom/ElementAttributeData.cpp: Removed. * dom/ElementAttributeData.h: Removed. * CMakeLists.txt: * GNUmakefile.list.am: * Target.pri: * WebCore.gypi: * WebCore.xcodeproj/project.pbxproj: * dom/DOMAllInOne.cpp: * dom/DocumentSharedObjectPool.cpp: * dom/Element.cpp: * dom/Element.h: * workers/SharedWorker.cpp: * Modules/webdatabase/DatabaseManager.cpp: Add ExceptionCode.h since Element.h doesn't pull it in anymore. 2013-02-12 Simon Fraser Crash when scrolling soon after page starts loading https://bugs.webkit.org/show_bug.cgi?id=109631 Reviewed by Anders Carlsson. Make the scrolling tree more robust when the root state node, and/or scrolling node are null. This can happen if we try to handle a wheel event before we've done the first scrolling tree commit. * page/scrolling/ScrollingStateTree.cpp: (WebCore::ScrollingStateTree::commit): Handle the case where m_rootStateNode is null. We'll still commit, but the state tree will have no state nodes. * page/scrolling/ScrollingTree.cpp: (WebCore::ScrollingTree::handleWheelEvent): Null-check m_rootNode. (WebCore::ScrollingTree::commitNewTreeState): Handle a null root node. (WebCore::ScrollingTree::updateTreeFromStateNode): If the rood state node is null, just clear the map and null out the root scrolling node. * page/scrolling/ScrollingTree.h: m_debugInfoLayer was unused. * page/scrolling/mac/ScrollingCoordinatorMac.mm: (WebCore::ScrollingCoordinatorMac::ensureRootStateNodeForFrameView): It may be possible to get here before we've registered the root scroll layer, in which case scrollLayerID() will be 0. Assert to see if this can ever happen. (WebCore::ScrollingCoordinatorMac::scrollingStateTreeAsText): Handle case of rootStateNode() being null. 2013-02-12 Raymond Toy Synchronize setting of panner node model and processing https://bugs.webkit.org/show_bug.cgi?id=109599 Reviewed by Chris Rogers. No new tests. * Modules/webaudio/PannerNode.cpp: (WebCore::PannerNode::process): (WebCore::PannerNode::setPanningModel): * Modules/webaudio/PannerNode.h: 2013-02-12 Dean Jackson Add class name for snapshotted plugin based on dimensions https://bugs.webkit.org/show_bug.cgi?id=108369 Reviewed by Simon Fraser. As the size of the plugin changes, the Shadow Root for the snapshot might want to toggle different interfaces. Expose "tiny", "small", "medium" and "large" classes on the Shadow. (The dimensions are currently chosen fairly arbitrarily). Because we only know the dimensions after layout, we set up a post layout task to add the class. Luckily there already was a post layout task for plugins - I just updated it to handle both real and snapshotted plugins. This involved modifying the list of RenderEmbeddedObjects in FrameView to take generic RenderObjects, and decide which type they are when calling the update method. * html/HTMLPlugInImageElement.cpp: Some new dimensions for the various size thresholds. (WebCore::classNameForShadowRootSize): New static function that returns a class name after examining the size of the object. (WebCore::HTMLPlugInImageElement::updateSnapshotInfo): Sets the class name for the shadow root. This is called in the post layout task. (WebCore::shouldPlugInShowLabelAutomatically): Use new size names. (WebCore::HTMLPlugInImageElement::subframeLoaderWillCreatePlugIn): Ditto. * html/HTMLPlugInImageElement.h: (HTMLPlugInImageElement): New method updateSnapshotInfo. * page/FrameView.cpp: (WebCore::FrameView::addWidgetToUpdate): Change RenderEmbeddedObject* to RenderObject*. (WebCore::FrameView::removeWidgetToUpdate): Ditto (WebCore::FrameView::updateWidget): Branch based on EmbeddedObject vs SnapshottedPlugIn. Call plugin snapshot update if necessary. (WebCore::FrameView::updateWidgets): Handle both EmbeddedObject and SnapshottedPlugIn cases. * page/FrameView.h: Change RenderEmbeddedObject* to RenderObject* for post layout widget updates. * rendering/RenderSnapshottedPlugIn.cpp: (WebCore::RenderSnapshottedPlugIn::layout): New virtual override. If size has changed, ask the FrameView to recalculate size after layout. * rendering/RenderSnapshottedPlugIn.h: New layout() method. 2013-02-12 Mike West Implement script MIME restrictions for X-Content-Type-Options: nosniff https://bugs.webkit.org/show_bug.cgi?id=71851 Reviewed by Adam Barth. This patch adds support for 'X-Content-Type-Options: nosniff' when deciding whether or not to execute a given chunk of JavaScript. If the header is present, script will only execute if it matches a predefined set of MIME types[1] that are deemed "executable". Scripts served with types that don't match the list will not execute. IE introduced this feature, and Gecko is working on an implementation[2] now. There's been some discussion on the WHATWG list about formalizing the specification for this feature[3], but nothing significant has been decided. This implementation's list of acceptible MIME types differs from IE's: it matches the list of supported JavaScript MIME types defined in MIMETypeRegistry::initializeSupportedJavaScriptMIMETypes()[4]. In particular, the VBScript types are not accepted, and 'text/javascript1.{1,2,3}' are accepted, along with 'text/livescript'. This feature is locked tightly behind the ENABLE_NOSNIFF flag, which is currently only enabled on the Chromium port. [1]: http://msdn.microsoft.com/en-us/library/gg622941(v=vs.85).aspx [2]: https://bugzilla.mozilla.org/show_bug.cgi?id=471020 [3]: http://lists.whatwg.org/htdig.cgi/whatwg-whatwg.org/2012-November/037974.html [4]: http://trac.webkit.org/browser/trunk/Source/WebCore/platform/MIMETypeRegistry.cpp?rev=142086#L307 Tests: http/tests/security/contentTypeOptions/invalid-content-type-options-allowed.html http/tests/security/contentTypeOptions/nosniff-script-allowed.html http/tests/security/contentTypeOptions/nosniff-script-blocked.html http/tests/security/contentTypeOptions/nosniff-script-without-content-type-allowed.html * dom/ScriptElement.cpp: (WebCore::ScriptElement::executeScript): Before executing script, ensure that it shouldn't be blocked due to its MIME type. If it is blocked, write an error message to the console. * loader/cache/CachedScript.cpp: (WebCore::CachedScript::mimeType): Make scripts' MIME type available outside the context of CachedScript in order to correctly populate error messages we write to the console in ScriptElement::executeScript (WebCore): (WebCore::CachedScript::mimeTypeAllowedByNosniff): * loader/cache/CachedScript.h: (CachedScript): A new method which checks the resource's HTTP headers to set the 'nosniff' disposition, and compares the resource's MIME type against the list of allowed executable types. Returns true iff the script is allowed. * platform/network/HTTPParsers.cpp: (WebCore): (WebCore::parseContentTypeOptionsHeader): * platform/network/HTTPParsers.h: Adds a new enum which relates the sniffable status of the resource, and a method to parse the HTTP header. 2013-02-12 Adam Barth Threaded HTML parser should pass the remaining fast/tokenizer tests https://bugs.webkit.org/show_bug.cgi?id=109607 Reviewed by Eric Seidel. This patch fixes some edge cases involving document.write. Previously, we would drop input characters on the floor if the tokenizer wasn't able to consume them synchronously. In this patch, we send the unparsed characters to the background thread for consumption after rewinding the input stream. * html/parser/BackgroundHTMLInputStream.cpp: (WebCore::BackgroundHTMLInputStream::rewindTo): * html/parser/BackgroundHTMLInputStream.h: (BackgroundHTMLInputStream): * html/parser/BackgroundHTMLParser.cpp: (WebCore::BackgroundHTMLParser::resumeFrom): * html/parser/BackgroundHTMLParser.h: (Checkpoint): * html/parser/HTMLDocumentParser.cpp: (WebCore::HTMLDocumentParser::canTakeNextToken): (WebCore::HTMLDocumentParser::didFailSpeculation): (WebCore::HTMLDocumentParser::pumpTokenizer): (WebCore::HTMLDocumentParser::finish): * html/parser/HTMLInputStream.h: (WebCore::HTMLInputStream::closeWithoutMarkingEndOfFile): (HTMLInputStream): 2013-02-12 Csaba Osztrogonác Unreviewed buildfix for !ENABLE(INSPECTOR) platforms after r142654. * inspector/InspectorInstrumentation.h: (WebCore::InspectorInstrumentation::scriptsEnabled): 2013-02-12 Christophe Dumez Remove remaining traces of Web Intents https://bugs.webkit.org/show_bug.cgi?id=109586 Reviewed by Eric Seidel. Remove remaining traces of Web Intents as the functionality was removed in r142549. No new tests, no behavior change for layout tests. * GNUmakefile.features.am.in: * html/HTMLTagNames.in: 2013-02-12 Robert Hogan REGRESSION(r136967): Combination of float and clear yields to bad layout https://bugs.webkit.org/show_bug.cgi?id=109476 Reviewed by Levi Weintraub. Test: fast/block/margin-collapse/self-collapsing-block-with-float-children.html The change made at http://trac.webkit.org/changeset/136967 only needs to worry about the first floated child of a self-collapsing block. The ones that follow are not affected by its margins. * rendering/RenderBlockLineLayout.cpp: (WebCore::RenderBlock::LineBreaker::skipLeadingWhitespace): 2013-02-12 Levi Weintraub ASSERTION FAILED: !object || object->isBox(), UNKNOWN in WebCore::RenderListItem::positionListMarker https://bugs.webkit.org/show_bug.cgi?id=108699 Reviewed by Abhishek Arya. RenderListItems performs special management of its children to maintain list markers. Splitting a flow through a list item results in assumptions made inside RenderListItem failing, so for now, avoid splitting flows when inside one. Test: fast/multicol/span/list-multi-column-crash.html * rendering/RenderBlock.cpp: (WebCore::RenderBlock::containingColumnsBlock): 2013-02-12 Roger Fong Unreviewed Windows build fix. * testing/Internals.cpp: (WebCore::Internals::resetToConsistentState): (WebCore::Internals::Internals): 2013-02-12 Vivek Galatage Web Inspector: JavaScript execution disabled by browser/UA should be notified to the front-end https://bugs.webkit.org/show_bug.cgi?id=109402 Reviewed by Yury Semikhatsky. Whenever the UA/Browser changes the Script Execution state of a page, it should notify the inspector front-end. Added the InspectorInstrumentation method didScriptExecutionStateChange to achieve this. Also the state change triggered by the inspector should be ignored to avoid infinite loop. Test: inspector/script-execution-state-change-notification.html * inspector/Inspector.json: * inspector/InspectorInstrumentation.cpp: (WebCore): (WebCore::InspectorInstrumentation::scriptsEnabledImpl): * inspector/InspectorInstrumentation.h: (InspectorInstrumentation): (WebCore::InspectorInstrumentation::scriptsEnabled): (WebCore): * inspector/InspectorPageAgent.cpp: (WebCore::InspectorPageAgent::InspectorPageAgent): (WebCore::InspectorPageAgent::setScriptExecutionDisabled): (WebCore::InspectorPageAgent::scriptsEnabled): (WebCore): * inspector/InspectorPageAgent.h: (InspectorPageAgent): * inspector/front-end/ResourceTreeModel.js: (WebInspector.PageDispatcher.prototype.javascriptDialogClosed): (WebInspector.PageDispatcher.prototype.scriptsEnabled): * page/Settings.cpp: (WebCore::Settings::setScriptEnabled): 2013-02-12 Antti Koivisto Cache timer heap pointer to timers https://bugs.webkit.org/show_bug.cgi?id=109597 Reviewed by Andreas Kling. Accessing timer heap through thread global storage is slow (~0.1% in PLT3). We can cache the heap pointer to each TimerBase. There are not huge numbers of timers around so memory is not an issue and many timers are heavily reused. * platform/Timer.cpp: (WebCore::threadGlobalTimerHeap): (WebCore::TimerHeapReference::operator=): (WebCore::TimerHeapIterator::checkConsistency): (WebCore::TimerBase::TimerBase): (WebCore::TimerBase::checkHeapIndex): (WebCore::TimerBase::setNextFireTime): * platform/Timer.h: (WebCore::TimerBase::timerHeap): (TimerBase): 2013-02-12 Adam Barth BackgroundHTMLParser::resumeFrom should take a struct https://bugs.webkit.org/show_bug.cgi?id=109598 Reviewed by Eric Seidel. This patch is purely a syntatic change that paves the way for fixing the partial-entity document.write tests. To fix those tests, we'll need to pass more information to resumeFrom, but we're hitting the argument limits in Functional.h. Rather than adding yet more arguments, this patch moves to a single argument that's a struct. * html/parser/BackgroundHTMLParser.cpp: (WebCore::BackgroundHTMLParser::resumeFrom): * html/parser/BackgroundHTMLParser.h: (Checkpoint): (BackgroundHTMLParser): * html/parser/HTMLDocumentParser.cpp: (WebCore::HTMLDocumentParser::didFailSpeculation): 2013-02-12 Elliott Sprehn rootRenderer in FrameView is really RenderView https://bugs.webkit.org/show_bug.cgi?id=109510 Reviewed by Eric Seidel. The global function rootRenderer(FrameView*) is really just a way to get the RenderView from the Frame so replace it with a renderView() method and replace usage of the word "root" with renderView so it's obvious the root we're talking about is the renderView. This is an important distinction to make since we also have rootRenderer in the code for the documentElement()'s renderer and we also have a "layout root" which is entirely different. No new tests, just refactoring. * page/FrameView.cpp: (WebCore::FrameView::rootRenderer): Removed. (WebCore::FrameView::setFrameRect): (WebCore::FrameView::adjustViewSize): (WebCore::FrameView::updateCompositingLayersAfterStyleChange): (WebCore::FrameView::updateCompositingLayersAfterLayout): (WebCore::FrameView::clearBackingStores): (WebCore::FrameView::restoreBackingStores): (WebCore::FrameView::usesCompositedScrolling): (WebCore::FrameView::layerForHorizontalScrollbar): (WebCore::FrameView::layerForVerticalScrollbar): (WebCore::FrameView::layerForScrollCorner): (WebCore::FrameView::tiledBacking): (WebCore::FrameView::scrollLayerID): (WebCore::FrameView::layerForOverhangAreas): (WebCore::FrameView::flushCompositingStateForThisFrame): (WebCore::FrameView::hasCompositedContent): (WebCore::FrameView::enterCompositingMode): (WebCore::FrameView::isSoftwareRenderable): (WebCore::FrameView::didMoveOnscreen): (WebCore::FrameView::willMoveOffscreen): (WebCore::FrameView::layout): (WebCore::FrameView::embeddedContentBox): (WebCore::FrameView::contentsInCompositedLayer): (WebCore::FrameView::scrollContentsFastPath): (WebCore::FrameView::scrollContentsSlowPath): (WebCore::FrameView::maintainScrollPositionAtAnchor): (WebCore::FrameView::scrollPositionChanged): (WebCore::FrameView::repaintFixedElementsAfterScrolling): (WebCore::FrameView::updateFixedElementsAfterScrolling): (WebCore::FrameView::visibleContentsResized): (WebCore::FrameView::scheduleRelayoutOfSubtree): (WebCore::FrameView::needsLayout): (WebCore::FrameView::setNeedsLayout): (WebCore::FrameView::performPostLayoutTasks): (WebCore::FrameView::updateControlTints): (WebCore::FrameView::paintContents): (WebCore::FrameView::forceLayoutForPagination): (WebCore::FrameView::adjustPageHeightDeprecated): (WebCore::FrameView::resetTrackedRepaints): (WebCore::FrameView::isVerticalDocument): (WebCore::FrameView::isFlippedDocument): * page/FrameView.h: (WebCore::FrameView::renderView): Added. 2013-02-12 Tomas Popela [GTK][Introspection] GObject bindings for DataTransferItemList - one add() method must be removed from .idl https://bugs.webkit.org/show_bug.cgi?id=109180 Reviewed by Xan Lopez. When compiling WebKit with --enable-introspection and generating GObject bindings for DataTransferItemList we must disable one add() method, because GObject is based on C and C does not allow two functions with the same name. No tests needed. * bindings/scripts/CodeGeneratorGObject.pm: 2013-02-12 Uday Kiran Background size width specified in viewport percentage units not working https://bugs.webkit.org/show_bug.cgi?id=109536 Reviewed by Antti Koivisto. Corrected the check for viewport percentage unit while calculating background image width. Test: fast/backgrounds/size/backgroundSize-viewportPercentage-width.html * rendering/RenderBoxModelObject.cpp: (WebCore::RenderBoxModelObject::calculateFillTileSize): 2013-02-12 Abhishek Arya Heap-use-after-free in WebCore::DeleteButtonController::enable https://bugs.webkit.org/show_bug.cgi?id=109447 Reviewed by Ryosuke Niwa. RefPtr frame pointer since it can get deleted due to mutation events fired inside AppendNodeCommand::doUnapply. No new tests. Testcase is hard to minimize due to recursive calls with DOMNodeRemovedFromDocument mutation event. * editing/CompositeEditCommand.cpp: (WebCore::EditCommandComposition::unapply): (WebCore::EditCommandComposition::reapply): 2013-02-12 Eric Seidel Remove HTMLTokenTypes header (and split out AtomicHTMLToken.h from HTMLToken.h) https://bugs.webkit.org/show_bug.cgi?id=109525 Reviewed by Adam Barth. We no longer need a separate HTMLTokenTypes class now that NEW_XML is gone. However, to remove HTMLTokenTypes, I had to split AtomicHTMLToken.h from HTMLToken.h (to fix a circular dependancy). * GNUmakefile.list.am: * Target.pri: * WebCore.gypi: * WebCore.vcproj/WebCore.vcproj: * WebCore.vcxproj/WebCore.vcxproj: * WebCore.vcxproj/WebCore.vcxproj.filters: * WebCore.xcodeproj/project.pbxproj: * html/HTMLViewSourceDocument.cpp: (WebCore::HTMLViewSourceDocument::addSource): * html/parser/AtomicHTMLToken.h: Added. (WebCore): (AtomicHTMLToken): (WebCore::AtomicHTMLToken::create): (WebCore::AtomicHTMLToken::forceQuirks): (WebCore::AtomicHTMLToken::type): (WebCore::AtomicHTMLToken::name): (WebCore::AtomicHTMLToken::setName): (WebCore::AtomicHTMLToken::selfClosing): (WebCore::AtomicHTMLToken::getAttributeItem): (WebCore::AtomicHTMLToken::attributes): (WebCore::AtomicHTMLToken::characters): (WebCore::AtomicHTMLToken::charactersLength): (WebCore::AtomicHTMLToken::isAll8BitData): (WebCore::AtomicHTMLToken::comment): (WebCore::AtomicHTMLToken::publicIdentifier): (WebCore::AtomicHTMLToken::systemIdentifier): (WebCore::AtomicHTMLToken::clearExternalCharacters): (WebCore::AtomicHTMLToken::AtomicHTMLToken): (WebCore::AtomicHTMLToken::initializeAttributes): * html/parser/BackgroundHTMLParser.cpp: (WebCore::BackgroundHTMLParser::simulateTreeBuilder): * html/parser/CompactHTMLToken.cpp: (WebCore::CompactHTMLToken::CompactHTMLToken): * html/parser/CompactHTMLToken.h: (WebCore::CompactHTMLToken::type): * html/parser/HTMLConstructionSite.cpp: (WebCore::HTMLConstructionSite::insertDoctype): (WebCore::HTMLConstructionSite::insertComment): (WebCore::HTMLConstructionSite::insertCommentOnDocument): (WebCore::HTMLConstructionSite::insertCommentOnHTMLHtmlElement): (WebCore::HTMLConstructionSite::insertSelfClosingHTMLElement): (WebCore::HTMLConstructionSite::insertForeignElement): * html/parser/HTMLDocumentParser.cpp: (WebCore::HTMLDocumentParser::processParsedChunkFromBackgroundParser): (WebCore::HTMLDocumentParser::constructTreeFromHTMLToken): * html/parser/HTMLDocumentParser.h: * html/parser/HTMLMetaCharsetParser.cpp: (WebCore::HTMLMetaCharsetParser::checkForMetaCharset): * html/parser/HTMLPreloadScanner.cpp: (WebCore::isStartTag): (WebCore::isStartOrEndTag): (WebCore::HTMLPreloadScanner::processToken): * html/parser/HTMLSourceTracker.cpp: (WebCore::HTMLSourceTracker::start): (WebCore::HTMLSourceTracker::sourceForToken): * html/parser/HTMLStackItem.h: (WebCore::HTMLStackItem::HTMLStackItem): * html/parser/HTMLToken.h: (WebCore::HTMLToken::clear): (WebCore::HTMLToken::isUninitialized): (WebCore::HTMLToken::type): (WebCore::HTMLToken::makeEndOfFile): (WebCore::HTMLToken::data): (WebCore::HTMLToken::name): (WebCore::HTMLToken::appendToName): (WebCore::HTMLToken::forceQuirks): (WebCore::HTMLToken::setForceQuirks): (WebCore::HTMLToken::beginDOCTYPE): (WebCore::HTMLToken::publicIdentifier): (WebCore::HTMLToken::systemIdentifier): (WebCore::HTMLToken::setPublicIdentifierToEmptyString): (WebCore::HTMLToken::setSystemIdentifierToEmptyString): (WebCore::HTMLToken::appendToPublicIdentifier): (WebCore::HTMLToken::appendToSystemIdentifier): (WebCore::HTMLToken::selfClosing): (WebCore::HTMLToken::setSelfClosing): (WebCore::HTMLToken::beginStartTag): (WebCore::HTMLToken::beginEndTag): (WebCore::HTMLToken::addNewAttribute): (WebCore::HTMLToken::appendToAttributeName): (WebCore::HTMLToken::appendToAttributeValue): (WebCore::HTMLToken::attributes): (WebCore::HTMLToken::eraseValueOfAttribute): (WebCore::HTMLToken::ensureIsCharacterToken): (WebCore::HTMLToken::characters): (WebCore::HTMLToken::appendToCharacter): (WebCore::HTMLToken::comment): (WebCore::HTMLToken::beginComment): (WebCore::HTMLToken::appendToComment): (WebCore::HTMLToken::eraseCharacters): (HTMLToken): * html/parser/HTMLTokenTypes.h: Removed. * html/parser/HTMLTokenizer.cpp: (WebCore::AtomicHTMLToken::usesName): (WebCore::AtomicHTMLToken::usesAttributes): (WebCore::HTMLTokenizer::flushBufferedEndTag): (WebCore::HTMLTokenizer::nextToken): * html/parser/HTMLTokenizer.h: (WebCore::HTMLTokenizer::saveEndTagNameIfNeeded): (WebCore::HTMLTokenizer::haveBufferedCharacterToken): * html/parser/HTMLTreeBuilder.cpp: (WebCore::HTMLTreeBuilder::processToken): (WebCore::HTMLTreeBuilder::processDoctypeToken): (WebCore::HTMLTreeBuilder::processFakeStartTag): (WebCore::HTMLTreeBuilder::processFakeEndTag): (WebCore::HTMLTreeBuilder::processFakePEndTagIfPInButtonScope): (WebCore::HTMLTreeBuilder::processIsindexStartTagForInBody): (WebCore): (WebCore::HTMLTreeBuilder::processStartTagForInBody): (WebCore::HTMLTreeBuilder::processStartTagForInTable): (WebCore::HTMLTreeBuilder::processStartTag): (WebCore::HTMLTreeBuilder::processBodyEndTagForInBody): (WebCore::HTMLTreeBuilder::processAnyOtherEndTagForInBody): (WebCore::HTMLTreeBuilder::processEndTagForInTableBody): (WebCore::HTMLTreeBuilder::processEndTagForInRow): (WebCore::HTMLTreeBuilder::processEndTagForInCell): (WebCore::HTMLTreeBuilder::processEndTagForInBody): (WebCore::HTMLTreeBuilder::processEndTagForInTable): (WebCore::HTMLTreeBuilder::processEndTag): (WebCore::HTMLTreeBuilder::processComment): (WebCore::HTMLTreeBuilder::processCharacter): (WebCore::HTMLTreeBuilder::defaultForBeforeHTML): (WebCore::HTMLTreeBuilder::defaultForBeforeHead): (WebCore::HTMLTreeBuilder::defaultForInHead): (WebCore::HTMLTreeBuilder::defaultForInHeadNoscript): (WebCore::HTMLTreeBuilder::defaultForAfterHead): (WebCore::HTMLTreeBuilder::processStartTagForInHead): (WebCore::HTMLTreeBuilder::processGenericRCDATAStartTag): (WebCore::HTMLTreeBuilder::processGenericRawTextStartTag): (WebCore::HTMLTreeBuilder::processScriptStartTag): (WebCore::HTMLTreeBuilder::shouldProcessTokenInForeignContent): (WebCore::HTMLTreeBuilder::processTokenInForeignContent): * html/parser/HTMLViewSourceParser.cpp: (WebCore::HTMLViewSourceParser::updateTokenizerState): * html/parser/TextDocumentParser.cpp: (WebCore::TextDocumentParser::insertFakePreElement): * html/parser/XSSAuditor.cpp: (WebCore::XSSAuditor::filterToken): (WebCore::XSSAuditor::filterScriptToken): (WebCore::XSSAuditor::filterObjectToken): (WebCore::XSSAuditor::filterParamToken): (WebCore::XSSAuditor::filterEmbedToken): (WebCore::XSSAuditor::filterAppletToken): (WebCore::XSSAuditor::filterIframeToken): (WebCore::XSSAuditor::filterMetaToken): (WebCore::XSSAuditor::filterBaseToken): (WebCore::XSSAuditor::filterFormToken): 2013-02-12 Pablo Flouret Handle error recovery in @supports https://bugs.webkit.org/show_bug.cgi?id=103934 Reviewed by Antti Koivisto. Tests 021, 024, 031, and 033 in http://hg.csswg.org/test/file/5f94e4b03ed9/contributors/opera/submitted/css3-conditional fail because there's no explicit error recovery in @support's grammar. Opera and Firefox pass the tests. No new tests, modified css3/supports{,-cssom}.html * css/CSSGrammar.y.in: * css/CSSParser.cpp: (WebCore::CSSParser::createSupportsRule): (WebCore::CSSParser::markSupportsRuleHeaderEnd): (WebCore::CSSParser::popSupportsRuleData): * css/CSSParser.h: 2013-02-12 Eric Carlson [Mac] guard against NULL languages array https://bugs.webkit.org/show_bug.cgi?id=109595 Reviewed by Dean Jackson. No new tests, existing tests won't crash if this is correct. * page/CaptionUserPreferencesMac.mm: (WebCore::CaptionUserPreferencesMac::preferredLanguages): 2013-02-12 Emil A Eklund TransformState::move should not round offset to int https://bugs.webkit.org/show_bug.cgi?id=108266 Reviewed by Simon Fraser. Currently TransformState::move rounds the offset to the nearest integer values, this results in operations using TransformState to compute a position to misreport the location, specifically Element:getBoundingClientRect and repaint rects. Sizes are handled correctly and do not have the same problem. Tests: fast/sub-pixel/boundingclientrect-subpixel-margin.html fast/sub-pixel/clip-rect-box-consistent-rounding.html * page/FrameView.cpp: (WebCore::FrameView::convertFromRenderer): Change to use pixel snapping instead of enclosing box. All other code paths use pixelSnappedIntRect to align the rects to device pixels however this used enclosingIntRect (indirectly through the FloatQuad::enclosingBoundingBox call). Without the rounding in TransformState this causes repaint rects for elements on subpixel bounds to be too large by up to one pixel on each axis. For normal repaints this isn't really a problem but in scrollContentsSlowPath it can result in moving too large a rect. * platform/graphics/transforms/TransformState.cpp: (WebCore::TransformState::translateTransform): (WebCore::TransformState::translateMappedCoordinates): Change to take a LayoutSize instead of an IntSize. (WebCore::TransformState::move): (WebCore::TransformState::applyAccumulatedOffset): * platform/graphics/transforms/TransformState.h: Remove rounding logic and use original, more precise, value. * rendering/RenderGeometryMap.cpp: (WebCore::RenderGeometryMap::mapToContainer): Remove rounding logic and use original, more precise, value. 2013-02-12 Jessie Berlin Rollout r142618, it broke all the Mac builds. * inspector/HeapGraphSerializer.cpp: (WebCore::HeapGraphSerializer::HeapGraphSerializer): (WebCore::HeapGraphSerializer::pushUpdate): (WebCore::HeapGraphSerializer::reportNode): (WebCore::HeapGraphSerializer::toNodeId): (WebCore::HeapGraphSerializer::addRootNode): * inspector/HeapGraphSerializer.h: (WebCore): (HeapGraphSerializer): * inspector/InspectorMemoryAgent.cpp: (WebCore::InspectorMemoryAgent::getProcessMemoryDistributionImpl): 2013-02-12 Rafael Weinstein [HTMLTemplateElement]