2014-03-04 Ryosuke Niwa REGRESSION(r164856): Use after free in WebCore::QualifiedName::operator== / WebCore::StyledElement::attributeChanged https://bugs.webkit.org/show_bug.cgi?id=129550 Reviewed by Andreas Kling. We can't store a reference to QualifiedName here because ensureUniqueElementData could delete QualifiedName inside Attribute. Test: fast/dom/uniquing-attributes-via-setAttribute.html * dom/Element.cpp: (WebCore::Element::setAttributeInternal): 2014-03-25 Gabor Rapcsanyi [ARM64] GNU assembler fails in TransformationMatrix::multiply https://bugs.webkit.org/show_bug.cgi?id=130454 Reviewed by Zoltan Herczeg. Change the NEON intstructions to the proper style. * platform/graphics/transforms/TransformationMatrix.cpp: (WebCore::TransformationMatrix::multiply): 2014-06-06 Brady Eidson Initialize a char* that needs to be initialized. and https://bugs.webkit.org/show_bug.cgi?id=133585 Reviewed by Mark Rowe. r152134 (erroneously) removed this initialization. * platform/sql/SQLiteStatement.cpp: (WebCore::SQLiteStatement::prepare): tail should start out initialized to 0. 2016-03-02 Milan Crha Fix the build with VIDEO disabled. Reviewed by Carlos Garcia Campos. * platform/gtk/RenderThemeGtk2.cpp: * platform/gtk/RenderThemeGtk3.cpp: 2016-02-29 Carlos Garcia Campos Unreviewed. Fix the build with GTK+ < 3.19. * platform/gtk/ScrollbarThemeGtk3.cpp: (WebCore::ScrollbarThemeGtk::paintScrollbarBackground): (WebCore::ScrollbarThemeGtk::paintThumb): (WebCore::ScrollbarThemeGtk::paintButton): 2015-02-06 Zalan Bujtas ASSERT repaintContainer->hasLayer() in WebCore::RenderObject::repaintUsingContainer https://bugs.webkit.org/show_bug.cgi?id=140750 Reviewed by Simon Fraser. There's a short period of time when RenderObject::layer() still returns a valid pointer even though we already cleared the hasLayer() flag. Do not use the layer as repaint container in such cases. Test: compositing/repaint-container-assertion-when-toggling-compositing.html * rendering/RenderObject.cpp: (WebCore::RenderObject::enclosingLayer): 2015-01-13 Andreas Kling Element::normalizeAttributes() needs to handle arbitrary JS executing between loop iterations. Reviewed by Benjamin Poulain. Since DOM mutation events may arise below the call to Node::normalize(), have the loop in Element::normalizeAttributes() make a copy of the Attr nodes beforehand, to guard against mutations. Based on a patch by Chris "Chris Dumez" Dumez. Test: fast/dom/Element/normalize-crash2.html * dom/Element.cpp: (WebCore::Element::normalizeAttributes): 2015-02-06 Maciej Stachowiak REGRESSION(r179706): Caused memory corruption on some tests (Requested by _ap_ on #webkit). https://bugs.webkit.org/show_bug.cgi?id=141324 Reviewed by Alexey Proskuryakov. No new tests. This is caught by existing tests under ASAN, and I don't know how to reproduce it without ASAN. * rendering/RenderLineBoxList.cpp: (WebCore::RenderLineBoxList::dirtyLinesFromChangedChild): Give up and just always invalidate the next line. It's too hard to come up with the condition that catches all needed cases, doesn't itself cause a crash, and isn't overzealous. And we do this for the previous line anyway. Also clean up the code a bit since it confusingly reuses a variable, and declares it uninitialized, for no good reason. 2015-02-05 Maciej Stachowiak Crash due to failing to dirty a removed text node's line box https://bugs.webkit.org/show_bug.cgi?id=136544 Reviewed by David Hyatt. Test: fast/text/remove-text-node-linebox-not-dirty-crash.html * rendering/RenderLineBoxList.cpp: (WebCore::RenderLineBoxList::dirtyLinesFromChangedChild): Make the check for dirtying the next line box a bit more inclusive to avoid a case of a line box for a destroyed render object not being dirtied. In particular, when the text node's parent has no line boxes but contains BRs. 2015-02-15 Said Abou-Hallawa Crash when accessing an item in SVGLengthList and then replacing it with a previous item in the list. https://bugs.webkit.org/show_bug.cgi?id=141552. Reviewed by Darin Adler. Tests: LayoutTests/svg/dom/SVGLengthList-basics.xhtml: This test is modified to include a new test case. * svg/properties/SVGListPropertyTearOff.h: Commit the removal of the replacing item before trying to detach the wrapper of the item which going to be replaced. 2015-04-02 Alexey Proskuryakov Clean up access checks in JSHistoryCustom.cpp https://bugs.webkit.org/show_bug.cgi?id=143227 Reviewed by Sam Weinig. * bindings/js/JSHistoryCustom.cpp: (WebCore::JSHistory::putDelegate): (WebCore::JSHistory::deleteProperty): (WebCore::JSHistory::deletePropertyByIndex): (WebCore::JSHistory::getOwnPropertyNames): (WebCore::JSHistory::pushState): (WebCore::JSHistory::replaceState): 2014-08-27 Daniel Bates Scrollbar corner can be drawn outside containing frame https://bugs.webkit.org/show_bug.cgi?id=133131 Reviewed by Simon Fraser. Merged from Blink (patch by Levi Weintraub): Fixes an issue where the scroll corner may be painted outside the rectangle of its associated frame by setting a clip rectangle before painting the scroll bar(s) and scroll corner. Test: scrollbars/custom-scrollbars-paint-outside-iframe.html * platform/ScrollView.cpp: (WebCore::ScrollView::paint): 2015-07-09 Daniel Bates Fetching Content Security Policy report URL should respect same origin policy https://bugs.webkit.org/show_bug.cgi?id=146754 Reviewed by Brady Eidson. Inspired by Blink r149791 (by Mike West ): As per , fetching the Content Security Policy report URL should include cookies if and only if the origin of the protected resource is equal to the origin of the report URL. Tests: http/tests/security/contentSecurityPolicy/report-cross-origin-no-cookies-when-private-browsing-enabled.html http/tests/security/contentSecurityPolicy/report-cross-origin-no-cookies-when-private-browsing-toggled.html http/tests/security/contentSecurityPolicy/report-cross-origin-no-cookies.html http/tests/security/contentSecurityPolicy/report-same-origin-no-cookies-when-private-browsing-toggled.html http/tests/security/contentSecurityPolicy/report-same-origin-with-cookies-when-private-browsing-enabled.html http/tests/security/contentSecurityPolicy/report-same-origin-with-cookies.html * loader/PingLoader.cpp: (WebCore::PingLoader::sendViolationReport): 2015-07-09 Zalan Bujtas Plugin create can end up destroying its renderer. https://bugs.webkit.org/show_bug.cgi?id=146824 rdar://problem/18921429 Reviewed by Andreas Kling. Plugins can run arbitrary code during initialization. If the plugin happens to destroy the associated node, its renderer becomes invalid. This patch checks whether the renderer survived the createPlugin() call. (This WeakPtr pattern is also used in RenderWidget to avoid dangling pointers.) Speculative fix. Not reproducible. * loader/SubframeLoader.cpp: (WebCore::SubframeLoader::loadPlugin): 2015-08-05 Chris Dumez Crash when removing children of a MathMLSelectElement https://bugs.webkit.org/show_bug.cgi?id=147704 Reviewed by Ryosuke Niwa. When MathMLSelectElement::childrenChanged() is called after its children have been removed, MathMLSelectElement calls updateSelectedChild() which accesses m_selectedChild. However, in this case, m_selectedChild is the previously selected child and it may be destroyed as this point if it was removed. To avoid this problem, MathMLSelectElement now keep a strong ref to the currently selected element. Test: mathml/maction-removeChild.html * mathml/MathMLSelectElement.h: 2015-05-28 Myles C. Maxfield Crash under ICU with ASAN during editing/selection/move-by-word-visually-crash-test-5.html https://bugs.webkit.org/show_bug.cgi?id=145429 Reviewed by Alexey Proskuryakov. WebKit uses some strings which contain the lower 8-bits of UTF-16 (thereby saving space). However, ICU doesn't understand this encoding. When we want to use ICU functions with strings in this encoding, we create a UTextProvider which converts our encoded strings to UTF-16 for ICU, one chunk at a time. This object contains a vtable which we populate to perform the conversion. The WebKit function which actually returns the UTF-16 chunks has two relevant arguments: an index into the encoded string which ICU is requesting, and a direction from that index which ICU is interested in. This function populates a "chunk" which is characterized by a pointer to a buffer, the length of the populated data in the buffer, and an offset into the chunk which represents the index that the requested character was put into. When ICU requests data going backward, we fill in the chunk accordingly, with the requested character all the way at the end. We then set the offset equal to the length of the buffer. However, this length value is stale from the previous time the function ran. Therefore, ICU was reading the wrong index in the chunk when expecting the requested character. Covered by editing/selection/move-by-word-visually-crash-test-5.html. * platform/text/icu/UTextProviderLatin1.cpp: (WebCore::uTextLatin1Access): 2015-05-29 Brady Eidson Review feedback followup for r185003. https://bugs.webkit.org/show_bug.cgi?id=145463 Reviewed by Darin Adler. * platform/sql/SQLiteDatabase.cpp: (WebCore::SQLiteDatabase::overrideUnauthorizedFunctions): `static const` one thing, c++-style cast another. 2015-05-29 Brady Eidson WebSQL default functions can bypass authorizer. and https://bugs.webkit.org/show_bug.cgi?id=145463 Reviewed by Sam Weinig and Alexey Proskuryakov. No new tests yet. * platform/sql/SQLiteDatabase.cpp: (WebCore::unauthorizedSQLFunction): Function to install into SQLite to override some built-in functions. (WebCore::SQLiteDatabase::open): (WebCore::SQLiteDatabase::overrideUnauthorizedFunctions): Install function overrides for functions that take arbitrary input that are also meant to be disabled by virtue of them not being whitelisted. * platform/sql/SQLiteDatabase.h: 2015-06-09 Said Abou-Hallawa feComposite filter does not clip the paint rect to its effect rect when the operator is 'in' or 'atop' https://bugs.webkit.org/show_bug.cgi?id=137856 Reviewed by Darin Adler. There was bug in calculating the absolutePaintRect of the feComposite filter when the operator is equal to 'in' or 'atop'. The absolutePaintRect was set to the absolutePaintRect of the background FilterEffect which is correct. What was missing is clipping this rectangle to the maxEffectRect of the filter which we do for other operators. Tests: svg/filters/feComposite-background-rect-control-operators.svg * platform/graphics/IntRect.h: (WebCore::operator-=): (WebCore::operator-): Add new operators to IntRect. * platform/graphics/filters/FEComposite.cpp: (WebCore::FEComposite::determineAbsolutePaintRect): Make sure the filter absolutePaintRect is clipped to maxEffectRect for all operators. (WebCore::FEComposite::platformApplySoftware): Code clean-up. * platform/graphics/filters/FilterEffect.cpp: (WebCore::FilterEffect::determineAbsolutePaintRect): Move the clipping part to a separate function. (WebCore::FilterEffect::clipAbsolutePaintRect): Clip the absolutePaintRect to the maxEffectRect of the filter. * platform/graphics/filters/FilterEffect.h: 2015-06-15 Zalan Bujtas RootInlineBox::m_lineBreakObj becomes invalid when a child renderer is removed and the line does not get marked dirty. https://bugs.webkit.org/show_bug.cgi?id=145988 rdar://problem/20959137 Reviewed by David Hyatt. This patch ensures that we find the right first inline box so that we can dirty the the appropriate line boxes. With marking the right line boxes dirty, now we can update RootInlineBox::m_lineBreakObj at the next layout. Test: fast/inline/crash-when-child-renderer-is-removed-and-line-stays-clean.html * rendering/RenderInline.cpp: (WebCore::RenderInline::culledInlineFirstLineBox): (WebCore::RenderInline::culledInlineLastLineBox): * rendering/RootInlineBox.cpp: (WebCore::RootInlineBox::setLineBreakInfo): Deleted. Remove misleading assert and comment. 2015-06-19 Andy Estes Various assertion failures occur when executing script in the midst of DOM insertion https://bugs.webkit.org/show_bug.cgi?id=132482 Reviewed by Darin Adler. Prior to this change, when an element containing a