2011-03-07 Ryosuke Niwa Reviewed by Darin Adler. selectionHasStyle and selectionStartHasStyle should use EditingStyle https://bugs.webkit.org/show_bug.cgi?id=55902 Deployed EditingStyle in selectionHasStyle and selectionStartHasStyle. This allowed us to move triStateOfStyle from Editor.cpp to EditingStyle.cpp. Also changed the argument lists of selectionHasStyle and selectionStartHasStyle to take a property id and a value instead of a CSSMutableStyleDeclaration to cleanup call sites of these two functions. * WebCore.exp.in: Updated the signature of selectionHasStyle. No longer exports selectionStartHasStyle because it's not called anywhere outside of WebCore. * WebCore.order: Ditto. * editing/EditingStyle.cpp: (WebCore::EditingStyle::EditingStyle): Added a new constructor that takes a property id and a property value. (WebCore::EditingStyle::triStateOfStyle): Moved from Editor.cpp. * editing/EditingStyle.h: (WebCore::EditingStyle::create): Added. * editing/Editor.cpp: (WebCore::Editor::selectionStartHasStyle): Takes a property id and a value instead of a CSSStyleDeclaration. (WebCore::Editor::selectionHasStyle): Ditto. * editing/Editor.h: Updated the signatures of selectionStartHasStyle and selectionHasStyle. * editing/EditorCommand.cpp: (WebCore::executeToggleStyle): Calls selectionStartHasStyle and selectionHasStyle. (WebCore::stateStyle): Ditto. * page/ContextMenuController.cpp: (WebCore::ContextMenuController::checkOrEnableIfNeeded): Ditto. 2011-03-07 Alexey Proskuryakov Reviewed by Darin Adler. REGRESSION (HTML5 tree builder): Text selection in a large text document is extremely slow https://bugs.webkit.org/show_bug.cgi?id=55898 REGRESSION: Mail hangs with a certain large mail message when linkifying e-mail addresses in in -[DOMCharacterData setData:] Changes render tree of fast/text/large-text-composed-char.html, but not image results. * dom/CharacterData.cpp: (WebCore::CharacterData::parserAppendData): Changed parserAppendData() to accept a maximum length, and moved code from Text::createWithLengthLimit(). * dom/CharacterData.h: Moved a constant for maximum length from Text.h. * dom/Text.cpp: (WebCore::Text::createWithLengthLimit): * dom/Text.h: This function was unused in ToT. Moved code around to share with CharacterData. * html/parser/HTMLConstructionSite.cpp: (WebCore::HTMLConstructionSite::insertTextNode): Chnaged to split large text nodes while parsing again. 2011-03-07 Alice Boxhall Reviewed by Adam Barth. Fix platform/image-encoders/JPEGImageEncoder.cpp empty_output_buffer() behaviour https://bugs.webkit.org/show_bug.cgi?id=54522 Fix jpegEmptyOutputBuffer() by ignoring free_in_buffer value as required. No new tests, as this code is not yet used in WebKit. Once this code is used to implement canvas.toDataUrl(), the canvas tests will exercise it. * platform/image-encoders/JPEGImageEncoder.cpp: (WebCore::jpegEmptyOutputBuffer): 2011-03-07 Sergey Glazunov Reviewed by Eric Seidel. Add the missing insertedIntoDocument() call in SVGVKernElement and SVGHKernElement https://bugs.webkit.org/show_bug.cgi?id=55896 Test: svg/dom/vkern-element-crash.html * svg/SVGHKernElement.cpp: (WebCore::SVGHKernElement::insertedIntoDocument): * svg/SVGVKernElement.cpp: (WebCore::SVGVKernElement::insertedIntoDocument): 2011-03-07 Sheriff Bot Unreviewed, rolling out r80514. http://trac.webkit.org/changeset/80514 https://bugs.webkit.org/show_bug.cgi?id=55915 Caused assertion failures (Requested by ukai on #webkit). * platform/graphics/skia/GraphicsContextSkia.cpp: (WebCore::GraphicsContext::setPlatformShadow): * platform/graphics/skia/ImageSkia.cpp: (WebCore::paintSkBitmap): 2011-03-07 Cosmin Truta Reviewed by Adam Barth. SVG referenced by is displayed incorrectly https://bugs.webkit.org/show_bug.cgi?id=55750 The result of sourceURI must use the URL of the enclosing document as base. Otherwise, the base may sometimes be empty, and, as a consequence, the intermediate KURL object may be invalid. Test: svg/custom/use-image-in-g.svg * svg/SVGImageLoader.cpp: (WebCore::SVGImageLoader::sourceURI): 2011-03-07 Helder Correia Reviewed by Simon Fraser. Shadow is not shown when using strokeRect with a gradient strokeStyle https://bugs.webkit.org/show_bug.cgi?id=52509 This happens in CG and is related to bug 51869, this time to be fixed in GraphicsContext::strokeRect(const FloatRect& r, float lineWidth). We need to draw the gradient clipped to the stroke on a CGLayer first, and then draw the layer on the GraphicsContext. Tests: fast/canvas/canvas-strokeRect-gradient-shadow.html svg/css/rect-gradient-stroke-shadow.svg * platform/graphics/cg/GraphicsContextCG.cpp: (WebCore::GraphicsContext::strokeRect): 2011-03-07 Justin Novosad Reviewed by Kenneth Russell. Fix for blurs behind bitmap images in Chromium, and boosting shadow blur quality Bug URLs: https://bugs.webkit.org/show_bug.cgi?id=55410 https://bugs.webkit.org/show_bug.cgi?id=55506 No new tests. Covered by existing layout tests. * platform/graphics/skia/GraphicsContextSkia.cpp: (WebCore::GraphicsContext::setPlatformShadow): Turn on high quality shadows and fix shadow color * platform/graphics/skia/ImageSkia.cpp: (WebCore::paintSkBitmap): Propagate the draw looper from context to painter 2011-03-07 Andreas Kling Unreviewed Mac build fix after r80508. * WebCore.exp.in: 2011-03-07 Enrica Casucci Unreviewed build fix. Rolling back http://trac.webkit.org/changeset/80497 due to the 32-bit build failures. * WebCore.xcodeproj/project.pbxproj: * platform/mac/HTMLConverter.h: Removed. * platform/mac/HTMLConverter.mm: Removed. * platform/mac/PasteboardMac.mm: (WebCore::Pasteboard::writeSelection): 2011-03-07 Andreas Kling Reviewed by Benjamin Poulain. FrameView::setBaseBackgroundColor: Pass Color argument as const-reference. * page/FrameView.cpp: (WebCore::FrameView::setBaseBackgroundColor): * page/FrameView.h: 2011-03-07 Adam Barth Reviewed by Dimitri Glazkov. REGRESSION(r78147): Crash on http://gnarf.net/jquery/test/ https://bugs.webkit.org/show_bug.cgi?id=55894 The m_frame can disappear out from under us, and there's no point in checking whether the load is complete in a non-existant frame. Test: fast/parser/document-write-into-initial-document.html * dom/Document.cpp: (WebCore::Document::explicitClose): 2011-03-07 Sheriff Bot Unreviewed, rolling out r80500. http://trac.webkit.org/changeset/80500 https://bugs.webkit.org/show_bug.cgi?id=55908 Caused mysterious GYP error (Requested by abarth on #webkit). * WebCore.gyp/WebCore.gyp: * WebCore.gypi: 2011-03-07 Adam Barth Fix Chromium Mac build. This header should only be included when the feature is enabled. * platform/cf/RunLoopTimerCF.cpp: 2011-03-07 Adam Barth Reviewed by Dimitri Glazkov. Add WML files to WebCore.gypi https://bugs.webkit.org/show_bug.cgi?id=55905 * WebCore.gyp/WebCore.gyp: * WebCore.gypi: 2011-03-07 Adrienne Walker Reviewed by James Robinson. [chromium] Add missing include to #define Skia parameter https://bugs.webkit.org/show_bug.cgi?id=55885 * platform/graphics/chromium/ShaderChromium.h: 2011-03-07 Chris Fleizach Reviewed by Beth Dakin. AX: WK1 needs to use ScrollView attachment for AXScrollArea, WK2 does not https://bugs.webkit.org/show_bug.cgi?id=55706 * WebCore.exp.in: * accessibility/AXObjectCache.cpp: (WebCore::AXObjectCache::rootObjectForFrame): * accessibility/AXObjectCache.h: * accessibility/AccessibilityScrollView.cpp: (WebCore::AccessibilityScrollView::isAttachment): (WebCore::AccessibilityScrollView::widgetForAttachmentView): * accessibility/AccessibilityScrollView.h: (WebCore::AccessibilityScrollView::firstChild): * accessibility/mac/AccessibilityObjectWrapper.mm: (-[AccessibilityObjectWrapper accessibilityAttributeValue:]): 2011-03-07 Enrica Casucci Reviewed by Darin Adler. REGRESSION: Copied content loses formatting on paste to external apps. https://bugs.webkit.org/show_bug.cgi?id=47615 This is a resubmission of a patch that was landed a while ago then rolled back because of a build failure on SnowLeopard and Leopard. This patch adds a way for WebKit2 to create NSAttributedStrings from a DOM range without using the AppKit api initWithDOMRange that internally needs to access the WebView. The NSAttributedString is needed to create RTF formats in the pasteboard. This is to be considered a first step, since in the future we want to have an implementation based on the TextIterator. * WebCore.xcodeproj/project.pbxproj: Added new file. * platform/mac/HTMLConverter.h: Added. * platform/mac/HTMLConverter.mm: Added. * platform/mac/PasteboardMac.mm: (WebCore::Pasteboard::writeSelection): We now use WebHTMLConverter class for WebKit2 to create the NSAttributedString from the DOM range. 2011-03-07 Adam Barth Reviewed by Dimitri Glazkov. Add some missing platform files to WebCore.gypi https://bugs.webkit.org/show_bug.cgi?id=55897 There are a bunch more, but this is a start. * WebCore.gyp/WebCore.gyp: * WebCore.gypi: 2011-03-07 Steve Block Reviewed by Jeremy Orlow. Rename JNIBridgeV8.cpp/h to JavaFieldV8.cpp/h https://bugs.webkit.org/show_bug.cgi?id=55879 No new tests, refactoring only. * Android.v8bindings.mk: * WebCore.gypi: * bridge/jni/v8/JavaClassV8.cpp: * bridge/jni/v8/JavaClassV8.h: * bridge/jni/v8/JavaFieldV8.cpp: Renamed from Source/WebCore/bridge/jni/v8/JNIBridgeV8.cpp. (JavaField::JavaField): * bridge/jni/v8/JavaFieldV8.h: Renamed from Source/WebCore/bridge/jni/v8/JNIBridgeV8.h. (JSC::Bindings::JavaField::name): (JSC::Bindings::JavaField::type): (JSC::Bindings::JavaField::getJNIType): * bridge/jni/v8/JavaInstanceV8.cpp: * bridge/jni/v8/JavaNPObjectV8.cpp: 2011-03-07 Daniel Cheng Reviewed by Tony Chang. Add plumbing for paste support to ChromiumDataObject::types() https://bugs.webkit.org/show_bug.cgi?id=55792 This is a preliminary patch to support event.dataTransfer.items. This adds plumbing to support retrieving the types in a paste event. It also moves the check for files in a drag/paste up to ClipboardChromium, since internal code needs to be able to differentiate between actual files in a drag and someone that simply decided to use "Files" as a custom type string. Test: editing/pasteboard/onpaste-text-html-types.html * platform/chromium/ChromiumDataObject.cpp: (WebCore::ChromiumDataObject::types): (WebCore::ChromiumDataObject::containsFilenames): * platform/chromium/ChromiumDataObject.h: * platform/chromium/ClipboardChromium.cpp: (WebCore::ClipboardChromium::types): * platform/chromium/ClipboardMimeTypes.cpp: * platform/chromium/ClipboardMimeTypes.h: 2011-03-07 Takayoshi Kochi Reviewed by Tony Chang. [chromium] Use preferred locale information when choosing fallback font using fontconfig on Linux platform. http://bugs.webkit.org/show_bug.cgi?id=55453 No new tests, as it depends on ICU and locale setting, so it will be covered by Chromium side. * platform/chromium/PlatformBridge.h: * platform/graphics/chromium/FontCacheLinux.cpp: 2011-03-07 Adam Barth Reviewed by Eric Seidel. Add gobject, cpp, and objc bindings to WebCore.gypi https://bugs.webkit.org/show_bug.cgi?id=55892 These are also excluded from the Chromium build but needed for various other ports. * WebCore.gyp/WebCore.gyp: * WebCore.gypi: 2011-03-07 Sergey Glazunov Reviewed by Dimitri Glazkov. Node::checkAddChild and Node::checkReplaceChild shouldn't change the owner document of a node https://bugs.webkit.org/show_bug.cgi?id=55803 Test: fast/dom/dom-method-document-change.html * dom/ContainerNode.cpp: (WebCore::ContainerNode::insertBefore): (WebCore::ContainerNode::replaceChild): (WebCore::ContainerNode::appendChild): * dom/Node.cpp: (WebCore::Node::checkReplaceChild): (WebCore::Node::checkAddChild): * dom/Node.h: 2011-03-07 Sheriff Bot Unreviewed, rolling out r80484. http://trac.webkit.org/changeset/80484 https://bugs.webkit.org/show_bug.cgi?id=55891 requires Chromium DEPS roll (Requested by dcheng on #webkit). * platform/chromium/ChromiumDataObject.cpp: (WebCore::ChromiumDataObject::types): * platform/chromium/ChromiumDataObject.h: (WebCore::ChromiumDataObject::containsFilenames): * platform/chromium/ClipboardChromium.cpp: (WebCore::ClipboardChromium::types): * platform/chromium/ClipboardMimeTypes.cpp: * platform/chromium/ClipboardMimeTypes.h: 2011-03-07 Adam Barth Reviewed by Dimitri Glazkov. Add missing bindings/js files to WebCore.gypi https://bugs.webkit.org/show_bug.cgi?id=55888 These files are excluded from the Chromium build but needed for the Mac build. * WebCore.gypi: 2011-03-07 Daniel Cheng Reviewed by Tony Chang. Add plumbing for paste support to ChromiumDataObject::types() https://bugs.webkit.org/show_bug.cgi?id=55792 This is a preliminary patch to support event.dataTransfer.items. This adds plumbing to support retrieving the types in a paste event. It also moves the check for files in a drag/paste up to ClipboardChromium, since internal code needs to be able to differentiate between actual files in a drag and someone that simply decided to use "Files" as a custom type string. Test: editing/pasteboard/onpaste-text-html-types.html * platform/chromium/ChromiumDataObject.cpp: (WebCore::ChromiumDataObject::types): (WebCore::ChromiumDataObject::containsFilenames): * platform/chromium/ChromiumDataObject.h: * platform/chromium/ClipboardChromium.cpp: (WebCore::ClipboardChromium::types): * platform/chromium/ClipboardMimeTypes.cpp: * platform/chromium/ClipboardMimeTypes.h: 2011-03-07 Joseph Pecoraro Reviewed by Kenneth Rohde Christiansen. Viewport Warning/Error Messages Are Now Inaccurate https://bugs.webkit.org/show_bug.cgi?id=53707 Correct and improve the error messages for viewport parsing. Tests: fast/viewport/viewport-warnings-1.html fast/viewport/viewport-warnings-2.html fast/viewport/viewport-warnings-3.html fast/viewport/viewport-warnings-4.html fast/viewport/viewport-warnings-5.html fast/viewport/viewport-warnings-6.html * dom/ViewportArguments.cpp: (WebCore::numericPrefix): (WebCore::findSizeValue): remove incorrect device-width / height tips. (WebCore::setViewportFeature): report a warning for an unrecognized key. (WebCore::viewportErrorMessageTemplate): added template for unrecognized key. (WebCore::viewportErrorMessageLevel): classify an unrecognized key is an error. * dom/ViewportArguments.h: removed no longer used warnings. 2011-03-07 James Robinson Reviewed by Kenneth Russell. [chromium] Separate the update and draw portions of LayerRendererChromium's drawLayers function https://bugs.webkit.org/show_bug.cgi?id=54047 This splits up LayerRendererChromium::drawLayers() into two phases, one that updates layers and one that actually draws them. Most of the patch is moving the bodies of drawLayers() and updateLayersRecursive() into smaller helper functions. The main entry point is renamed updateAndDrawLayers(), but otherwise has the same signature as drawLayers() did. Internally it does the following: 1.) Updates the root layer's contents 2.) Updates the root layer's scrollbars 3.) Updates the RenderSurface tree and the contents of all child layers 4.) Draws the root layer and root layer scrollbars 5.) Draws all child layers using the previously updated CCLayerImpl/RenderSurface data. A few things still need to be done after this patch to complete the separation of the update and draw step, but they can happen in later patches: *) The root layer and root layer scrollbars contents should be uploaded to textures at draw time, not update time. *) The RenderSurface tree should be updated at draw time, not update time. Covered by the compositing/ tests. * platform/graphics/chromium/LayerRendererChromium.cpp: (WebCore::LayerRendererChromium::LayerRendererChromium): (WebCore::LayerRendererChromium::updateRootLayerContents): (WebCore::LayerRendererChromium::updateRootLayerScrollbars): (WebCore::LayerRendererChromium::drawRootLayer): (WebCore::LayerRendererChromium::updateAndDrawLayers): (WebCore::LayerRendererChromium::updateLayers): (WebCore::LayerRendererChromium::drawLayers): (WebCore::LayerRendererChromium::getFramebufferPixels): (WebCore::LayerRendererChromium::updatePropertiesAndRenderSurfaces): (WebCore::LayerRendererChromium::updateContentsRecursive): (WebCore::LayerRendererChromium::drawLayer): * platform/graphics/chromium/LayerRendererChromium.h: (WebCore::LayerRendererChromium::visibleRectSize): * platform/graphics/chromium/RenderSurfaceChromium.cpp: (WebCore::RenderSurfaceChromium::drawSurface): * platform/graphics/chromium/cc/CCLayerImpl.cpp: * platform/graphics/chromium/cc/CCLayerImpl.h: 2011-03-07 Adam Barth Reviewed by Eric Seidel. Sort WebCore.gypi https://bugs.webkit.org/show_bug.cgi?id=55887 These files should be in order. This is preparation for adding in the missing files. * WebCore.gypi: 2011-03-07 Csaba Osztrogonác Unreviewed buildfix after r80478. * dom/Document.cpp: Add suggested parentheses to make GCC happy. (WebCore::Document::didReceiveTask): 2011-03-07 Yong Li Reviewed by Darin Adler. Defer ScriptExecutionContext::Task's in Document when page loading is deferred. Schedule them with timer when page loading is resumed. The tasks will be performed in the original order. This fixes the problem that database callbacks could be missed when page loading was deferred. https://bugs.webkit.org/show_bug.cgi?id=49401 Manual test added: manual-tests/database-callback-deferred.html. * dom/Document.cpp: (WebCore::Document::Document): (WebCore::Document::~Document): (WebCore::Document::didReceiveTask): (WebCore::Document::postTask): (WebCore::Document::pendingTasksTimerFired): (WebCore::Document::willDeferLoading): (WebCore::Document::didResumeLoading): * dom/Document.h: * manual-tests/database-callback-deferred.html: Added. * page/PageGroupLoadDeferrer.cpp: (WebCore::PageGroupLoadDeferrer::PageGroupLoadDeferrer): (WebCore::PageGroupLoadDeferrer::~PageGroupLoadDeferrer): 2011-03-07 Antti Koivisto Reviewed by Sam Weinig. Use HashMaps for caching primitive values https://bugs.webkit.org/show_bug.cgi?id=55873 Most documents use only small subset of cacheable primitive values. By replacing fixed size cache arrays with HashMaps we can reduce the constant memory usage while also expanding the range of cacheable values. * css/CSSPrimitiveValueCache.cpp: (WebCore::CSSPrimitiveValueCache::CSSPrimitiveValueCache): (WebCore::CSSPrimitiveValueCache::createIdentifierValue): (WebCore::CSSPrimitiveValueCache::createColorValue): (WebCore::CSSPrimitiveValueCache::createValue): * css/CSSPrimitiveValueCache.h: 2011-03-07 Steve Block Reviewed by Jeremy Orlow. Split JNIBridgeJSC.cpp/h into JavaArrayJSC.cpp/h and JavaFieldJSC.cpp/h https://bugs.webkit.org/show_bug.cgi?id=55881 No new tests, refactoring only. * Android.jscbindings.mk: * GNUmakefile.am: * WebCore.xcodeproj/project.pbxproj: * bridge/jni/jsc/JNIBridgeJSC.cpp: Removed. * bridge/jni/jsc/JNIBridgeJSC.h: Removed. * bridge/jni/jsc/JNIUtilityPrivate.cpp: * bridge/jni/jsc/JavaClassJSC.cpp: * bridge/jni/jsc/JavaClassJSC.h: * bridge/jni/jsc/JavaInstanceJSC.cpp: 2011-03-07 Sam Weinig Reviewed by Anders Carlsson. Replace WebKit2's decidePolicyForMIMEType with decidePolicyForResponse https://bugs.webkit.org/show_bug.cgi?id=55827 * loader/EmptyClients.h: (WebCore::EmptyFrameLoaderClient::dispatchDecidePolicyForResponse): * loader/FrameLoaderClient.h: * loader/MainResourceLoader.cpp: (WebCore::MainResourceLoader::didReceiveResponse): * loader/PolicyChecker.cpp: (WebCore::PolicyChecker::checkContentPolicy): * loader/PolicyChecker.h: Rename FrameLoaderClient::dispatchDecidePolicyForMIMEType to dispatchDecidePolicyForResponse and pass the entire response, instead of just the MIMEType. 2011-03-07 Eric Carlson Reviewed by Darin Adler. Add API to enumerate/delete files downloaded for