2014-08-24 Michael Catanzaro [GTK] Toggle buttons visually broken with GTK+ 3.13.7 https://bugs.webkit.org/show_bug.cgi?id=136130 Reviewed by Martin Robinson. No new tests. Hopefully covered by existing tests, and our tests only run with GTK+ 3.6 anyway. * platform/gtk/RenderThemeGtk3.cpp: (WebCore::paintToggle): use GTK_STATE_FLAG_CHECKED when compiling for GTK+ 3.13.7 and above to ensure toggle buttons display as toggled. 2014-08-26 Carlos Garcia Campos [GTK] Selection background is rendered white when unfocused with recent GTK+ https://bugs.webkit.org/show_bug.cgi?id=136251 Reviewed by Martin Robinson. This is due to a change in the GTK+ theme, but because we are not using the right flags to get the selections colors. We should use GTK_STATE_FLAG_SELECTED | GTK_STATE_FLAG_FOCUSED when focused and GTK_STATE_FLAG_SELECTED when unfocused, instead of GTK_STATE_FLAG_ACTIVE when unfocused. * platform/gtk/RenderThemeGtk3.cpp: (WebCore::RenderThemeGtk::platformActiveSelectionBackgroundColor): (WebCore::RenderThemeGtk::platformInactiveSelectionBackgroundColor): (WebCore::RenderThemeGtk::platformActiveSelectionForegroundColor): (WebCore::RenderThemeGtk::platformInactiveSelectionForegroundColor): (WebCore::RenderThemeGtk::platformActiveListBoxSelectionBackgroundColor): (WebCore::RenderThemeGtk::platformInactiveListBoxSelectionBackgroundColor): (WebCore::RenderThemeGtk::platformActiveListBoxSelectionForegroundColor): (WebCore::RenderThemeGtk::platformInactiveListBoxSelectionForegroundColor): 2013-08-28 Sergio Villar Senin [Soup] WebTiming information not shown in the inspector https://bugs.webkit.org/show_bug.cgi?id=118395 Reviewed by Martin Robinson. WebTiming information was not correctly provided to WebCore because the gotHeadersCallback was incorrectly resetting the original ResourceResponse (which had the ResourceLoadTiming object) instead of simply updating their contents using the SoupMessage. No new test required as this feature is already covered by the existing webtiming tests. In any case this change includes a fix for the http/tests/misc/webtiming-ssl.php test which was not failing even if it should because it was not correct. * platform/network/soup/ResourceHandleSoup.cpp: (WebCore::gotHeadersCallback): (WebCore::restartedCallback): restartedCallback should be available only if WEB_TIMING is defined. (WebCore::createSoupMessageForHandleAndRequest): Ditto. 2014-03-26 Jer Noble REGRESSION(r162679): Poster image visible under the video https://bugs.webkit.org/show_bug.cgi?id=130783 Reviewed by Simon Fraser. In the listed revision, we started checking for isRenderImage() instead of isImage(). RenderMedias return 'true' for the first but 'false' for the second. Change the if() statement to check for isRenderMedia() in addition to !isRenderImage(). * rendering/RenderLayerBacking.cpp: (WebCore::RenderLayerBacking::isDirectlyCompositedImage): 2014-03-21 Oliver Hunt Fix a crash when assigning an object to document.location https://bugs.webkit.org/show_bug.cgi?id=130213 Reviewed by Geoffrey Garen. Convert location to string before we make use the document. This prevents us from attempting to navigate a frame that has already been removed. Test: fast/dom/navigation-with-sideeffects-crash.html * bindings/js/JSDocumentCustom.cpp: (WebCore::JSDocument::location): (WebCore::JSDocument::setLocation): 2014-03-19 Antti Koivisto Crash with long selector list https://bugs.webkit.org/show_bug.cgi?id=123006 Reviewed by Andreas Kling. Test: fast/css/long-selector-list-crash.html * css/CSSSelectorList.cpp: (WebCore::CSSSelectorList::CSSSelectorList): (WebCore::CSSSelectorList::adoptSelectorVector): (WebCore::CSSSelectorList::operator=): * css/StyleRule.cpp: (WebCore::StyleRule::create): Add a bunch of asserts. (WebCore::StyleRule::splitIntoMultipleRulesWithMaximumSelectorComponentCount): This could produce a zero-length selector list. 2014-03-18 Antti Koivisto Mutating rules returned by getMatchedCSSRules can result in crash https://bugs.webkit.org/show_bug.cgi?id=130209 Reviewed by Andreas Kling. The non-standard getMatchedCSSRules API returns CSSStyleRule objects that don't have parent stylesheet pointer (as we don't know which sheet the rule originated from). Mutating the rule via such wrapper can lead to crashes later as we fail to invalidate the underlying stylesheet. Fix by disallowing mutation of style rules that don't have parent sheet pointer. CSSStyleRule has two mutable properties selectorText and style. The latter gives back CSSStyleDeclaration. This patch disallows mutations in both cases for CSSStyleRules that don't have parent stylesheet pointer. While it is technically possible to have CSSRules that are legitimately disconnected from stylesheet (by removing rule from sheet while holding a reference to it) it never makes sense to mutate such rule as there is no way to do anything with it afterwards. Tests: fast/css/getMatchedCSSProperties-rule-mutation.html fast/css/getMatchedCSSRules-crash.html * css/CSSStyleRule.cpp: (WebCore::CSSStyleRule::setSelectorText): Bail out if parent stylesheet is null. * css/PropertySetCSSStyleDeclaration.cpp: (WebCore::PropertySetCSSStyleDeclaration::setCssText): (WebCore::PropertySetCSSStyleDeclaration::setProperty): (WebCore::PropertySetCSSStyleDeclaration::removeProperty): (WebCore::PropertySetCSSStyleDeclaration::setPropertyInternal): Allow StyleRuleCSSStyleDeclaration subclass cancel the mutation via boolean return value from willMutate. (WebCore::StyleRuleCSSStyleDeclaration::willMutate): Disallow mutation if the owning CSSStyleRule is null or has null stylesheet. (WebCore::StyleRuleCSSStyleDeclaration::didMutate): We never get here with null rule or stylesheet anymore. * css/PropertySetCSSStyleDeclaration.h: (WebCore::PropertySetCSSStyleDeclaration::willMutate): 2014-03-08 Oliver Hunt SerializedScriptValue may move Identifiers between worlds https://bugs.webkit.org/show_bug.cgi?id=129979 Reviewed by Andreas Kling. Test: fast/workers/worker-copy-shared-blob-url.html Don't use Strings to store blob URLs as String's may be Identifiers and they can only exist in one world/thread at a time. * Modules/indexeddb/IDBObjectStore.cpp: (WebCore::IDBObjectStore::put): * bindings/js/SerializedScriptValue.cpp: (WebCore::CloneDeserializer::deserializeString): (WebCore::SerializedScriptValue::addBlobURL): (WebCore::SerializedScriptValue::SerializedScriptValue): * bindings/js/SerializedScriptValue.h: 2014-03-05 Daniel Bates And Alexey Proskuryakov ASSERT(newestManifest) fails in WebCore::ApplicationCacheGroup::didFinishLoadingManifest() https://bugs.webkit.org/show_bug.cgi?id=129753 Reviewed by Alexey Proskuryakov. Fixes an issue where an assertion failure would occur when visiting a web site whose on-disk app cache doesn't contain a manifest resource. For some reason an app cache for a web site may be partially written to disk. In particular, the app cache may only contain a CacheGroups entry. That is, the manifest resource and origin records may not be persisted to disk. From looking over the code, we're unclear how such a situation can occur and hence have been unable to create such an app cache. We were able to reproduce this issue using an app cache database file that was provided by a person that was affected by this issue. No test included because it's not straightforward to write a test for this change. * loader/appcache/ApplicationCacheGroup.cpp: (WebCore::ApplicationCacheGroup::checkIfLoadIsComplete): Assert that m_cacheBeingUpdated->manifestResource() is non-null. Currently we only document this assumption in a code comment. Also separated a single assertion expression into two assertion expressions to make it straightforward to identify the failing sub-expression on failure. * loader/appcache/ApplicationCacheStorage.cpp: (WebCore::ApplicationCacheStorage::store): Modified to call ApplicationCacheStorage::deleteCacheGroupRecord() to remove a cache group and associated cache records (if applicable) before inserting a cache group entry. This replacement approach will ultimately repair incomplete app cache data for people affected by this bug. (WebCore::ApplicationCacheStorage::loadCache): Log an error and return nullptr if the cache we loaded doesn't have a manifest resource. (WebCore::ApplicationCacheStorage::deleteCacheGroupRecord): Added. (WebCore::ApplicationCacheStorage::deleteCacheGroup): Extracted deletion logic for cache group record into ApplicationCacheStorage::deleteCacheGroupRecord(). * loader/appcache/ApplicationCacheStorage.h: 2014-03-05 David Kilzer Fix crash in CompositeEditCommand::cloneParagraphUnderNewElement() Reviewed by Jon Honeycutt. Merged from Blink (patch by Yuta Kitamura): https://src.chromium.org/viewvc/blink?revision=168160&view=revision http://crbug.com/345005 The root cause is CompositeEditCommand::moveParagraphWithClones() passing two positions |start| and |end| which do not follow the document order, i.e. in some situations |start| is located after |end| because of the difference in affinity. This patch fixes this crash by normalizing |end| to |start| in such situations. It also adds an ASSERT that checks the relationship between |start| and |end|. Test: editing/execCommand/format-block-crash.html * editing/CompositeEditCommand.cpp: (WebCore::CompositeEditCommand::cloneParagraphUnderNewElement): (WebCore::CompositeEditCommand::moveParagraphWithClones): * editing/CompositeEditCommand.h: 2014-03-01 David Kilzer Ensure keySplines is valid in SMIL animations Reviewed by Darin Adler. Merged from Blink (patch by Philip Rogers): https://src.chromium.org/viewvc/blink?revision=156452&view=revision http://crbug.com/276111 This patch fixes a crash in SMIL animations when keySplines are not specified. The SMIL spec is clear on this: http://www.w3.org/TR/2001/REC-smil-animation-20010904/#AnimFuncCalcMode "If there are any errors in the keyTimes specification (bad values, too many or too few values), the animation will have no effect." This patch simply checks that keyTimes is not empty. Previously, splinesCount was set to be m_keySplines.size() + 1 in SVGAnimationElement.cpp; this patch changes splinesCount to be equal to m_keySplines.size() to make the logic easier to follow and to match other checks in SVGAnimationElement::startedActiveInterval. Test: svg/animations/animate-keysplines-crash.html * svg/SVGAnimationElement.cpp: (WebCore::SVGAnimationElement::startedActiveInterval): 2014-02-28 Bem Jones-Bey Properly clear m_logicallyLastRun to remove use-after-free possibility https://bugs.webkit.org/show_bug.cgi?id=129489 Reviewed by David Hyatt. A use-after-free issue was caught in Blink because m_logicallyLastRun is not cleared when the item it points to is deleted. Clearing it turns the use-after-free into a segfault, and prevents any future use-after-frees from happening. * platform/text/BidiRunList.h: (WebCore::BidiRunList::deleteRuns): 2014-02-19 Daniel Bates Do not dispatch change event twice in single step action https://bugs.webkit.org/show_bug.cgi?id=116936 Reviewed by Ryosuke Niwa. Merged from Blink (patch by Kent Tamura): https://src.chromium.org/viewvc/blink?view=rev&revision=151175 Test: fast/forms/number/number-type-update-by-change-event.html * html/InputType.cpp: (WebCore::InputType::stepUpFromRenderer): 2014-02-16 Andreas Kling Ensure that removing an iframe from the DOM tree disconnects its Frame. Merged from Blink (patch by Adam Klein): https://src.chromium.org/viewvc/blink?revision=156174&view=revision SubframeLoadingDisabler wasn't catching the case when an