2014-05-07 Carlos Garcia Campos [SOUP] TLSErrors do not cause page load to fail when not ignored https://bugs.webkit.org/show_bug.cgi?id=121548 Reviewed by Sergio Villar Senin. This only happens in case of redirection, when the initial URL is an HTTPS site with an invalid certificate, that redirects to another location. We are starting the redirection without checking the TLS errors. * platform/network/soup/ResourceHandleSoup.cpp: (WebCore::sendRequestCallback): Check TLS errors before starting a possible redirection. 2014-05-05 Zan Dobersek [Soup] Use std::unique_ptr for the read buffer in SocketStreamHandle https://bugs.webkit.org/show_bug.cgi?id=132559 Reviewed by Carlos Garcia Campos. Manage the read buffer array through a std::unique_ptr object. This avoids handling with the raw pointer and also ensures that the memory allocated with the new[] operator is deleted with the delete[] operator, a problem exposed by the AddressSanitizer in WebSocket tests. * platform/network/soup/SocketStreamHandle.h: * platform/network/soup/SocketStreamHandleSoup.cpp: (WebCore::SocketStreamHandle::SocketStreamHandle): (WebCore::SocketStreamHandle::connected): (WebCore::SocketStreamHandle::readBytes): (WebCore::SocketStreamHandle::platformClose): 2014-04-22 Brent Fulgham Check (rather than assume) element is a RenderTableSection before using it https://bugs.webkit.org/show_bug.cgi?id=121858 Reviewed by David Kilzer. Test: fast/table/table-insert-object-before-td-crash.html * rendering/RenderTable.cpp: (WebCore::RenderTable::addChild): Check that lastBox is a table section before using the node as if it was one. 2014-04-19 Alexey Proskuryakov Crashes in HTMLFormElement::submit. https://bugs.webkit.org/show_bug.cgi?id=131910 Based on a patch by Kent Tamura. Reviewed by Anders Carlsson. Tests: fast/forms/form-submission-crash-2.html fast/forms/form-submission-crash.html Code that executes arbitrary JS needs to protect objects that it uses afterwards. * html/HTMLFormElement.cpp: (WebCore::HTMLFormElement::prepareForSubmission): (WebCore::HTMLFormElement::submit): * loader/FrameLoader.cpp: (WebCore::FrameLoader::submitForm): 2014-04-18 Jon Honeycutt Harden RenderInline::inlineElementContinuation() Reviewed by Sam Weinig. No new tests, as there are no known cases of this happening. * rendering/RenderInline.cpp: (WebCore::RenderInline::inlineElementContinuation): Return nullptr if the continuation is neither a RenderInline nor a RenderBlock. 2014-04-17 Darin Adler origin spoofing possible (HTTP Origin, postMessage event.origin) due to inappropriate URL escape sequence decoding https://bugs.webkit.org/show_bug.cgi?id=131837 rdar://problem/15211936 Reviewed by Anders Carlsson and Dave Hyatt. Tests: fast/dom/DOMURL/parsing.html fast/dom/HTMLAnchorElement/anchor-element-href-parsing.html * platform/URL.cpp: (WebCore::URL::host): Removed unnecessary call to decodeURLEscapeSequences, which caused problems and was not needed. 2014-04-03 David Hyatt Continuations casting issue. https://bugs.webkit.org/show_bug.cgi?id=130057 Reviewed by Simon Fraser. The code to update relative positioned anonymous block continuations should not have assumed that all siblings were RenderBlocks. Make the code smarter and make it bail when it hits something that isn't part of the block continuation chain. Added fast/block/continuation-crash.html * rendering/RenderInline.cpp: (WebCore::updateStyleOfAnonymousBlockContinuations): 2014-04-14 Jon Honeycutt Assertion failure under FEImage::determineAbsolutePaintRect() This patch merges Chromium r149536 (see ), which moves m_absoluteTransform out of SVGFilter and into the base Filter class, so that it isn't necessary to cast a Filter to SVGFilter to get the absolute transform. Reviewed by Geoffrey Garen. Test: svg/filters/feImage-filter-assertion.html * platform/graphics/filters/Filter.h: (WebCore::Filter::Filter): Changed to take the absolute transform. (WebCore::Filter::absoluteTransform): Moved from SVGFilter. (WebCore::Filter::mapAbsolutePointToLocalPoint): Ditto. * rendering/FilterEffectRenderer.cpp: (WebCore::FilterEffectRenderer::FilterEffectRenderer): Pass a default AffineTransform() to the Filter base class. * svg/graphics/filters/SVGFEImage.cpp: (WebCore::FEImage::determineAbsolutePaintRect): Use the Filter without casting it to SVGFilter. (WebCore::FEImage::platformApplySoftware): Ditto. * svg/graphics/filters/SVGFilter.cpp: (WebCore::SVGFilter::SVGFilter): Pass the transform to the base class, and remove initialization of a removed member var. * svg/graphics/filters/SVGFilter.h: Member var moved to Filter.h. 2014-04-14 Jon Honeycutt Assertion failure !node || node->isElementNode() in WebCore::RenderBlock::inlineElementContinuation https://bugs.webkit.org/show_bug.cgi?id=108829 I can't reproduce this assertion failure, but there seems to be an invalid assumption in RenderBlock::inlineElementContinuation() that anything with the "isInline()" bit set is a RenderInline. No new test because the test case in the bug does not repro for me. Reviewed by Brent Fulgham. * rendering/RenderBlock.cpp: (WebCore::RenderBlock::inlineElementContinuation): Dave Hyatt says that this function should only return RenderInline objects (not non-RenderInline inline objects), so update the checks from isInline() to isRenderInline() before casting with toRenderInline(). * rendering/RenderInline.cpp: (WebCore::RenderInline::inlineElementContinuation): Ditto. 2014-04-11 Jon Honeycutt Assertion failure changing select element size during focus event dispatch Reviewed by Andy Estes. Test: fast/forms/select-change-size-during-focus.html * html/HTMLSelectElement.cpp: (WebCore::HTMLSelectElement::listBoxDefaultEventHandler): Adopt the fix from Chromium r171216; check that the renderer is still of the expected type, and return early if it is not. 2014-04-08 Jon Honeycutt Assertion failure in WebCore::FlexBoxIterator::next() Code added in r115687 began removing anonymous wrappers when children become inline. However, there are some objects, like RenderDeprecatedFlexBox, whose children should always be blocks. Reviewed by Tim Horton. * rendering/RenderBlock.h: (WebCore::RenderBlock::canCollapseAnonymousBlockChild): Made public. * rendering/RenderObject.cpp: (WebCore::RenderObject::removeAnonymousWrappersForInlinesIfNecessary): Return early if we can't collapse anonymous block children. 2014-04-07 Jon Honeycutt Assertion failure, !node || node->isElementNode(), in WebCore::RenderBlock::clone() Reviewed by Antti Koivisto. We're ending up in RenderBlock::splitBlocks() with |this| == |fromBlock|. We then try to climb the ancestor block chain from this->parent() to |fromBlock|, but this->parent() is already above |fromBlock|, so we end up climbing up to the RenderView and trying to clone it, causing the assertion failure. Adopt Chromium's mitigation for this from . This is not intended as a fix for the underlying issue. Also, fix another issue that occurs with this fuzzed test case that's not handled by the Chromium fix. * rendering/RenderBlock.cpp: (WebCore::RenderBlock::splitBlocks): Ensure while we're in the loop that |curr| is a descendant of |fromBlock|. From the Chromium patch: We need to check in every iteration of the loop because moveChildrenTo could have moved |curr|. This is a mitigation and not really a fix against a class of tree craziness. Finally, before moving children from |fromBlock| to |toBlock|, ensure that the children are children of |fromBlock|. If we never entered the loop, they will be siblings of |fromBlock|, not children. 2014-04-17 David Kilzer Tidy up isIsolatedInline() and highestContainingIsolateWithinRoot() Reviewed by Daniel Bates. Based on review feedback for r166650. * rendering/InlineIterator.h: (WebCore::isIsolatedInline): - Switch argument to a reference since it is never called with a nullptr. (WebCore::highestContainingIsolateWithinRoot): - Switch first argument to a reference since it's never a nullptr. - Use nullptr for pointer initialization. - Switch while() loop to for() loop. Pass reference to isIsolatedInline(). (WebCore::numberOfIsolateAncestors): - Switch while() loop to for() loop. Pass reference to isIsolatedInline(). * rendering/RenderBlockLineLayout.cpp: (WebCore::constructBidiRunsForSegment): - Rename startObj to startObject. - No longer need to pass the address of startObject here. 2014-04-02 David Kilzer Use outermost containing isolate when constructing bidi runs Reviewed by Darin Adler. Merged from Blink (patch by jww@chromium.org): https://src.chromium.org/viewvc/blink?revision=157268&view=revision http://crbug.com/279277 Update containingIsolate to go back all the way to top isolate from current root, rather than stopping at the first isolate it finds. This works because the current root is always updated with each isolate run. Tests: fast/text/international/unicode-bidi-isolate-nested-with-removes-not-adjacent.html fast/text/international/unicode-bidi-isolate-nested-with-removes.html * rendering/InlineIterator.h: (WebCore::highestContainingIsolateWithinRoot): * rendering/RenderBlockLineLayout.cpp: (WebCore::constructBidiRunsForSegment): 2014-04-01 Daniel Bates RenderQuote must destroy remaining text renderer before first letter renderer https://bugs.webkit.org/show_bug.cgi?id=78023 Reviewed by Brent Fulgham. Merged from Blink (patch by Abhishek Arya): https://src.chromium.org/viewvc/blink?view=rev&revision=151270 Following the fix for , a RenderQuote may have child render objects for the first letter of its text and everything following the first letter so as to support the CSS first- letter property. The latter renderer is responsible for destroying the former on destruction. It's sufficient to reverse the destruction of the children of RenderQuote to ensure that we destroy the remaining text renderer before we destroy the first letter renderer. Test: fast/css-generated-content/quote-first-letter-crash.html * rendering/RenderQuote.cpp: (WebCore::RenderQuote::updateText): 2014-04-01 David Kilzer Do not allow HTTP refresh headers to refresh to javascript: URLs Reviewed by Alexey Proskuryakov. Merged from Blink (patch by tsepez@chromium.org): https://src.chromium.org/viewvc/blink?revision=153912&view=revision http://crbug.com/258151 This behaviour has been standard in IE since IE7. This makes us both more compatible and less vulnerable to XSS. Tests: http/tests/security/no-javascript-location-percent-escaped.html http/tests/security/no-javascript-location.html http/tests/security/no-javascript-refresh-percent-escaped.php http/tests/security/no-javascript-refresh-spaces.php http/tests/security/no-javascript-refresh-static-percent-escaped.html http/tests/security/no-javascript-refresh-static-spaces.html http/tests/security/no-javascript-refresh-static.html http/tests/security/no-javascript-refresh.php * dom/Document.cpp: (WebCore::Document::processHttpEquiv): * loader/FrameLoader.cpp: (WebCore::FrameLoader::receivedFirstData): - Do not fire meta http refresh for a javascript: URL protocol. 2014-03-29 David Kilzer Preserve selection end positions in directionOfSelection Reviewed by Brent Fulgham. Merged from Blink (patch by kenrb@chromium.org): https://src.chromium.org/viewvc/blink?revision=150621&view=revision http://crbug.com/164263 VisibleSelection::visibleStart() and VisibleSelection::visibleEnd() can both cause layouts, which has the potential to invalidate any rendertree-based objects. This was causing a problem in FrameSelection::directionOfSelection(), where a reference to a lineBox was being held across a call to visibleEnd(). This patch ensures that the any layout is completed before linebox references are retrieved. Test: editing/selection/layout-during-move-selection-crash.html * editing/FrameSelection.cpp: (WebCore::FrameSelection::directionOfSelection): 2014-03-28 Radu Stavila In some situations, partial layouts of floating elements produce incorrect results. https://bugs.webkit.org/show_bug.cgi?id=122668 Reviewed by David Hyatt. When performing partial layout of float elements and checking if other float elements are encountered, incorrect results were obtained by not checking the size of the existing floats vector. Test: fast/block/float/floats-in-clean-line-crash.html * rendering/RenderBlockLineLayout.cpp: (WebCore::RenderBlockFlow::checkFloatsInCleanLine): 2014-03-28 Myles C. Maxfield Clear SVGInlineTextBox fragments when the text changes. https://bugs.webkit.org/show_bug.cgi?id=130879 Reviewed by Darin Adler. Ported from Blink: https://src.chromium.org/viewvc/blink?revision=150456&view=revision This patch modifies SVGInlineTextBox::dirtyLineBoxes to clear all following text boxes when invoked. Typically this method is called when the underlying text string changes, and that change needs to be propagated to all the boxes that use the text beyond the point where the text is first modified. Also cleans up final function keywords for SVGRootInlineBox. Test: svg/custom/unicode-in-tspan-multi-svg-crash.html * rendering/InlineTextBox.h: Added (non-recursive) dirtyOwnLineBoxes() function (WebCore::InlineTextBox::dirtyOwnLineBoxes): Calls dirtyLineBoxes() * rendering/svg/SVGInlineTextBox.h: Added (non-recursive) dirtyOwnLineBoxes() function (WebCore::SVGInlineTextBox::dirtyOwnLineBoxes): * rendering/svg/SVGInlineTextBox.cpp: (WebCore::SVGInlineTextBox::dirtyOwnLineBoxes): Non-recursive part of dirtyLineBoxes() (WebCore::SVGInlineTextBox::dirtyLineBoxes): Calls dirtyOwnLineBoxes() in a loop * rendering/svg/SVGRootInlineBox.h: 2014-02-02 Andreas Kling Minor SVGRootInlineBox cleanup. Remove two virtual functions and sprinkle some missing overrides. Reviewed by Anders Carlsson. * rendering/svg/SVGRootInlineBox.h: 2014-03-03 David Kilzer SVGPropertyTearOffs should detachChildren before deleting its value. Reviewed by Maciej Stachowiak. Merged from Blink (patch by kouhei@chromium.org): https://src.chromium.org/viewvc/blink?revision=158563&view=revision http://crbug.com/296276 Test: svg/transforms/svg-matrix-tearoff-crash.html NOTE: The test does not reproduce a crash on WebKit using JavaScriptCore. * svg/properties/SVGPropertyTearOff.h: (WebCore::SVGPropertyTearOff::setValue): (WebCore::SVGPropertyTearOff::~SVGPropertyTearOff): - Call detachChildren() if m_value is a copy. The original Blink patch did not modify the destructor code path, although that seems obvious via code inspection. 2014-03-01 David Kilzer Fix lifetime handling of SVGPropertyTearOffs Reviewed by Maciej Stachowiak. Merged from Blink (patch by Ojan Vafai): https://src.chromium.org/viewvc/blink?revision=157801&view=revision http://crbug.com/288771 -Replace SVGStaticPropertyWithParentTearOff with SVGMatrixTearOff since it's only used in that one place. This means we can get rid of the templatizing and the method pointer. -Change SVGPropertyTearOff to keep track of it's child tearoffs and call detachWrapper on its child tearoffs when it's destroyed or when it's wrapper is detached. -Have SVGPropertyTearOff hold WeakPtrs to the child tearoffs to avoid having a cycle. Test: svg/transforms/svg-matrix-tearoff-crash.html * GNUmakefile.list.am: * WebCore.vcxproj/WebCore.vcxproj: * WebCore.vcxproj/WebCore.vcxproj.filters: * WebCore.xcodeproj/project.pbxproj: * bindings/scripts/CodeGeneratorJS.pm: (NativeToJSValue): * svg/properties/SVGMatrixTearOff.h: Renamed from Source/WebCore/svg/properties/SVGStaticPropertyWithParentTearOff.h. (WebCore::SVGMatrixTearOff::create): (WebCore::SVGMatrixTearOff::commitChange): (WebCore::SVGMatrixTearOff::SVGMatrixTearOff): * svg/properties/SVGPropertyTearOff.h: (WebCore::SVGPropertyTearOff::addChild): (WebCore::SVGPropertyTearOff::detachChildren): 2014-03-25 David Kilzer Hold a reference to firstSuccessfulSubmitButton in HTMLFormElement::submit Reviewed by Darin Adler. Merged from Blink (patch by Ian Beer): http://crbug.com/303657 https://src.chromium.org/viewvc/blink?view=rev&revision=158938 Test: fast/forms/form-submission-crash-successful-submit-button.html * html/HTMLFormElement.cpp: (WebCore::HTMLFormElement::submit): 2014-03-21 Andreas Kling HTMLFrameOwnerElement should obey the SubframeLoadingDisabler when creating subframes Merge Blink r156744 by Adam Klein. Test: fast/frames/set-iframe-src-in-pagehide-crash.html * loader/SubframeLoader.cpp: (WebCore::SubframeLoader::loadSubframe): 2014-04-13 Youenn Fablet [GStreamer] No CORS support for media elements https://bugs.webkit.org/show_bug.cgi?id=99037 Reviewed by Philippe Normand. Added CORS access control check to media sources when crossorigin attribute is set. Added getter to CORS access control check status (used to compute whether the stream is tainted or not). Related test is http/tests/security/video-cross-origin-readback.html. Disabled access to cross-origin streams that fail CORS check when crossorigin attribute is set. Related test is http/tests/security/video-cross-origin-accessfailure.html. Tests: http/tests/security/video-cross-origin-accessfailure.html http/tests/security/video-cross-origin-accesssameorigin.html * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp: (WebCore::MediaPlayerPrivateGStreamer::didPassCORSAccessCheck): Return whether media is cross-origin (tainted) or not by querying the gstreamer source layer. * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.h: Added MediaPlayerPrivateGStreamer::didPassCORSAccessCheck declaration. * platform/graphics/gstreamer/WebKitWebSourceGStreamer.cpp: (webKitWebSrcStart): Passed CORS mode parameter to the streaming client. In case of CORS check failure, stop the resource loading. (webKitSrcPassedCORSAccessCheck): Return whether CORS access control check was done and successful. (StreamingClient::handleResponseReceived): Take a parameter to assign the CORS access control check result. (CachedResourceStreamingClient::CachedResourceStreamingClient): Updated setting of the ResourceLoaderOptions according CORS mode. (CachedResourceStreamingClient::responseReceived): Check CORS and pass result to handleResponseReceived. (ResourceHandleStreamingClient::didReceiveResponse): No CORS check. * platform/graphics/gstreamer/WebKitWebSourceGStreamer.h: Added webKitSrcPassedCORSAccessCheck declaration. 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-13 Andreas Kling Don't send synchronous resize events when FrameView has auto-sizing enabled. Reviewed by Dan Bernstein. * page/FrameView.cpp: (WebCore::FrameView::sendResizeEventIfNeeded): 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-17 Chris Fleizach AX: Invalid cast in WebCore::AccessibilityTable::isDataTable (CRBug 280352) Merged from Blink (patch by Dominic Mazzoni): https://src.chromium.org/viewvc/blink?revision=159711&view=revision Reviewed by Oliver Hunt. Don't cast to a table cell element unless we are sure it is one. Test: accessibility/display-table-cell-causes-crash.html * accessibility/AccessibilityTable.cpp: (WebCore::AccessibilityTable::isDataTable): 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