2016-04-27 Carlos Garcia Campos [GTK] Overlay scrollbars with steppers enabled render incorrectly https://bugs.webkit.org/show_bug.cgi?id=156988 Reviewed by Michael Catanzaro. Fix rendering of scrollbars when using GTK+ themes having stepper buttons. * platform/gtk/RenderThemeGadget.cpp: (WebCore::RenderThemeBoxGadget::RenderThemeBoxGadget): Receive the box orientation as constructor parameter. (WebCore::RenderThemeBoxGadget::preferredSize): Fix the preferred size calculation taking into account the box orientation. (WebCore::RenderThemeScrollbarGadget::renderStepper): New method to render scrollbar steppers. * platform/gtk/RenderThemeGadget.h: (WebCore::RenderThemeGadget::context): Make this public instead of protected. * platform/gtk/ScrollAnimatorGtk.cpp: (WebCore::ScrollAnimatorGtk::updateOverlayScrollbarsOpacity): Invalidate the whole scrollbars instead of just the thumb when opacity changes, because themes can actually render the trough or even stepper buttons when in indicator mode too. * platform/gtk/ScrollbarThemeGtk.cpp: (WebCore::ScrollbarThemeGtk::hasButtons): Properly implement this method instead of returning true unconditionally. (WebCore::contentsGadgetForLayout): Pass orientation to RenderThemeBoxGadget constructor. (WebCore::ScrollbarThemeGtk::trackRect): Fix the calculation of the track rect taking stepper buttons into account. (WebCore::ScrollbarThemeGtk::backButtonRect): Fix the calculation of the stepper button rectangle. (WebCore::ScrollbarThemeGtk::forwardButtonRect): Ditto. (WebCore::ScrollbarThemeGtk::paint): Use RenderThemeScrollbarGadget::renderStepper() to render the stepper buttons, and fix the calculation of the steppers button rectangle. (WebCore::ScrollbarThemeGtk::handleMousePressEvent): Handle clicks on stepper buttons. (WebCore::ScrollbarThemeGtk::scrollbarThickness): Fix the calculation of the scrollbar thickness. (WebCore::ScrollbarThemeGtk::minimumThumbLength): Pass orientation to RenderThemeBoxGadget constructor. * platform/gtk/ScrollbarThemeGtk.h: * rendering/RenderThemeGtk.cpp: (WebCore::menuListColor): Ditto. (WebCore::RenderThemeGtk::popupInternalPaddingBox): Ditto. (WebCore::RenderThemeGtk::paintMenuList): Ditto. 2016-04-27 Carlos Garcia Campos Unreviewed. Fix compatibility issue with 2.12.1 regarding local storage access from file URLs. * page/SecurityOrigin.cpp: (WebCore::SecurityOrigin::canAccessStorage): 2016-04-25 Alberto Garcia [GTK] Crashes if DISPLAY is unset https://bugs.webkit.org/show_bug.cgi?id=156972 Reviewed by Carlos Garcia Campos. If DISPLAY is unset then m_display will be NULL, crashing WebKit when XCloseDisplay is called in the PlatformDisplayX11 destructor. * platform/graphics/x11/PlatformDisplayX11.cpp: (WebCore::PlatformDisplayX11::~PlatformDisplayX11): 2016-04-20 Chris Dumez Crash under WebCore::TextIterator::subrange() https://bugs.webkit.org/show_bug.cgi?id=156809 Reviewed by Ryosuke Niwa. TextIterator::rangeFromLocationAndLength() may return null. However, we failed to do a null check before calling TextIterator::subrange() with that range. No new tests, do not know how to reproduce. * editing/AlternativeTextController.cpp: (WebCore::AlternativeTextController::applyAlternativeTextToRange): 2016-04-20 Chris Dumez Potential overflow in RenderLayer::hitTestList() https://bugs.webkit.org/show_bug.cgi?id=156804 Reviewed by Simon Fraser. Use size_t type instead of int to iterate over the Vector to make sure we don't overflow. This is a speculative fix for . * rendering/RenderLayer.cpp: (WebCore::RenderLayer::hitTestList): 2016-04-20 Carlos Garcia Campos [Cairo] Crash in GraphicsContext::drawFocusRing when painting is disabled https://bugs.webkit.org/show_bug.cgi?id=156785 Reviewed by Žan Doberšek. This happens for example when view state changes to focus and paint is called from FrameView::updateControlTints() with a graphics context that doesn't have a platform context. Layout test fast/images/image-map-outline-with-scale-transform.html sometimes crashes because of this. * platform/graphics/cairo/GraphicsContextCairo.cpp: (WebCore::GraphicsContext::drawFocusRing): Return early if painting is disabled. 2016-04-19 Carlos Garcia Campos [Cairo] GraphicsContext::drawFocusRing methods are not consistent to each other https://bugs.webkit.org/show_bug.cgi?id=156742 Reviewed by Martin Robinson. We are rendering the focus ring differently depending on whether a path is used or a vector of rectangles. This is causing that some reftests fail because they assume we always render the focus ring the same way. For example fast/images/image-map-outline-in-positioned-container.html, when rendering the test GraphicsContext::drawFocusRing is called with a path, and when rendering the reference it's called with a vector of rectangles, producing different results. * platform/graphics/cairo/GraphicsContextCairo.cpp: (WebCore::GraphicsContext::drawFocusRing): When receiving a vector of rectangles, build a Path from the given rectangles and call drawFocusRing() with the built path to ensure consistency. 2016-04-19 Joanmarie Diggs [GTK] accessibility/gtk/entry-and-password.html is failing since r194847 https://bugs.webkit.org/show_bug.cgi?id=153062 Reviewed by Carlos Garcia Campos. The changes in r194847 include using WebCore's rendering for the CapsLock indicator. As a side effect, password inputs gained a TextControlInnerTextElement child from the Shadow DOM. If we include that child in the accessibility tree, the child will emit focus and text notifications that suggest the user is no longer in the control. This can be especially problematic for screen reader users with key echo enabled when typing in a password input. To fix this, prune TextControlInnerTextElement children from the accessibility tree for ATK. No new tests as existing coverage caught this regression. Also modified the auto-fill-crash.html test whose expectations include the children count for a text input. * accessibility/atk/AccessibilityObjectAtk.cpp: (WebCore::AccessibilityObject::accessibilityPlatformIncludesObject): 2016-04-18 Martin Robinson [GTK] Possible off-by-one in hyphenation code https://bugs.webkit.org/show_bug.cgi?id=156661 Reviewed by Michael Catanzaro. No new tests. This is covered by older tests. * platform/text/hyphen/HyphenationLibHyphen.cpp: (WebCore::lastHyphenLocation): Fix an off by one error in hyphen location. 2016-04-18 Brent Fulgham Remove support for X-Frame-Options in `` https://bugs.webkit.org/show_bug.cgi?id=156625 Rubberstamped by Darin Adler. * dom/Document.cpp: (WebCore::Document::processHttpEquiv): Revise messaging based on Darin's comments. 2016-04-18 Carlos Garcia Campos [GTK] Menu list button doesn't use the text color from the theme https://bugs.webkit.org/show_bug.cgi?id=118234 Reviewed by Darin Adler. Set the combo box color accroding to the theme when adjusting the menu list style like Mac port does. * rendering/RenderThemeGtk.cpp: (WebCore::menuListColor): (WebCore::RenderThemeGtk::adjustMenuListStyle): 2016-04-15 Myles C. Maxfield ASSERT when loading github.com https://bugs.webkit.org/show_bug.cgi?id=156604 Reviewed by Darin Adler. HTMLFormControlElement::m_isValid is a cache of the results of the valid() function. When cloning the node, we were preserving each individual item, but not the state of the cache. Therefore, the cache and the attributes didn't agree with each other. Test: fast/forms/checkValidity-cloneNode-crash.html * html/HTMLInputElement.cpp: (WebCore::HTMLInputElement::copyNonAttributePropertiesFromElement): 2016-04-15 Brent Fulgham Remove support for X-Frame-Options in `` https://bugs.webkit.org/show_bug.cgi?id=156625 Reviewed by Darin Adler. Follow RFC7034 (Section 4), which recommends that 'X-Frame-Options' be ignored when delivered as part of a '' tag. This brings us in line with Firefox, Edge, and Blink. Tests: http/tests/security/XFrameOptions/x-frame-options-ignore-deny-meta-tag-in-body.html http/tests/security/XFrameOptions/x-frame-options-ignore-deny-meta-tag-parent-same-origin-allow.html http/tests/security/XFrameOptions/x-frame-options-ignore-deny-meta-tag-parent-same-origin-deny.html http/tests/security/XFrameOptions/x-frame-options-ignore-deny-meta-tag.html http/tests/security/xssAuditor/meta-tag-http-refresh-x-frame-options-ignored.html * dom/Document.cpp: (WebCore::Document::processHttpEquiv): Log error message instead of blocking the load. 2016-04-15 Said Abou-Hallawa Calling SVGAnimatedPropertyTearOff::animationEnded() will crash if the SVG property is not animating https://bugs.webkit.org/show_bug.cgi?id=156549 Reviewed by Darin Adler. A speculative fix for a crash which may happen when calling animationEnded() of any SVGAnimatedProperty while it is not animating. * svg/SVGAnimatedTypeAnimator.h: (WebCore::SVGAnimatedTypeAnimator::executeAction): 2016-04-15 Carlos Garcia Campos Selection.deleteFromDocument should not leave a selection character https://bugs.webkit.org/show_bug.cgi?id=151442 Reviewed by Michael Catanzaro. This is a merge of Blink r172511: https://codereview.chromium.org/255453003 Let Selection.deleteFromDocument not delete a character when the selection is a caret. Selection.deleteFromDocument delete a character when the selection is a caret. However, current standard says that Selection.deleteFromDocument does nothing when the selection is a caret: https://dvcs.w3.org/hg/editing/raw-file/tip/editing.html#dom-selection-deletefromdocument Both IE10 and FireFox seem following the spec. Test: imported/blink/editing/selection/deleteFromDocument-undo-crash.html * page/DOMSelection.cpp: (WebCore::DOMSelection::deleteFromDocument): Deleted. 2016-04-14 Dean Jackson CrashTracer: com.apple.WebKit.WebContent at com.apple.WebCore: WebCore::CachedResource::addClientToSet + 27 https://bugs.webkit.org/show_bug.cgi?id=156602 Reviewed by Simon Fraser. The CSS property list-style-image is inherited, so a transition on a parent might cause a transition on a child. On that child, the value might be between two generated crossfade images which haven't yet resolved, causing a crash. Test: transitions/crossfade-transition.html * css/CSSCrossfadeValue.cpp: (WebCore::CSSCrossfadeValue::blend): Return null if there are no cached images. * page/animation/CSSPropertyAnimation.cpp: (WebCore::blendFunc): If we don't have an actual image to blend between, fall out to the default case. 2016-04-14 Antonio Gomes Allow listbox content and scrollbar to intrude padding area. https://bugs.webkit.org/show_bug.cgi?id=128489 Reviewed by Myles C. Maxfield. Originally when the RenderListBox::controlClipRect method was implemented (see [1]), it used to allow its content (