diff options
Diffstat (limited to 'WebCore')
374 files changed, 10713 insertions, 3878 deletions
diff --git a/WebCore/Android.derived.v8bindings.mk b/WebCore/Android.derived.v8bindings.mk index 6072766..bca703f 100644 --- a/WebCore/Android.derived.v8bindings.mk +++ b/WebCore/Android.derived.v8bindings.mk @@ -612,10 +612,14 @@ $(patsubst %.h,%.cpp,$(GEN)): $(intermediates)/bindings/%.cpp : $(intermediates) # These headers are required by the V8 bindings even when Inspector is disabled GEN := \ $(intermediates)/bindings/V8InjectedScriptHost.h \ +<<<<<<< HEAD $(intermediates)/bindings/V8Inspector.h \ $(intermediates)/bindings/V8InspectorBackend.h \ $(intermediates)/bindings/V8InspectorFrontendHost.h \ $(intermediates)/bindings/V8ScriptProfile.h +======= + $(intermediates)/bindings/V8InspectorFrontendHost.h +>>>>>>> webkit.org at r64264 $(GEN): PRIVATE_PATH := $(LOCAL_PATH) $(GEN): PRIVATE_CUSTOM_TOOL = SOURCE_ROOT=$(PRIVATE_PATH) perl -I$(PRIVATE_PATH)/bindings/scripts $(PRIVATE_PATH)/bindings/scripts/generate-bindings.pl --defines "$(FEATURE_DEFINES) LANGUAGE_JAVASCRIPT" --generator V8 --include dom --include html --outputdir $(dir $@) $< diff --git a/WebCore/Android.mk b/WebCore/Android.mk index 641c0f9..d43fabc 100644 --- a/WebCore/Android.mk +++ b/WebCore/Android.mk @@ -701,6 +701,7 @@ LOCAL_SRC_FILES := $(LOCAL_SRC_FILES) \ rendering/RenderSVGModelObject.cpp \ rendering/RenderSVGResource.cpp \ rendering/RenderSVGResourceClipper.cpp \ + rendering/RenderSVGResourceContainer.cpp \ rendering/RenderSVGResourceFilter.cpp \ rendering/RenderSVGResourceGradient.cpp \ rendering/RenderSVGResourceLinearGradient.cpp \ @@ -750,6 +751,9 @@ LOCAL_SRC_FILES := $(LOCAL_SRC_FILES) \ rendering/SVGMarkerLayoutInfo.cpp \ rendering/SVGRenderSupport.cpp \ rendering/SVGRenderTreeAsText.cpp \ + rendering/SVGResources.cpp \ + rendering/SVGResourcesCache.cpp \ + rendering/SVGResourcesCycleSolver.cpp \ rendering/SVGRootInlineBox.cpp \ rendering/SVGShadowTreeElements.cpp \ rendering/SVGTextChunkLayoutInfo.cpp \ diff --git a/WebCore/CMakeLists.txt b/WebCore/CMakeLists.txt index 7919317..a0f5123 100644 --- a/WebCore/CMakeLists.txt +++ b/WebCore/CMakeLists.txt @@ -293,7 +293,6 @@ SET(WebCore_IDL_FILES html/canvas/Uint8Array.idl inspector/InjectedScriptHost.idl - inspector/InspectorBackend.idl inspector/InspectorFrontendHost.idl inspector/JavaScriptCallFrame.idl inspector/ScriptProfile.idl @@ -535,6 +534,7 @@ SET(WebCore_SOURCES ${DERIVED_SOURCES_DIR}/XMLNames.cpp ${DERIVED_SOURCES_DIR}/XMLNSNames.cpp ${DERIVED_SOURCES_DIR}/XPathGrammar.cpp + ${DERIVED_SOURCES_DIR}/InspectorBackendDispatcher.cpp accessibility/AXObjectCache.cpp accessibility/AccessibilityARIAGrid.cpp @@ -854,6 +854,7 @@ SET(WebCore_SOURCES dom/UIEvent.cpp dom/UIEventWithKeyState.cpp dom/UserGestureIndicator.cpp + dom/UserTypingGestureIndicator.cpp dom/ViewportArguments.cpp dom/WebKitAnimationEvent.cpp dom/WebKitTransitionEvent.cpp @@ -1201,6 +1202,7 @@ SET(WebCore_SOURCES platform/ScrollbarThemeComposite.cpp platform/ScrollView.cpp platform/SharedBuffer.cpp + platform/SchemeRegistry.cpp platform/ThreadGlobalData.cpp platform/ThreadTimers.cpp platform/Timer.cpp @@ -1543,6 +1545,7 @@ IF (ENABLE_SVG) rendering/RenderSVGModelObject.cpp rendering/RenderSVGResource.cpp rendering/RenderSVGResourceClipper.cpp + rendering/RenderSVGResourceContainer.cpp rendering/RenderSVGResourceFilter.cpp rendering/RenderSVGResourceGradient.cpp rendering/RenderSVGResourceLinearGradient.cpp @@ -1565,6 +1568,9 @@ IF (ENABLE_SVG) rendering/SVGMarkerLayoutInfo.cpp rendering/SVGRenderSupport.cpp rendering/SVGRenderTreeAsText.cpp + rendering/SVGResources.cpp + rendering/SVGResourcesCache.cpp + rendering/SVGResourcesCycleSolver.cpp rendering/SVGRootInlineBox.cpp rendering/SVGShadowTreeElements.cpp rendering/SVGTextChunkLayoutInfo.cpp diff --git a/WebCore/CMakeListsEfl.txt b/WebCore/CMakeListsEfl.txt index ab475f5..0837b02 100644 --- a/WebCore/CMakeListsEfl.txt +++ b/WebCore/CMakeListsEfl.txt @@ -97,6 +97,19 @@ IF (WTF_USE_SOUP) ) ENDIF () +IF (WTF_USE_CURL) + LIST(APPEND WebCore_INCLUDE_DIRECTORIES + "${WEBCORE_DIR}/platform/network/curl" + ) + LIST(APPEND WebCore_SOURCES + platform/network/curl/CookieJarCurl.cpp + platform/network/curl/DNSCurl.cpp + platform/network/curl/FormDataStreamCurl.cpp + platform/network/curl/ResourceHandleCurl.cpp + platform/network/curl/ResourceHandleManager.cpp + ) +ENDIF () + IF (WTF_USE_ICU_UNICODE) LIST(APPEND WebCore_SOURCES editing/SmartReplaceICU.cpp @@ -112,30 +125,57 @@ LIST(APPEND WebCore_LIBRARIES ${EFLDEPS_LIBRARIES} ${EVAS_LIBRARIES} ${Freetype_LIBRARIES} - ${GDK_LIBRARIES} - ${Glib_LIBRARIES} - ${GTK_LIBRARIES} ${ICU_LIBRARIES} - ${LIBSOUP24_LIBRARIES} ${LIBXML2_LIBRARIES} ${LIBXSLT_LIBRARIES} ${Pango_LIBRARIES} ${SQLITE_LIBRARIES} ) +IF (WTF_USE_SOUP) + LIST(APPEND WebCore_LIBRARIES + ${LIBSOUP24_LIBRARIES} + ) +ENDIF () + +IF (WTF_USE_CURL) + LIST(APPEND WebCore_LIBRARIES + ${CURL_LIBRARIES} + ) +ENDIF () + LIST(APPEND WebCore_INCLUDE_DIRECTORIES ${Cairo_INCLUDE_DIRS} ${ECORE_X_INCLUDE_DIRS} ${EFLDEPS_INCLUDE_DIRS} ${EVAS_INCLUDE_DIRS} ${Freetype_INCLUDE_DIRS} - ${GDK_INCLUDE_DIRS} - ${Glib_INCLUDE_DIRS} - ${GTK_INCLUDE_DIRS} ${ICU_INCLUDE_DIRS} - ${LIBSOUP24_INCLUDE_DIRS} - ${LIBXML2_INCLUDE_DIRS} + ${LIBXML2_INCLUDE_DIR} ${LIBXSLT_INCLUDE_DIRS} ${Pango_INCLUDE_DIRS} ${SQLITE_INCLUDE_DIRS} ) + +IF (ENABLE_GLIB_SUPPORT) + LIST(APPEND WebCore_LIBRARIES + ${GDK_LIBRARIES} + ${Glib_LIBRARIES} + ) + LIST(APPEND WebCore_INCLUDE_DIRECTORIES + ${GDK_INCLUDE_DIRS} + ${Glib_INCLUDE_DIRS} + ) +ENDIF () + +IF (WTF_USE_SOUP) + LIST(APPEND WebCore_INCLUDE_DIRECTORIES + ${LIBSOUP24_INCLUDE_DIRS} + ) +ENDIF () + +IF (WTF_USE_CURL) + LIST(APPEND WebCore_INCLUDE_DIRECTORIES + ${CURL_INCLUDE_DIRS} + ) +ENDIF () diff --git a/WebCore/ChangeLog b/WebCore/ChangeLog index 79eb390..999b591 100644 --- a/WebCore/ChangeLog +++ b/WebCore/ChangeLog @@ -1,3 +1,3415 @@ +2010-07-28 Bryan Gislason <bgislason@rim.com> + + Reviewed by Nate Chapin. + + Minor compile errors in loadMediaPlayerProxyPlugin + https://bugs.webkit.org/show_bug.cgi?id=43141 + + * WebCore/loader/SubframeLoader.cpp: + +2010-07-28 Dominic Mazzoni <dmazzoni@google.com> + + Reviewed by Dimitri Glazkov. + + Add a missing dependency. + https://bugs.webkit.org/show_bug.cgi?id=43044 + + * css/CSSPrimitiveValueMappings.h: + +2010-07-28 Alex Nicolaou <anicolao@chromium.org> + + Reviewed by Ojan Vafai. + + Set incorrect but close expectations for mask-colorspace.svg on mac + https://bugs.webkit.org/show_bug.cgi?id=43102 + + Blocks: + [chromium] r63450 caused some svg mask tests to fail pixel tests + https://bugs.webkit.org/show_bug.cgi?id=42403 + + ImageBufferCG.cpp uses CoreGraphics to do the transform of SVG masks + into LinearRGB, but only for MAC which means not for CHROMIUM, so I + have changed the #if to account for both platforms. I am assuming this + isn't in for windows because it's missing in CG itself, but I didn't + verify that. + + * platform/graphics/cg/ImageBufferCG.cpp: + (WebCore::ImageBuffer::ImageBuffer): + +2010-07-28 Kent Tamura <tkent@chromium.org> + + Reviewed by Darin Fisher. + + [Chromium] Improve read-only arrow button appearance + https://bugs.webkit.org/show_bug.cgi?id=43108 + + No new tests. This is a fix for fast/forms/ + input-appearance-spinbutton-disabled-readonly.html + + * platform/chromium/PlatformThemeChromiumGtk.cpp: + (WebCore::PlatformThemeChromiumGtk::paintArrowButton): + If the button has ReadOnlyState, paint the button as same as it is disabled. + +2010-07-28 Tony Chang <tony@chromium.org> + + Reviewed by Ojan Vafai. + + implement getData('text/html') for webkit win + https://bugs.webkit.org/show_bug.cgi?id=37981 + + * platform/win/ClipboardUtilitiesWin.cpp: + (WebCore::extractMarkupFromCFHTML): + (WebCore::getCFHTML): + (WebCore::fragmentFromCFHTML): + (WebCore::fragmentFromHTML): + * platform/win/ClipboardUtilitiesWin.h: + * platform/win/ClipboardWin.cpp: + (WebCore::): + (WebCore::clipboardTypeFromMIMEType): + (WebCore::ClipboardWin::getData): + +2010-07-28 Adam Barth <abarth@webkit.org> + + Reviewed by Eric Seidel. + + Update numbered header element closing to match recent spec change + https://bugs.webkit.org/show_bug.cgi?id=43072 + + Pretty straightforward transcription of the spec change. + + * html/HTMLElementStack.cpp: + (WebCore::HTMLNames::isNumberedHeaderElement): + (WebCore::HTMLElementStack::popUntilNumberedHeaderElementPopped): + (WebCore::HTMLElementStack::hasOnlyHTMLElementsInScope): + (WebCore::HTMLElementStack::hasNumberedHeaderElementInScope): + * html/HTMLElementStack.h: + * html/HTMLTreeBuilder.cpp: + (WebCore::HTMLTreeBuilder::HTMLTreeBuilder): + (WebCore::HTMLTreeBuilder::processEndTagForInBody): + +2010-07-28 Anders Carlsson <andersca@apple.com> + + Reviewed by Sam Weinig. + + Add support for calling NPObject methods + https://bugs.webkit.org/show_bug.cgi?id=43145 + + * WebCore.exp.in: + Export JSHTMLElement::s_info and pluginScriptObject. + + * WebCore.xcodeproj/project.pbxproj: + Make JSHTMLElement.h and JSPluginElementFunctions.h private headers. + + * bindings/js/JSPluginElementFunctions.cpp: + (WebCore::pluginScriptObject): + * bindings/js/JSPluginElementFunctions.h: + Make pluginScriptObject a public function. + +2010-07-28 James Robinson <jamesr@chromium.org> + + Reviewed by Darin Fisher. + + [chromium] Add a bool to Settings to control accelerated 2d canvas + https://bugs.webkit.org/show_bug.cgi?id=43094 + + Currently this doesn't control anything, but it will soon. + + * page/Settings.cpp: + (WebCore::Settings::Settings): + (WebCore::Settings::setAccelerated2dCanvasEnabled): + * page/Settings.h: + (WebCore::Settings::accelerated2dCanvasEnabled): + +2010-07-28 Robin Dunn <robin@alldunn.com> + + Reviewed by Kevin Ollivier. + + Add DOM bindings support for wx port. + + * DerivedSources.make: + * bindings/scripts/CodeGeneratorCPP.pm: + * platform/graphics/wx/FontPlatformDataWx.cpp: + (WebCore::FontPlatformData::FontPlatformData): + * platform/wx/MouseEventWx.cpp: + (WebCore::PlatformMouseEvent::PlatformMouseEvent): + * wscript: + +2010-07-28 Stephen White <senorblanco@chromium.org> + + Reviewed by Darin Fisher. + + Hook the GLES2 rendering path up to GraphicsContextSkia. + https://bugs.webkit.org/show_bug.cgi?id=43119 + + This connects the state-setting and drawing calls implemented in + so far in GLES2Canvas, and calls PlatformContextSkia's + prepareForSoftwareDraw() for all the non-accelerated paths. + + * platform/graphics/skia/GraphicsContextSkia.cpp: + (WebCore::GraphicsContext::addInnerRoundedRectClip): + (WebCore::GraphicsContext::addPath): + (WebCore::GraphicsContext::beginPath): + (WebCore::GraphicsContext::clip): + (WebCore::GraphicsContext::drawConvexPolygon): + (WebCore::GraphicsContext::drawEllipse): + (WebCore::GraphicsContext::drawFocusRing): + (WebCore::GraphicsContext::drawLine): + (WebCore::GraphicsContext::drawLineForMisspellingOrBadGrammar): + (WebCore::GraphicsContext::drawLineForText): + (WebCore::GraphicsContext::drawRect): + (WebCore::GraphicsContext::fillPath): + (WebCore::GraphicsContext::fillRoundedRect): + (WebCore::GraphicsContext::strokeArc): + (WebCore::GraphicsContext::strokePath): + (WebCore::GraphicsContext::strokeRect): + These calls are software-only; call preSoftwareDraw() for these. + (WebCore::GraphicsContext::savePlatformState): + (WebCore::GraphicsContext::restorePlatformState): + (WebCore::GraphicsContext::setAlpha): + (WebCore::GraphicsContext::setCompositeOperation): + (WebCore::GraphicsContext::setPlatformFillColor): + (WebCore::GraphicsContext::scale): + (WebCore::GraphicsContext::rotate): + (WebCore::GraphicsContext::translate): + (WebCore::GraphicsContext::concatCTM): + These ones set state on both Skia and GLES2Canvas. + (WebCore::GraphicsContext::clearRect): + (WebCore::GraphicsContext::fillRect): + These ones have a GLES2 implementation; call through to it if PlatformContextSkia's useGPU() flag is set and the state permits. + * platform/graphics/skia/PlatformContextSkia.cpp: + (PlatformContextSkia::prepareForSoftwareDraw): + (PlatformContextSkia::prepareForHardwareDraw): + Rename preXXXDraw() -> prepareForXXXDraw(). + * platform/graphics/skia/PlatformContextSkia.h: + (PlatformContextSkia::prepareForSoftwareDraw): + (PlatformContextSkia::prepareForHardwareDraw): + Rename preXXXDraw() -> prepareForXXXDraw(). + +2010-07-28 fsamuel@chromium.org <fsamuel@chromium.org> + + Reviewed by David Hyatt. + + REGRESSION (r63994): Bank of America's home page is horribly mis-rendered + https://bugs.webkit.org/show_bug.cgi?id=42993 + + Fixed bug introduced by patch for bug 40775. + + The new table rendering code did not take into account table layouts starting + during a partial construction of the table render tree. As such, + multiple layouts on the same table resulted in more columns being generated. + This patch solves this issue. + + * rendering/AutoTableLayout.cpp: + (WebCore::AutoTableLayout::recalcColumn): + * rendering/RenderTable.cpp: + (WebCore::RenderTable::cellAbove): + (WebCore::RenderTable::cellBelow): + (WebCore::RenderTable::cellBefore): + * rendering/RenderTableSection.cpp: + (WebCore::RenderTableSection::ensureRows): + (WebCore::RenderTableSection::addCell): + (WebCore::RenderTableSection::setCellWidths): + (WebCore::RenderTableSection::calcRowHeight): + (WebCore::RenderTableSection::layoutRows): + (WebCore::RenderTableSection::paintObject): + (WebCore::RenderTableSection::appendColumn): + (WebCore::RenderTableSection::splitColumn): + * rendering/RenderTableSection.h: + (WebCore::RenderTableSection::CellStruct::CellStruct): + +2010-07-28 Tony Gentilcore <tonyg@chromium.org> + + Reviewed by Pavel Feldman. + + Exclude DNS and SSL time from connect time + https://bugs.webkit.org/show_bug.cgi?id=43083 + + The ResourceLoadTiming API's definition of the connect phase includes + DNS and SSL time. However, the Web Timing spec wants just the TCP time. + So this patch subtracts those phases out. + + No new tests because ResourceLoadTiming fields are not populated by + TestShell yet. + + * page/Timing.cpp: + (WebCore::Timing::connectStart): + (WebCore::Timing::connectEnd): + +2010-07-26 Steve Block <steveblock@google.com> + + Reviewed by Jeremy Orlow. + + Page clients should be passed to Page constructor via structure of pointers + https://bugs.webkit.org/show_bug.cgi?id=42834 + + No new tests, refactoring only. + + * WebCore.exp.in: + * page/Page.cpp: + (WebCore::Page::Page): + * page/Page.h: + (WebCore::Page::PageClients::PageClients): + * svg/graphics/SVGImage.cpp: + (WebCore::SVGImage::dataChanged): + +2010-07-28 Xianzhu Wang <phnixwxz@gmail.com> + + Reviewed by Dan Bernstein. + + Line not wrapped at certain punctuations + https://bugs.webkit.org/show_bug.cgi?id=37698 + Added a line breaking table for all printable ASCII chars to replace + the original line breaking table for only '?'. + + Test: fast/text/line-breaks-after-closing-punctuations.html + + * rendering/break_lines.cpp: + (WebCore::isBreakableSpace): + (WebCore::): + (WebCore::shouldBreakAfter): + (WebCore::needsLineBreakIterator): + +2010-07-28 Lucas De Marchi <lucas.demarchi@profusion.mobi> + + Unreviewed build fix. + + Fix EFL build with SHARED_CORE=ON after r64124. + + * CMakeLists.txt: + +2010-07-28 Jay Civelli <jcivelli@chromium.org> + + Reviewed by Kent Tamura. + + [Chromium] The popup now layouts properly its rows by + taking into account the label width. + https://bugs.webkit.org/show_bug.cgi?id=42910 + + * platform/chromium/PopupMenuChromium.cpp: + (WebCore::PopupListBox::layout): + +2010-07-28 Pavel Feldman <pfeldman@chromium.org> + + Not reviewed: chromium tests fix. + Chromium Dev Tools: [REGRESSION] Pause is not working. + + https://bugs.webkit.org/show_bug.cgi?id=43118 + + * inspector/front-end/InspectorBackendStub.js: + +2010-07-28 Ilya Tikhonovsky <loislo@chromium.org> + + Reviewed by Pavel Feldman. + + WebInspector: Navigating to anchor prior to opening WebInspector + makes resource have 'other' type. + https://bugs.webkit.org/show_bug.cgi?id=43110 + + * inspector/InspectorResource.cpp: + (WebCore::InspectorResource::type): + (WebCore::InspectorResource::resourceData): + * inspector/front-end/ResourceView.js: + (WebInspector.ResourceView.prototype._innerSelectContentTab): + +2010-07-28 Andreas Kling <andreas.kling@nokia.com> + + Reviewed by Kenneth Rohde Christiansen. + + [Qt] putImageData(): Combine premultiplication and BGR->RGB + https://bugs.webkit.org/show_bug.cgi?id=43114 + + Further optimized putImageData() by doing BGR->RGB inside the + premultiplication routine. + + * platform/graphics/qt/ImageBufferQt.cpp: + (WebCore::premultiplyABGRtoARGB): Renamed from premultiply. + (WebCore::putImageData): + +2010-07-28 Andrei Popescu <andreip@google.com> + + Reviewed by Jeremy Orlow. + + [IndexedDB] IDBKeyRange should be a runtime-enabled feature. + https://bugs.webkit.org/show_bug.cgi?id=43116 + + IDBKeyRange should be enabled at runtime only when IndexedDB is also + enabled. + + No new tests needed, functionality not changed. + + * bindings/generic/RuntimeEnabledFeatures.h: + (WebCore::RuntimeEnabledFeatures::iDBKeyRangeEnabled): + * page/DOMWindow.idl: + +2010-07-28 Nikolas Zimmermann <nzimmermann@rim.com> + + Not reviewed. Forgot to land GNUmakefile.am changes, broke build in r64196. + + * GNUmakefile.am: Add SVGResources.* / SVGResourcesCache.* / SVGResourcesCycleSolver.* to build. + +2010-07-28 Nikolas Zimmermann <nzimmermann@rim.com> + + Reviewed by Dirk Schulze. + + SVGMaskElement/SVGForeignObjectElement should not inherit from SVGURIReference + https://bugs.webkit.org/show_bug.cgi?id=43113 + + Remove wrong SVGURIReference inheritance for SVGMaskElement/SVGForeignObjectElement. Old copy/paste bug. + + * svg/SVGForeignObjectElement.cpp: + (WebCore::SVGForeignObjectElement::synchronizeProperty): + * svg/SVGForeignObjectElement.h: + * svg/SVGMaskElement.cpp: + (WebCore::SVGMaskElement::SVGMaskElement): + (WebCore::SVGMaskElement::parseMappedAttribute): + (WebCore::SVGMaskElement::svgAttributeChanged): + (WebCore::SVGMaskElement::synchronizeProperty): + * svg/SVGMaskElement.h: + +2010-07-28 Nikolas Zimmermann <nzimmermann@rim.com> + + Reviewed by Dirk Schulze. + + WebKit shouldn't ignore resource cycles, but break them as Opera does + https://bugs.webkit.org/show_bug.cgi?id=43031 + + Don't ignore resources containing cyclic references, but break them, as discussed on SVG WG mailing lists - to be compatible with Opera which already does that. + + We used to lookup RenderSVGResourceContainers objects, by extracting the URI reference from the SVGRenderStyle, then utilizing getElementById() to lookup the + node, and access its renderer. Opera ignores such references, if they point to resources that contain cyclic references. Ignoring them would mean we have + to mutate the render style to empty the resource strings. That obviously doesn't work, as it would break expectations (getComputedStyle, etc.). + + Introduce a SVGResources class that stores pointers to all resources, that can be applied to a RenderObject (clipper/filter/markers/masker). + Add a SVGResourcesCache class, which is basically a HashMap<RenderObject*, SVGResources*>. Whenever a RenderObject receives style, we extract the URI references + from the SVGRenderStyle, look up the RenderSVGResourceContainer* objects, and store them in a SVGResources* class. Then we execute a cycle detection logic, + which detects cyclic references and breaks them. Breaking them means just nulling the pointer to the resource in the SVGResources object. Those SVGResources + objects are cached, and used throughout the render tree to access resources. This way it's guaranteed that all cyclic references are resolved until layout/paint + phase begins. + + This is the first chunk, which just adds the new SVGResources/SVGResourcesCache/SVGResourcesCycleSolver files, and does minor cleanups. + It's not yet glued in and doesn't affect any tests. + + * Android.mk: Add SVGResources.* / SVGResourcesCache.* / SVGResourcesCycleSolver.* to build. + * CMakeLists.txt: Ditto. + * WebCore.gypi: Ditto. + * WebCore.pro: Ditto. + * WebCore.vcproj/WebCore.vcproj: Ditto. + * WebCore.xcodeproj/project.pbxproj: Ditto. + * rendering/RenderInline.h: Make styleDidChange protected, RenderSVGInline wants to override it. + * rendering/RenderSVGAllInOne.cpp: Add SVGResources.* / SVGResourcesCache.* / SVGResourcesCycleSolver.* to build. + * rendering/RenderSVGHiddenContainer.h: + (WebCore::RenderSVGHiddenContainer::isSVGHiddenContainer): Make isSVGHiddenContainer() private and renderName() public. + * rendering/RenderSVGResourceContainer.cpp: Added. Moved most methods from the header in the implementation file. + (WebCore::RenderSVGResourceContainer::RenderSVGResourceContainer): + (WebCore::RenderSVGResourceContainer::~RenderSVGResourceContainer): + (WebCore::RenderSVGResourceContainer::idChanged): + (WebCore::RenderSVGResourceContainer::transformOnNonScalingStroke): + (WebCore::RenderSVGResourceContainer::containsCyclicReference): + * rendering/RenderSVGResourceContainer.h: Add stubs, that SVGResourcesCache uses - a follow-up patch will add the logic. + (WebCore::RenderSVGResourceContainer::addClient): + (WebCore::RenderSVGResourceContainer::removeClient): + * rendering/SVGResources.cpp: Added. Holds a list of resources applyable to a RenderObject (fill/stroke, mask/markers/clipper/filter) + (WebCore::paintingResourceFromSVGPaint): Helper function looking up a RenderSVGResource for a SVGPaint object. + (WebCore::registerPendingResource): Helper function that register a RenderSVGResource as pending in the SVGDocumentExtensions. + (WebCore::SVGResources::buildCachedResources): Build a list of resources for a RenderObject/RenderStyle pair, handles pending resources, if needed. + (WebCore::SVGResources::invalidateClient): Helper function that calls invalidateClient() on all resources. + (WebCore::SVGResources::resourceDestroyed): Helper function that calls invalidateClients() on a certain resource, and nulls it. + (WebCore::SVGResources::buildSetOfResources): Helper function that stashes all resources present in the SVGResources members in a HashSet, used in SVGResourcesCycleSolver. + (WebCore::SVGResources::resetClipper): Helper methods nulling a resource. + (WebCore::SVGResources::resetFilter): Ditto. + (WebCore::SVGResources::resetMarkerStart): Ditto. + (WebCore::SVGResources::resetMarkerMid): Ditto. + (WebCore::SVGResources::resetMarkerEnd): Ditto. + (WebCore::SVGResources::resetMasker): Ditto. + (WebCore::SVGResources::resetFill): Ditto. + (WebCore::SVGResources::resetStroke): Ditto. + (WebCore::SVGResources::dump): + * rendering/SVGResources.h: Added. + (WebCore::SVGResources::clipper): Accesor of the cached m_foo variable. + (WebCore::SVGResources::filter): Ditto. + (WebCore::SVGResources::markerStart): Ditto. + (WebCore::SVGResources::markerMid): Ditto. + (WebCore::SVGResources::markerEnd): Ditto. + (WebCore::SVGResources::masker): Ditto. + (WebCore::SVGResources::fill): Ditto. + (WebCore::SVGResources::stroke): Ditto. + * rendering/SVGResourcesCache.cpp: Added. Holds a HashMap<RenderObject*, SVGResources*> and utility functions that update/invalidate the cache. + (WebCore::SVGResourcesCache::SVGResourcesCache): + (WebCore::SVGResourcesCache::~SVGResourcesCache): + (WebCore::SVGResourcesCache::addResourcesFromRenderObject): Build a SVGResources object for a RenderObject and adds it to the cache, then detects & breaks cycles using SVGResourcesCycleSolver. + (WebCore::SVGResourcesCache::removeResourcesFromRenderObject): Remove a SVGResources object from the cache. + (WebCore::resourcesCacheFromRenderObject): Helper function, retrieving a SVGResourcesCache method from a RenderObject. + (WebCore::SVGResourcesCache::cachedResourcesForRenderObject): Returns a SVGResources object from the cache. + (WebCore::SVGResourcesCache::clientLayoutChanged): (static) Calls invalidateClient() on all resources that are used by the passed RenderObject. + (WebCore::SVGResourcesCache::clientStyleChanged): (static) Updates the cache (calling removeResourceFromRenderObject/addResourcesFrom...) and invalidates resources in the ancestor chain. + (WebCore::SVGResourcesCache::clientUpdatedFromElement): (static) Does the same, without invalidating the ancestor chain. + (WebCore::SVGResourcesCache::clientDestroyed): (static) Calls removeResourcesFromRenderObject() on the SVGResourcesCache, for the given renderer. + (WebCore::SVGResourcesCache::resourceDestroyed): (static) Updates all SVGResources objects in the cache, that refer to the given resource. + * rendering/SVGResourcesCache.h: Added. + * rendering/SVGResourcesCycleSolver.cpp: Added. Detects and breaks cyclic references, just the way Opera handles it. Break cycles as they are detected. + (WebCore::SVGResourcesCycleSolver::SVGResourcesCycleSolver): + (WebCore::SVGResourcesCycleSolver::~SVGResourcesCycleSolver): + (WebCore::SVGResourcesCycleSolver::resourceContainsCycles): Operates only on the render tree + (WebCore::targetReferenceFromResource): Helper method for chainableResourceContainsCycles(). + (WebCore::setFollowLinkForChainableResource): Ditto. + (WebCore::SVGResourcesCycleSolver::chainableResourceContainsCycles): Handles cycles for resources that are chainable through xlink:href (filter/gradient/pattern). + (WebCore::SVGResourcesCycleSolver::resolveCycles): Main method executing the cycle breaking logic, utilizing (chainableResource)resourceContainsCycles. + (WebCore::SVGResourcesCycleSolver::breakCycle): Nulls a resource in the given SVGResources* object, to avoid using an invalid resource while rendering/layouting. + * rendering/SVGResourcesCycleSolver.h: Added. + * svg/SVGDocumentExtensions.cpp: + (WebCore::SVGDocumentExtensions::SVGDocumentExtensions): Create SVGResourcesCache object once per SVGDocumentExtensions. + * svg/SVGDocumentExtensions.h: + (WebCore::SVGDocumentExtensions::resourcesCache): Expose accesor method for the SVGResourcesCache. + +2010-07-28 Zoltan Herczeg <zherczeg@webkit.org> + + Reviewed by Nikolas Zimmermann. + + SVGFilterElement & SVGFE*Element don't support dynamic invalidation, when attributes change + https://bugs.webkit.org/show_bug.cgi?id=42244 + + Implementing svgAttributeChanged for SVGFEOffsetElement object. + + Tests: svg/dynamic-updates/SVGFEOffsetElement-dom-dx-attr.html + svg/dynamic-updates/SVGFEOffsetElement-dom-dy-attr.html + svg/dynamic-updates/SVGFEOffsetElement-dom-in-attr.html + svg/dynamic-updates/SVGFEOffsetElement-svgdom-dx-prop.html + svg/dynamic-updates/SVGFEOffsetElement-svgdom-dy-prop.html + svg/dynamic-updates/SVGFEOffsetElement-svgdom-in-prop.html + + * svg/SVGFEOffsetElement.cpp: + (WebCore::SVGFEOffsetElement::svgAttributeChanged): + * svg/SVGFEOffsetElement.h: + +2010-07-28 Zoltan Herczeg <zherczeg@webkit.org> + + Reviewed by Nikolas Zimmermann. + + SVGFilterElement & SVGFE*Element don't support dynamic invalidation, when attributes change + https://bugs.webkit.org/show_bug.cgi?id=42244 + + Implementing svgAttributeChanged for SVGFEDiffuseLightingElement object. + + Tests: svg/dynamic-updates/SVGFEDiffuseLightingElement-dom-diffuseConstant-attr.html + svg/dynamic-updates/SVGFEDiffuseLightingElement-dom-in-attr.html + svg/dynamic-updates/SVGFEDiffuseLightingElement-dom-lighting-color-attr.html + svg/dynamic-updates/SVGFEDiffuseLightingElement-dom-surfaceScale-attr.html + svg/dynamic-updates/SVGFEDiffuseLightingElement-lighting-color-css-prop.html + svg/dynamic-updates/SVGFEDiffuseLightingElement-svgdom-diffuseConstant-prop.html + svg/dynamic-updates/SVGFEDiffuseLightingElement-svgdom-in-prop.html + svg/dynamic-updates/SVGFEDiffuseLightingElement-svgdom-surfaceScale-prop.html + + * svg/SVGFEDiffuseLightingElement.cpp: + (WebCore::SVGFEDiffuseLightingElement::svgAttributeChanged): + * svg/SVGFEDiffuseLightingElement.h: + +2010-07-27 Kinuko Yasuda <kinuko@chromium.org> + + Reviewed by Ojan Vafai. + + Add FILE_SYSTEM build flag for FileSystem API + https://bugs.webkit.org/show_bug.cgi?id=42915 + + * Configurations/FeatureDefines.xcconfig: + * GNUmakefile.am: + * WebCore.pri: + +2010-07-26 Yuzo Fujishima <yuzo@google.com> + + Reviewed by Shinichiro Hamaji. + + @page rules in media queries should be tested. + https://bugs.webkit.org/show_bug.cgi?id=42971 + + * page/PrintContext.cpp: + (WebCore::PrintContext::pageProperty): Fixed to properly begin + printing. Added support for size property. + +2010-07-27 James Hawkins <jhawkins@chromium.org> + + Reviewed by Darin Fisher. + + Add itemIcon() method to the PopupMenuClient, used by Chrome AutoFill + to display right-aligned credit card icons in the suggestions popup. + https://bugs.webkit.org/show_bug.cgi?id=43076 + + No new tests as this is only used by the Chromium WebKit API. + + * platform/PopupMenuClient.h: + * platform/chromium/PopupMenuChromium.cpp: + (WebCore::PopupListBox::paintRow): + * rendering/RenderMenuList.cpp: + (WebCore::RenderMenuList::itemIcon): + * rendering/RenderMenuList.h: + * rendering/RenderTextControlSingleLine.cpp: + (WebCore::RenderTextControlSingleLine::itemIcon): + * rendering/RenderTextControlSingleLine.h: + +2010-07-27 Andreas Kling <andreas.kling@nokia.com> + + Reviewed by Kenneth Rohde Christiansen. + + [Qt] putImageData(): Fast premultiply() if alpha == 255 + + * platform/graphics/qt/ImageBufferQt.cpp: + (WebCore::premultiply): Do nothing for opaque pixels. + +2010-07-27 Jian Li <jianli@chromium.org> + + Reviewed by David Levin. + + Enhance FileThreadTask to support return type. + https://bugs.webkit.org/show_bug.cgi?id=43078 + + This is needed to support synchronous calls of FileStream methods in + addition to asynchronous calls via FileThreadTask. + + * html/FileThreadTask.h: + (WebCore::createFileThreadTask): + +2010-07-27 James Robinson <jamesr@chromium.org> + + Reviewed by Darin Fisher. + + [chromium] Let PlatformContextSkia draw to a GLES2Canvas in addition to an SkCanvas + https://bugs.webkit.org/show_bug.cgi?id=43070 + + This adds a GLES2Canvas as drawing surface to PlatformContextSkia and lets callers + issue draw commands to either. The PlatformContextSkia keeps track of where + rendering results are being accumulated and can blend the hardware and software + backing stores into each other when necessary. + + Still just plumbing, no functionality change. + + * platform/graphics/chromium/GLES2Canvas.cpp: + (WebCore::GLES2Canvas::GLES2Canvas): + * platform/graphics/chromium/GLES2Canvas.h: + * platform/graphics/skia/PlatformContextSkia.cpp: + (PlatformContextSkia::PlatformContextSkia): + (PlatformContextSkia::setGLES2Context): + (PlatformContextSkia::preSoftwareDraw): + (PlatformContextSkia::preHardwareDraw): + (PlatformContextSkia::forceToSoftware): + (PlatformContextSkia::uploadSoftwareToHardware): + (PlatformContextSkia::readbackHardwareToSoftware): + * platform/graphics/skia/PlatformContextSkia.h: + (PlatformContextSkia::useGPU): + (PlatformContextSkia::gpuCanvas): + (PlatformContextSkia::preSoftwareDraw): + (PlatformContextSkia::preHardwareDraw): + (PlatformContextSkia::forceToSoftware): + (PlatformContextSkia::): + +2010-07-27 Simon Fraser <simon.fraser@apple.com> + + Reviewed by Darin Adler. + + Incomplete repaint of some Safari extension content which falls into a composited iframe + <rdar://problem/8235044> + + syncCompositingStateRecursive() bails if it thinks that a layout is pending, because + the layout may update layers and make this sync obsolete. However, it only checked for an + active layout timer. This ignores other sources of pending style changes and layouts, like + the document's style recalc timer. So use needsLayout(), which does check this. + + Unable to create a test because it depends on Safari extension behavior. + + * page/FrameView.cpp: + (WebCore::FrameView::syncCompositingStateRecursive): + +2010-07-27 Andreas Kling <andreas.kling@nokia.com> + + Reviewed by Kenneth Rohde Christiansen. + + [Qt] putImageData() optimizations + https://bugs.webkit.org/show_bug.cgi?id=43059 + + - Single-pass premultiplication and BGR->RGB conversion + - Use ARGB32PM for the temporary image so Qt calls the + fast Source composition function + + * platform/graphics/qt/ImageBufferQt.cpp: + (WebCore::premultiply): Added (static inline) + (WebCore::putImageData): + +2010-07-27 Anders Carlsson <andersca@apple.com> + + Reviewed by Sam Weinig. + + Expose interface for returning the plug-in script JSObject + https://bugs.webkit.org/show_bug.cgi?id=43074 + + PluginViewBase::scriptObject should be a virtual function. + + * plugins/PluginViewBase.h: + (WebCore::PluginViewBase::scriptObject): + +2010-07-27 Jian Li <jianli@chromium.org> + + Reviewed by David Levin. + + Add ScriptExecutionContext argument to File/Blob constructors. + https://bugs.webkit.org/show_bug.cgi?id=40587 + + Remove DragData::createClipboard and add Clipboard::create for it to be + called directly in DragController. This is because we need to pass + Frame pointer to Clipboard class and use it to get ScriptExecutionContext + in order to construct File objects in Clipboard::files(). + + * bindings/js/SerializedScriptValue.cpp: + (WebCore::DeserializingTreeWalker::convertIfTerminal): + * bindings/v8/SerializedScriptValue.cpp: + (WebCore::ZigZag::Reader::readBlob): + (WebCore::ZigZag::Reader::readFile): + (WebCore::ZigZag::Reader::readFileList): + * dom/Clipboard.h: + * editing/Editor.cpp: + (WebCore::Editor::dispatchCPPEvent): + * editing/Editor.h: + * editing/android/EditorAndroid.cpp: + (WebCore::Editor::newGeneralClipboard): + * editing/brew/EditorBrew.cpp: + (WebCore::Editor::newGeneralClipboard): + * editing/chromium/EditorChromium.cpp: + (WebCore::Editor::newGeneralClipboard): + * editing/haiku/EditorHaiku.cpp: + (WebCore::Editor::newGeneralClipboard): + * editing/mac/EditorMac.mm: + (WebCore::Editor::newGeneralClipboard): + * editing/qt/EditorQt.cpp: + (WebCore::Editor::newGeneralClipboard): + * editing/wx/EditorWx.cpp: + (WebCore::Editor::newGeneralClipboard): + * html/Blob.cpp: + (WebCore::Blob::Blob): + (WebCore::Blob::slice): + * html/Blob.h: + (WebCore::Blob::create): + * html/Blob.idl: + * html/BlobBuilder.cpp: + (WebCore::BlobBuilder::getBlob): + * html/BlobBuilder.h: + * html/BlobBuilder.idl: + * html/File.cpp: + (WebCore::File::File): + * html/File.h: + (WebCore::File::create): + * html/HTMLInputElement.cpp: + (WebCore::HTMLInputElement::appendFormData): + (WebCore::HTMLInputElement::setFileListFromRenderer): + * page/DragController.cpp: + (WebCore::DragController::dragExited): + (WebCore::DragController::performDrag): + (WebCore::DragController::tryDHTMLDrag): + * page/chromium/EventHandlerChromium.cpp: + (WebCore::EventHandler::createDraggingClipboard): + * page/gtk/EventHandlerGtk.cpp: + (WebCore::EventHandler::createDraggingClipboard): + * page/win/EventHandlerWin.cpp: + (WebCore::EventHandler::createDraggingClipboard): + * platform/DragData.h: + * platform/android/ClipboardAndroid.cpp: + (WebCore::Clipboard::create): + * platform/android/DragDataAndroid.cpp: + * platform/brew/ClipboardBrew.cpp: + (WebCore::Clipboard::create): + * platform/brew/DragDataBrew.cpp: + * platform/chromium/ClipboardChromium.cpp: + (WebCore::Clipboard::create): + (WebCore::ClipboardChromium::ClipboardChromium): + (WebCore::ClipboardChromium::create): + (WebCore::ClipboardChromium::files): + * platform/chromium/ClipboardChromium.h: + * platform/chromium/DragDataChromium.cpp: + * platform/efl/ClipboardEfl.cpp: + (WebCore::Editor::newGeneralClipboard): + (WebCore::Clipboard::create): + * platform/efl/DragDataEfl.cpp: + * platform/gtk/ClipboardGtk.cpp: + (WebCore::Editor::newGeneralClipboard): + (WebCore::Clipboard::create): + (WebCore::ClipboardGtk::ClipboardGtk): + (WebCore::ClipboardGtk::files): + * platform/gtk/ClipboardGtk.h: + (WebCore::ClipboardGtk::create): + * platform/gtk/DragDataGtk.cpp: + * platform/haiku/ClipboardHaiku.cpp: + (WebCore::Clipboard::create): + * platform/haiku/DragDataHaiku.cpp: + * platform/mac/ClipboardMac.mm: + (WebCore::Clipboard::create): + (WebCore::ClipboardMac::files): + * platform/mac/DragDataMac.mm: + * platform/qt/ClipboardQt.cpp: + (WebCore::Clipboard::create): + * platform/qt/DragDataQt.cpp: + * platform/win/ClipboardWin.cpp: + (WebCore::Clipboard::create): + (WebCore::ClipboardWin::ClipboardWin): + (WebCore::ClipboardWin::files): + * platform/win/ClipboardWin.h: + (WebCore::ClipboardWin::create): + * platform/win/DragDataWin.cpp: + * platform/win/EditorWin.cpp: + (WebCore::Editor::newGeneralClipboard): + * platform/wince/DragDataWince.cpp: + * platform/wince/EditorWince.cpp: + (WebCore::Editor::newGeneralClipboard): + * platform/wx/ClipboardWx.cpp: + (WebCore::Clipboard::create): + * platform/wx/DragDataWx.cpp: + +2010-07-27 Dumitru Daniliuc <dumi@chromium.org> + + Reviewed by David Levin. + + Move all WebSQLDatabases-specific code behind #if ENABLE(DATABASE). + https://bugs.webkit.org/show_bug.cgi?id=43035 + + Make Chromium compile with ENABLE_DATABASE=0. The #ifdefs in + DatabaseAuthorizer and ChromiumBridge are removed, because they're + used by non-HTML5 DBs too (the classes in WebCore/platform/sql/), + which are used by other features too. So they need to be compiled + in even if HTML5 DBs are disabled. + + * bindings/v8/custom/V8DOMWindowCustom.cpp: + * page/DOMWindow.idl: + * platform/chromium/ChromiumBridge.h: + * storage/DatabaseAuthorizer.cpp: + * storage/chromium/DatabaseObserver.h: + * storage/chromium/DatabaseTrackerChromium.cpp: + * storage/chromium/QuotaTracker.cpp: + * storage/chromium/QuotaTracker.h: + * storage/chromium/SQLTransactionClientChromium.cpp: + +2010-07-27 Chris Fleizach <cfleizach@apple.com> + + Reviewed by David Kilzer. + + AX: Misspellings not shown in AXAttributedStringForTextMarkerRange when selection is on word + https://bugs.webkit.org/show_bug.cgi?id=41817 + + Change how misspelled words are identified for accessibility. No longer rely on the + cached markers in Document. Calculate on the fly, which is more accurate in a variety of + circumstances (like when selection has not moved across words, of if the cursor is in the middle + of a misspelled word). + + Test: platform/mac/accessibility/attributed-string-includes-misspelled-with-selection.html + + * accessibility/mac/AccessibilityObjectWrapper.mm: + (AXAttributeStringSetSpelling): + (AXAttributedStringAppendText): + (-[AccessibilityObjectWrapper doAXAttributedStringForTextMarkerRange:]): + +2010-07-27 Gavin Barraclough <barraclough@apple.com> + + Reviewed by Oliver Hunt. + + Bug 42621 - Add a bump allocator for the YARR interpreter + + The regex engine requires lifo allocation, however currently uses the general purpose + malloc/free memory allocation. A simple bump pointer allocator should provide a lower + overhead allocation solution. + + * ForwardingHeaders/wtf/BumpPointerAllocator.h: Added. + +2010-07-27 Pavel Feldman <pfeldman@chromium.org> + + Reviewed by Joseph Pecoraro. + + Web Inspector: render network timing as gant chart in popover. + + https://bugs.webkit.org/show_bug.cgi?id=43051 + + * inspector/InspectorResource.cpp: + (WebCore::InspectorResource::buildObjectForTiming): + * inspector/front-end/ResourcesPanel.js: + (WebInspector.ResourcesPanel.prototype._showPopover): + * inspector/front-end/inspector.css: + (.resource-timing-row): + (.resource-timing-bar): + (.resource-timing-bar-title): + * inspector/front-end/utilities.js: + +2010-07-27 Victor Wang <victorw@chromium.org> + + Unreviewed, rolling out r64104. + http://trac.webkit.org/changeset/64104 + https://bugs.webkit.org/show_bug.cgi?id=40768 + + The patch causes chromium webkit socket laytest crashes on + windows randomly + + * inspector/InspectorController.cpp: + (WebCore::InspectorController::addResource): + (WebCore::InspectorController::removeResource): + * inspector/InspectorController.h: + * inspector/InspectorResource.cpp: + (WebCore::InspectorResource::InspectorResource): + (WebCore::InspectorResource::updateScriptObject): + (WebCore::InspectorResource::cachedResource): + (WebCore::InspectorResource::type): + (WebCore::InspectorResource::resourceData): + * inspector/InspectorResource.h: + (WebCore::InspectorResource::): + (WebCore::InspectorResource::create): + * inspector/front-end/Resource.js: + (WebInspector.Resource.Type.toString): + (WebInspector.Resource.prototype.set type): + (WebInspector.Resource.prototype._mimeTypeIsConsistentWithType): + * inspector/front-end/ResourceView.js: + (WebInspector.ResourceView.prototype._refreshRequestHeaders): + (WebInspector.ResourceView.prototype._refreshResponseHeaders): + (WebInspector.ResourceView.prototype._refreshHeaders): + * inspector/front-end/inspector.css: + (.resources-category-scripts, .resources-category-xhr, .resources-category-fonts, .resources-category-other): + * inspector/front-end/inspector.js: + (WebInspector.loaded): + (WebInspector.updateResource): + * websockets/WebSocketChannel.cpp: + (WebCore::WebSocketChannel::WebSocketChannel): + (WebCore::WebSocketChannel::disconnect): + (WebCore::WebSocketChannel::didOpen): + (WebCore::WebSocketChannel::didClose): + (WebCore::WebSocketChannel::processBuffer): + * websockets/WebSocketChannel.h: + +2010-07-27 Andrei Popescu <andreip@google.com> + + Reviewed by Jeremy Orlow. + + [IndexedDB] Key range methods belong to the IDBKeyRange interface + https://bugs.webkit.org/show_bug.cgi?id=43052 + + Move the key range methods from the IndexedDatabaseRequest interface + to the IDBKeyRange interface. Also add a global IDBKeyRange object + that can be used to access the IDBKeyRange constants and factory methods. + + * page/DOMWindow.cpp: + (WebCore::DOMWindow::clear): + (WebCore::DOMWindow::iDBKeyRange): + * page/DOMWindow.h: + * page/DOMWindow.idl: + * storage/IDBKeyRange.cpp: + (WebCore::IDBKeyRange::only): + (WebCore::IDBKeyRange::leftBound): + (WebCore::IDBKeyRange::rightBound): + (WebCore::IDBKeyRange::bound): + * storage/IDBKeyRange.h: + * storage/IDBKeyRange.idl: + * storage/IndexedDatabaseRequest.cpp: + * storage/IndexedDatabaseRequest.h: + * storage/IndexedDatabaseRequest.idl: + +2010-07-27 Chris Fleizach <cfleizach@apple.com> + + Reviewed by Darin Adler. + + AX: consolidate parentObjectIfExists() and parentObject() code + https://bugs.webkit.org/show_bug.cgi?id=42981 + + Consolidate duplicate code in parentObject and parentObjectIfExists + + No tests. No functionality changed. + + * accessibility/AccessibilityRenderObject.cpp: + (WebCore::AccessibilityRenderObject::renderParentObject): + (WebCore::AccessibilityRenderObject::parentObjectIfExists): + (WebCore::AccessibilityRenderObject::parentObject): + * accessibility/AccessibilityRenderObject.h: + +2010-07-27 Chris Fleizach <cfleizach@apple.com> + + Reviewed by Adam Barth. + + AX: replace m_renderer->document->axObjectCache() with just axObjectCache() + https://bugs.webkit.org/show_bug.cgi?id=42979 + + No new tests. Code cleanup only. + + * accessibility/AccessibilityRenderObject.cpp: + (WebCore::AccessibilityRenderObject::firstChild): + (WebCore::AccessibilityRenderObject::lastChild): + (WebCore::AccessibilityRenderObject::previousSibling): + (WebCore::AccessibilityRenderObject::nextSibling): + (WebCore::AccessibilityRenderObject::parentObjectIfExists): + (WebCore::AccessibilityRenderObject::parentObject): + (WebCore::AccessibilityRenderObject::menuForMenuButton): + (WebCore::AccessibilityRenderObject::menuButtonForMenu): + (WebCore::AccessibilityRenderObject::addRadioButtonGroupMembers): + (WebCore::AccessibilityRenderObject::axObjectCache): + (WebCore::AccessibilityRenderObject::contentChanged): + (WebCore::AccessibilityRenderObject::addChildren): + +2010-07-27 Pavel Podivilov <podivilov@chromium.org> + + Reviewed by Pavel Feldman. + + Web Inspector: do not activate all breakpoints on page reload + https://bugs.webkit.org/show_bug.cgi?id=41461 + + Test: inspector/debugger-breakpoints-not-activated-on-reload.html + + * inspector/front-end/ScriptView.js: + (WebInspector.ScriptView.prototype._addBreakpoint): + * inspector/front-end/ScriptsPanel.js: + (WebInspector.ScriptsPanel): + (WebInspector.ScriptsPanel.prototype._breakpointAdded): + (WebInspector.ScriptsPanel.prototype.toggleBreakpointsClicked): + * inspector/front-end/SourceView.js: + (WebInspector.SourceView.prototype._addBreakpoint): + +2010-07-27 Pranav Kedia <pranavk@chromium.org> + + Reviewed by Adam Barth. + + Chrome browser Bug: Pause button stays when <audio> hits end + https://bugs.webkit.org/show_bug.cgi?id=42677 + + The change is just in chromium media. Tested using media part of + WebKit layout tests. The following test that was failing is passing. + media/video-duration-known-after-eos.html -> unexpected pass + + * rendering/RenderMediaControlsChromium.cpp: + (WebCore::paintMediaPlayButton): + Using mediaElement->canPlay() instead of mediaElement->paused() to + paint the play/pause button. + +2010-07-27 Steve Block <steveblock@google.com> + + Reviewed by Jeremy Orlow. + + Client-based Geolocation does not pass enableHighAccuracy option to controller and client + https://bugs.webkit.org/show_bug.cgi?id=40374 + + This change passes the enableHighAccuracy request option to the GeolocationController. + The GeolocationController tracks whether this should be used by the client. + + No new tests possible as the mock provider doesn't support this feature. + + * page/Geolocation.cpp: + (WebCore::Geolocation::setIsAllowed): + (WebCore::Geolocation::startUpdating): + * page/GeolocationController.cpp: + (WebCore::GeolocationController::addObserver): + (WebCore::GeolocationController::removeObserver): + * page/GeolocationController.h: + * page/GeolocationControllerClient.h: + +2010-07-27 Ilya Tikhonovsky <loislo@chromium.org> + + Reviewed by Pavel Feldman. + + WebInspector: Current implementation of message based inspector + transport generated by CodeGeneratorInspector should be upstreamed + from WebKit/chromium to WebCore. + https://bugs.webkit.org/show_bug.cgi?id=42983 + + * Android.derived.v8bindings.mk: + * CMakeLists.txt: + * DerivedSources.cpp: + * DerivedSources.make: + * GNUmakefile.am: + * WebCore.exp.in: + * WebCore.gypi: + * WebCore.pri: + * WebCore.vcproj/WebCore.vcproj: + * WebCore.xcodeproj/project.pbxproj: + * bindings/js/ScriptObject.cpp: + * bindings/js/ScriptObject.h: + * bindings/v8/ScriptObject.cpp: + * bindings/v8/ScriptObject.h: + * inspector/CodeGeneratorInspector.pm: + * inspector/InspectorBackend.idl: Removed. + * inspector/InspectorFrontendClient.h: + * inspector/InspectorFrontendClientLocal.cpp: + (WebCore::InspectorFrontendClientLocal::windowObjectCleared): + (WebCore::InspectorFrontendClientLocal::sendMessageToBackend): + * inspector/InspectorFrontendClientLocal.h: + * inspector/InspectorFrontendHost.cpp: + (WebCore::InspectorFrontendHost::sendMessageToBackend): + * inspector/InspectorFrontendHost.h: + * inspector/InspectorFrontendHost.idl: + * inspector/front-end/InspectorBackendStub.js: + (.WebInspector.InspectorBackendStub): + (.WebInspector.InspectorBackendStub.prototype._registerDelegate): + (.WebInspector.InspectorBackendStub.prototype.sendMessageToBackend): + +2010-07-27 Satish Sampath <satish@chromium.org> + + Reviewed by Kent Tamura. + + Simplify speech input plumbing in webcore and webkit + https://bugs.webkit.org/show_bug.cgi?id=43008 + + No new tests as functionality is not changed. + + * GNUmakefile.am: Removed a header file. + * WebCore.gypi: + * WebCore.pro: + * WebCore.vcproj/WebCore.vcproj: + * WebCore.xcodeproj/project.pbxproj: + * page/Page.cpp: + (WebCore::Page::speechInput): Creates and returns SpeechInput when needed. + * page/Page.h: + * page/SpeechInput.cpp: Added methods to proxy and callbacks between input elements and WebKit + (WebCore::SpeechInput::SpeechInput): + (WebCore::SpeechInput::didCompleteRecording): + (WebCore::SpeechInput::didCompleteRecognition): + (WebCore::SpeechInput::setRecognitionResult): + (WebCore::SpeechInput::startRecognition): + (WebCore::SpeechInput::stopRecording): + * page/SpeechInput.h: + * page/SpeechInputClient.h: + * page/SpeechInputClientListener.h: Removed. + * page/SpeechInputListener.h: + * rendering/TextControlInnerElements.cpp: Added one more callback. + (WebCore::InputFieldSpeechButtonElement::defaultEventHandler): + (WebCore::InputFieldSpeechButtonElement::speechInput): + (WebCore::InputFieldSpeechButtonElement::didCompleteRecognition): + * rendering/TextControlInnerElements.h: + +2010-07-27 Kent Tamura <tkent@chromium.org> + + Reviewed by Ojan Vafai. + + Add a runtime setting for interactive form validation. + https://bugs.webkit.org/show_bug.cgi?id=40520 + + The interactive validation feature was disabled for non-strict + modes by r61059 to avoid a compatibility issue. This removes the + mode checking and introduce a runtime setting to enable/disable + the feature instead. + The default value is 'disable' and we'll remove the setting when + the compatibility issue is resolved and interactive validation + implementation is completed. + + * html/HTMLFormElement.cpp: + (WebCore::HTMLFormElement::validateInteractively): + * page/Settings.cpp: + (WebCore::Settings::Settings): + * page/Settings.h: + (WebCore::Settings::setInteractiveFormValidationEnabled): + (WebCore::Settings::interactiveFormValidationEnabled): + +2010-07-26 Gavin Barraclough <barraclough@apple.com> + + Reviewed by Oliver Hunt. + + Bug 43009 - Abstract out page allocation from executable allocators + + * ForwardingHeaders/wtf/PageAllocation.h: Added. + +2010-07-26 Yuta Kitamura <yutak@chromium.org> + + Reviewed by Pavel Feldman. + + Add WebSocket resource type to Web Inspector. + + When a new WebSocket connection is established, a line for that connection + will appear in Web Inspector's Resources tab. If the resource name is + clicked, the details of handshake request and response will be shown. + + Web Inspector: WebSocket in Resources tab + https://bugs.webkit.org/show_bug.cgi?id=40768 + + * inspector/InspectorController.cpp: + (WebCore::InspectorController::addResource): WebSocket resource does not + have an associated loader, thus frame might be null. Need to check it. + (WebCore::InspectorController::removeResource): Ditto. + (WebCore::InspectorController::didCreateWebSocket): + (WebCore::InspectorController::willSendWebSocketHandshakeRequest): + (WebCore::InspectorController::didReceiveWebSocketHandshakeResponse): + (WebCore::InspectorController::didCloseWebSocket): + * inspector/InspectorController.h: + * inspector/InspectorResource.cpp: Add null checks of m_loader and m_frame, + because WebSocket does not have a loader and we need to allow null for + these variables. + (WebCore::createReadableStringFromBinary): + (WebCore::InspectorResource::InspectorResource): + (WebCore::InspectorResource::create): Factory function of + regular (non-WebSocket) resources. + (WebCore::InspectorResource::createWebSocket): Factory function of + WebSocket resources. + (WebCore::InspectorResource::updateWebSocketRequest): + (WebCore::InspectorResource::updateWebSocketResponse): + (WebCore::InspectorResource::updateScriptObject): m_frame->document() becomes + available when Frame::setDocument() is called. We cannot obtain documentURL + during the constructor or updateRequest() function, because m_frame->document() + is not available yet at that point and documentURL will contain a wrong URL. + As far as I know, updateScriptObject() is the only place where we can safely + obtain documentURL. + (WebCore::InspectorResource::cachedResource): + (WebCore::InspectorResource::type): + (WebCore::InspectorResource::resourceData): + * inspector/InspectorResource.h: + (WebCore::InspectorResource::): + (WebCore::InspectorResource::markWebSocket): + * inspector/front-end/Resource.js: + (WebInspector.Resource.Type.toString): + (WebInspector.Resource.prototype.set type): + (WebInspector.Resource.prototype._mimeTypeIsConsistentWithType): + * inspector/front-end/ResourceView.js: + (WebInspector.ResourceView.prototype._refreshRequestHeaders): + (WebInspector.ResourceView.prototype._refreshResponseHeaders): + (WebInspector.ResourceView.prototype._refreshHeaders): + * inspector/front-end/inspector.css: + (.resources-category-websockets, .resources-category-other): + (.resources-category-websockets .resources-graph-bar): + (.resources-category-websockets.resource-cached .resources-graph-bar): + * inspector/front-end/inspector.js: + (WebInspector.loaded): + (WebInspector.updateResource): + * websockets/WebSocketChannel.cpp: + (WebCore::WebSocketChannel::WebSocketChannel): + (WebCore::WebSocketChannel::disconnect): + (WebCore::WebSocketChannel::didOpen): + (WebCore::WebSocketChannel::didClose): + (WebCore::WebSocketChannel::processBuffer): + (WebCore::WebSocketChannel::identifier): + * websockets/WebSocketChannel.h: + +2010-07-26 Cosmin Truta <ctruta@chromium.org> + + Reviewed by Eric Seidel. + + Some SVGs with empty <g> elements crash Chromium on Linux + https://bugs.webkit.org/show_bug.cgi?id=41175 + + Redo the old fix using a different approach, to avoid regressing + svg/batik/filters/filterRegions.svg with Chromium on Linux. + Specifically, handle empty SkBitmap objects by exiting early upon + encountering unconfigured (i.e. empty) bitmaps. + + No new tests. This bug's old test (svg/filters/filter-empty-g.svg) + and the above-mentioned regressed test are expected to pass. + + * WebCore/platform/graphics/skia/ImageBufferSkia.cpp: + (ImageBuffer::ImageBuffer): Undo the old fix. + (getImageData): The new fix. + +2010-07-26 Simon Fraser <simon.fraser@apple.com> + + Reviewed by Dan Bernstein. + + Google image search results broken on pages with Flash + https://bugs.webkit.org/show_bug.cgi?id=43014 + + The test for overflow added in r63452 is wrong in that it ignores the effects + of positioning on overflow. + + The correct approach is to start by using RenderView's layoutOverflowRect as the largest bounds, + then getting the oveflow rect via backgroundClipRect() relative to the root layer. + + Test: compositing/geometry/limit-layer-bounds-overflow-root.html + + * rendering/RenderLayerBacking.cpp: + (WebCore::layerOrAncestorIsTransformed): + (WebCore::RenderLayerBacking::updateCompositedBounds): + +2010-07-26 Anders Carlsson <andersca@apple.com> + + Reviewed by Sam Weinig. + + Plug-in views should be able to return JSObjects directly + https://bugs.webkit.org/show_bug.cgi?id=43019 + + * bindings/js/JSHTMLAppletElementCustom.cpp: + (WebCore::JSHTMLAppletElement::putDelegate): + (WebCore::JSHTMLAppletElement::getCallData): + * bindings/js/JSHTMLEmbedElementCustom.cpp: + (WebCore::JSHTMLEmbedElement::putDelegate): + (WebCore::JSHTMLEmbedElement::getCallData): + * bindings/js/JSHTMLObjectElementCustom.cpp: + (WebCore::JSHTMLObjectElement::putDelegate): + (WebCore::JSHTMLObjectElement::getCallData): + runtimeObjectCustomPut and runtimeObjectGetCallData now take a JSHTMLElement instead of a HTMLElement. + + * bindings/js/JSPluginElementFunctions.cpp: + (WebCore::pluginScriptObject): + First, ask the PluginViewBase for a JSObject and fall back to getting the JSObject from the instance. + + (WebCore::runtimeObjectPropertyGetter): + (WebCore::runtimeObjectCustomGetOwnPropertySlot): + (WebCore::runtimeObjectCustomGetOwnPropertyDescriptor): + Call pluginScriptObject. + + (WebCore::runtimeObjectCustomPut): + Change to take a JSHTMLElement. Call pluginScriptObject. + + (WebCore::runtimeObjectGetCallData): + Change to take a JSHTMLElement. + + * bridge/jsc/BridgeJSC.cpp: + * bridge/jsc/BridgeJSC.h: + (JSC::Bindings::Instance::createRuntimeObject): + Change this to return a JSObject. + + * html/HTMLPlugInElement.cpp: + (WebCore::HTMLPlugInElement::getInstance): + Call pluginWidget. + + (WebCore::HTMLPlugInElement::pluginWidget): + Return the plug-in widget for this element. + + * html/HTMLPlugInElement.h: + * plugins/PluginViewBase.h: + (WebCore::PluginViewBase::scriptObject): + Add default implementation of scriptObject. + +2010-07-26 Chris Fleizach <cfleizach@apple.com> + + Reviewed by Darin Adler. + + AX: Safari does not support ARIA mixed checkboxes + https://bugs.webkit.org/show_bug.cgi?id=43016 + + Test: platform/mac/accessibility/mixed-checkbox.html + + * accessibility/AccessibilityObject.cpp: + (WebCore::AccessibilityObject::checkboxOrRadioValue): + * accessibility/AccessibilityObject.h: + * accessibility/AccessibilityRenderObject.cpp: + (WebCore::AccessibilityRenderObject::isNativeCheckboxOrRadio): + (WebCore::AccessibilityRenderObject::checkboxOrRadioValue): + * accessibility/AccessibilityRenderObject.h: + * accessibility/mac/AccessibilityObjectWrapper.mm: + (-[AccessibilityObjectWrapper accessibilityAttributeValue:]): + +2010-07-26 Shimeng (Simon) Wang <swang@google.com> + + Reviewed by Darin Adler. + + Add auto hyphenation support for Android. + https://bugs.webkit.org/show_bug.cgi?id=42800 + + * platform/text/android/HyphenationAndroid.cpp: Added. + (WebCore::loadHyphenationDictionary): + (WebCore::lastHyphenLocation): + +2010-07-26 Sam Weinig <sam@webkit.org> + + Reviewed by Anders Carlsson. + + Patch for https://bugs.webkit.org/show_bug.cgi?id=43013 + Part of <rdar://problem/8152434> + Add support for scrolling using the keyboard in WebKit2 + + Add a new export and make WindowsKeyboardCodes private. + + * WebCore.exp.in: + * WebCore.xcodeproj/project.pbxproj: + +2010-07-26 Darin Adler <darin@apple.com> + + Reviewed by Eric Carlson. + + Don't handle empty URL attributes specially in reflection, even in cases such as <img src=""> + https://bugs.webkit.org/show_bug.cgi?id=42087 + + * html/HTMLMediaElement.cpp: + (WebCore::HTMLMediaElement::insertedIntoDocument): Check if the src attribute is empty + by calling getAttribute instead of calling the src function. This keeps the behavior + correct with the reflection change, and has a side benefit of being more efficient as + well since there is no reason to resolve the URL. + (WebCore::HTMLMediaElement::loadResource): Call getNonEmptyURLAttribute directly here + instead of using the poster function. + (WebCore::HTMLMediaElement::getPluginProxyParams): Ditto. + + * html/HTMLMediaElement.h: Removed the poster virtual function. The code that gets the + poster attribute is already video-specific and uses generic attribute fetching code, so + we no longer need a virtual function. Removed the src function. Since this would give + a different result from the JavaScript reflected src attribute, it's safer not to have + it, and it was easy to convert all the callers. + + * html/HTMLMediaElement.idl: Removed the NonEmpty extended attribute from the src + attribute. + + * html/HTMLSourceElement.cpp: Removed the src function for the same reason as above. + * html/HTMLSourceElement.h: Ditto. + + * html/HTMLSourceElement.idl: Removed the NonEmpty extended attribute from the src + attribute. + + * html/HTMLVideoElement.cpp: + (WebCore::HTMLVideoElement::parseMappedAttribute): Removed code to update m_posterURL, + which is no longer needed. Changed call site that used the poster() function to instead + use getNonEmptyURLAttribute. + (WebCore::HTMLVideoElement::updatePosterImage): Check if the poster attribute is empty + by calling getAttribute instead of calling the poster function. This keeps the behavior + correct with the reflection change, and has a side benefit of being more efficient as + well since there is no reason to resolve the URL. + + * html/HTMLVideoElement.h: Removed the poster function for the same reason we removed + the src function above. Also removed now-unneeded m_posterURL data member. + + * html/HTMLVideoElement.idl: Removed the NonEmpty extended attribute from the poster + attribute. + +2010-07-26 Chris Fleizach <cfleizach@apple.com> + + Reviewed by Darin Adler. + + AX: remove intValue() hasIntValue() from AccessibilityObject + https://bugs.webkit.org/show_bug.cgi?id=43006 + + These methods are very Mac centric. The mac centric code should be moved into the Mac wrapper. + + No new tests, existing tests cover changes to logic. + + * accessibility/AccessibilityObject.cpp: + (WebCore::AccessibilityObject::checkboxOrRadioValue): + * accessibility/AccessibilityObject.h: + (WebCore::): + * accessibility/AccessibilityRenderObject.cpp: + (WebCore::AccessibilityRenderObject::selectedRadioButton): + (WebCore::AccessibilityRenderObject::selectedTabItem): + (WebCore::AccessibilityRenderObject::checkboxOrRadioValue): + * accessibility/AccessibilityRenderObject.h: + * accessibility/mac/AccessibilityObjectWrapper.mm: + (-[AccessibilityObjectWrapper accessibilityAttributeValue:]): + +2010-07-26 Ryosuke Niwa <rniwa@webkit.org> + + Reviewed by Darin Adler. + + Applying inline style to a text node whose parent is an inline editable root causes crash + https://bugs.webkit.org/show_bug.cgi?id=39989 + + The crash was caused by splitTextElementAtStart and splitTextElementAtEnd assuming that the parent + and the grandparent of the specified text node is editable. + + Modified splitTextElementAtStart and splitTextElementAtEnd so that they call splitTextAtStart + and splitTextAtEnd respectively when the grandparent is not editable. + + Also modified SplitTextNodeContainingElement to exit early if the grandparent of m_text is not editable. + + Test: editing/style/style-text-node-without-editable-parent.html + + * editing/ApplyStyleCommand.cpp: + (WebCore::ApplyStyleCommand::splitTextElementAtStart): + (WebCore::ApplyStyleCommand::splitTextElementAtEnd): + * editing/SplitTextNodeContainingElementCommand.cpp: + (WebCore::SplitTextNodeContainingElementCommand::doApply): + +2010-07-26 Simon Fraser <simon.fraser@apple.com> + + Reviewed by Anders Carlsson. + + Gmail compose is upside-down after r64054 + https://bugs.webkit.org/show_bug.cgi?id=43000 + + We need to call setGeometryOrientation() whenever the iframe compositing layer attachment changes, + not just when requiresScrollLayer() returns false. This ensures that the orientation is updated + correctly. + + Test: compositing/iframes/iframe-content-flipping.html + + * rendering/RenderLayerCompositor.cpp: + (WebCore::RenderLayerCompositor::ensureRootPlatformLayer): + +2010-07-26 Justin Schuh <jschuh@chromium.org> + + Reviewed by Darin Fisher. + + Check history state against origin before setting + https://bugs.webkit.org/show_bug.cgi?id=42858 + + Tests: fast/loader/stateobjects/replacestate-base-illegal.html + fast/loader/stateobjects/replacestate-base-legal.html + + * page/History.cpp: + (WebCore::History::urlForState): + (WebCore::History::stateObjectAdded): + +2010-07-26 Martin Robinson <mrobinson@igalia.com> + + Reviewed by Xan Lopez. + + [GTK] Get rid of libgdom + https://bugs.webkit.org/show_bug.cgi?id=42378 + + Remove all build steps for building GObject DOM bindings. + + * GNUmakefile.am: Remove GObject DOM bindings build. + +2010-07-26 Mark Rowe <mrowe@apple.com> + + Reviewed by Dan Bernstein. + + <http://webkit.org/b/42990> REGRESSION (r63854): Safari RSS layout is broken due to changes in vendor prefix handling + + In r63854 support for properties with the -khtml vendor prefix was removed. This breaks the layout of + Safari's RSS interface, several Dashboard widgets that are included with Mac OS X, and at least one + popular third-party Mac OS X application. This change will need to be revisited in a manner that has + a clearer backwards-compatibility strategy. <http://webkit.org/b/42093> will be reopened to track that. + + * css/CSSParser.cpp: + (WebCore::cssPropertyID): Revert the WebCore change from r63854. + +2010-07-26 Brady Eidson <beidson@apple.com> + + Reviewed by Sam Weinig. + + Add ability for WK2 to register a scheme to always be displayed as an empty document + https://bugs.webkit.org/show_bug.cgi?id=42995 + + No new tests. (Currently not possible to test in WebKit1 DRT, can be testing in future WK2 tester) + + * WebCore.exp.in: + + * loader/MainResourceLoader.cpp: + (WebCore::shouldLoadAsEmptyDocument): + + * platform/SchemeRegistry.cpp: + (WebCore::emptyDocumentSchemes): + (WebCore::SchemeRegistry::registerURLSchemeAsEmptyDocument): + (WebCore::SchemeRegistry::shouldLoadURLSchemeAsEmptyDocument): + * platform/SchemeRegistry.h: + +2010-07-26 Patrick Gansterer <paroga@paroga.com> + + Reviewed by Kent Tamura. + + [WINCE] Port ClipboardUtilities to WinCE + https://bugs.webkit.org/show_bug.cgi?id=42929 + + Make ClipboardUtilitiesWin more portable and remove the global namespace prefix + from GlobalLock/GlobalUnlock, since they are only macros on WinCE. + + * platform/win/ClipboardUtilitiesWin.cpp: + (WebCore::urlFromPath): + (WebCore::getWebLocData): + (WebCore::createGlobalData): + (WebCore::getURL): + (WebCore::getPlainText): + (WebCore::fragmentFromHTML): + +2010-07-26 Patrick Gansterer <paroga@paroga.com> + + Reviewed by Adam Roben. + + [WINCE] Buildfix for BitmapImage.h + https://bugs.webkit.org/show_bug.cgi?id=42931 + + Use AffineTransform insted of TransformationMatrix. + + * platform/graphics/BitmapImage.h: + +2010-07-26 Dirk Schulze <krit@webkit.org> + + Unreviewed sort of XCode project file. + + * WebCore.xcodeproj/project.pbxproj: + +2010-07-26 David Kilzer <ddkilzer@apple.com> + + <http://webkit.org/b/42982> Streamline Inspector Source build phase script should use CONFIGURATION not BUILD_STYLE + <rdar://problem/6341764> + + Reviewed by Mark Rowe. + + * WebCore.xcodeproj/project.pbxproj: Switched Streamline + Inspector Source build phase script to use CONFIGURATION instead + of BUILD_STYLE. + +2010-07-23 Ojan Vafai <ojan@chromium.org> + + Reviewed by Darin Adler. + + crash in insertParagraph in a contentEditable list + https://bugs.webkit.org/show_bug.cgi?id=42919 + + Don't try to break out of a list item if the list it's in + is the rootEditableElement. + + * editing/CompositeEditCommand.cpp: + (WebCore::CompositeEditCommand::breakOutOfEmptyListItem): + +2010-07-26 Marcus Bulach <bulach@chromium.org> + + Reviewed by Jeremy Orlow. + + Moves IDBKeyRange to use IDBKey rather than SerializedScriptValue / IDBAny. + https://bugs.webkit.org/show_bug.cgi?id=42583 + + Tests: existing storage/indexeddb/idb-keyrange.html must pass. + + * storage/IDBKeyRange.cpp: + (WebCore::IDBKeyRange::IDBKeyRange): + * storage/IDBKeyRange.h: + (WebCore::IDBKeyRange::create): + (WebCore::IDBKeyRange::left): + (WebCore::IDBKeyRange::right): + * storage/IDBKeyRange.idl: + * storage/IndexedDatabaseRequest.cpp: + (WebCore::IndexedDatabaseRequest::makeSingleKeyRange): + (WebCore::IndexedDatabaseRequest::makeLeftBoundKeyRange): + (WebCore::IndexedDatabaseRequest::makeRightBoundKeyRange): + (WebCore::IndexedDatabaseRequest::makeBoundKeyRange): + * storage/IndexedDatabaseRequest.h: + * storage/IndexedDatabaseRequest.idl: + +2010-07-26 Simon Fraser <simon.fraser@apple.com> + + Reviewed by Anders Carlsson. + + Composited layers don't scroll in WebKit2 + https://bugs.webkit.org/show_bug.cgi?id=42771 + + Rename two methods on RenderLayerCompositor to make their use more clear, and call them + when the FrameView gets resized and scrolled. + + * page/FrameView.h: + * page/FrameView.cpp: + (WebCore::FrameView::setFrameRect): override so we know when the size of the FrameView changes, so that the + RenderLayerCompositor can update its clipping layer. + (WebCore::FrameView::scrollPositionChanged): Call compositor()->frameViewDidScroll(). + + * rendering/RenderLayerBacking.cpp: + (WebCore::RenderLayerBacking::updateAfterWidgetResize): updateContentLayerOffset() was renamed. + + * rendering/RenderLayerCompositor.h: + * rendering/RenderLayerCompositor.cpp: + (WebCore::RenderLayerCompositor::frameViewDidChangeSize): Renamed from updateContentLayerOffset(). + (WebCore::RenderLayerCompositor::frameViewDidScroll): Renamed from updateContentLayerScrollPosition(). + (WebCore::RenderLayerCompositor::shouldPropagateCompositingToEnclosingIFrame): Propagate compositing on Mac + for any FrameView that doesn't have a native widget, which is the case with WebKit2. + (WebCore::RenderLayerCompositor::requiresScrollLayer): New method to tell us whether we need to handle + scrolling (and clipping) ourselves. + (WebCore::RenderLayerCompositor::ensureRootPlatformLayer): Do geometry flipping on the root platform + layer only if we're not doing our own scrolling, and use the new requiresScrollLayer() method. + (WebCore::RenderLayerCompositor::attachRootPlatformLayer): Send out the rootPlatformLayer(), + so that it returns the clipping layer if we have one. + +2010-07-26 Tony Gentilcore <tonyg@chromium.org> + + Reviewed by Darin Fisher. + + Move DocumentLoadTiming struct to a new file + https://bugs.webkit.org/show_bug.cgi?id=42917 + + Also makes DocumentLoadTiming Noncopyable. + + No new tests because no new functionality. + + * GNUmakefile.am: + * WebCore.gypi: + * WebCore.vcproj/WebCore.vcproj: + * WebCore.xcodeproj/project.pbxproj: + * loader/DocumentLoadTiming.h: Added. + (WebCore::DocumentLoadTiming::DocumentLoadTiming): + * loader/DocumentLoader.h: + * loader/FrameLoader.cpp: + * loader/FrameLoaderTypes.h: + * loader/MainResourceLoader.cpp: + * page/Timing.cpp: + +2010-07-26 Mark Rowe <mrowe@apple.com> + + Fix an #if in WebCore.exp.in to correctly detect whether SVG filters are enabled. + + * WebCore.exp.in: + +2010-07-26 Steve Block <steveblock@google.com> + + Reviewed by Jeremy Orlow. + + DeviceOrientation event listeners should never be called synchronously from addEventListener() + https://bugs.webkit.org/show_bug.cgi?id=42304 + + No new tests as there are currently no implementations to test. Tests will be + added once LayoutTestController methods for providing a mock implementation are + in place, see Bug 39589. + + * dom/DeviceOrientationController.cpp: + (WebCore::DeviceOrientationController::DeviceOrientationController): + (WebCore::DeviceOrientationController::timerFired): + (WebCore::DeviceOrientationController::addListener): + (WebCore::DeviceOrientationController::removeListener): + (WebCore::DeviceOrientationController::removeAllListeners): + * dom/DeviceOrientationController.h: + +2010-07-26 Andreas Kling <andreas.kling@nokia.com> + + Reviewed by Tor Arne Vestbø. + + [Qt] Canvas: Optimize GraphicsContext::addPath() + + Avoid "deep concatenating" the canvas path onto the GC path + if the GC path has no elements. + + * platform/graphics/qt/GraphicsContextQt.cpp: + (WebCore::GraphicsContext::addPath): + +2010-07-23 Stephen White <senorblanco@chromium.org> + + Reviewed by Darin Fisher. + + Implement OpenGLES2 helper classes. + https://bugs.webkit.org/show_bug.cgi?id=42905 + + GLES2Canvas and GLES2Texture are some simple OpenGLES2 helper classes + for managing state, samplers and textures. + + When this is hooked up, it will be covered by many layout tests. + + * WebCore.gypi: + Add new files to chromium build (contents are protected by #if's for now). + * platform/graphics/chromium/GLES2Canvas.cpp: Added. + (WebCore::affineTo3x3): + (WebCore::GLES2Canvas::State::State): + (WebCore::GLES2Canvas::GLES2Canvas): + (WebCore::GLES2Canvas::~GLES2Canvas): + (WebCore::GLES2Canvas::clearRect): + (WebCore::GLES2Canvas::fillRect): + (WebCore::GLES2Canvas::setFillColor): + (WebCore::GLES2Canvas::setAlpha): + (WebCore::GLES2Canvas::translate): + (WebCore::GLES2Canvas::rotate): + (WebCore::GLES2Canvas::scale): + (WebCore::GLES2Canvas::concatCTM): + (WebCore::GLES2Canvas::save): + (WebCore::GLES2Canvas::restore): + (WebCore::GLES2Canvas::drawTexturedRect): + (WebCore::GLES2Canvas::setCompositeOperation): + (WebCore::GLES2Canvas::applyCompositeOperator): + (WebCore::GLES2Canvas::getQuadVertices): + (WebCore::GLES2Canvas::getQuadIndices): + (WebCore::loadShader): + (WebCore::GLES2Canvas::getSimpleProgram): + (WebCore::GLES2Canvas::getTexProgram): + (WebCore::GLES2Canvas::createTexture): + (WebCore::GLES2Canvas::getTexture): + (WebCore::GLES2Canvas::checkGLError): + * platform/graphics/chromium/GLES2Canvas.h: Added. + (WebCore::GLES2Canvas::gles2Context): + * platform/graphics/chromium/GLES2Texture.cpp: Added. + (WebCore::GLES2Texture::GLES2Texture): + (WebCore::GLES2Texture::~GLES2Texture): + (WebCore::GLES2Texture::create): + (WebCore::convertFormat): + (WebCore::GLES2Texture::load): + (WebCore::GLES2Texture::bind): + * platform/graphics/chromium/GLES2Texture.h: Added. + (WebCore::GLES2Texture::): + (WebCore::GLES2Texture::format): + (WebCore::GLES2Texture::width): + (WebCore::GLES2Texture::height): + + +2010-07-26 Jeremy Orlow <jorlow@chromium.org> + + Reviewed by Steve Block. + + Fix IndexedDB release build on mac + https://bugs.webkit.org/show_bug.cgi?id=42377 + + * storage/IDBDatabaseImpl.cpp: + (WebCore::IDBDatabaseImpl::objectStore): + +2010-07-26 Satish Sampath <satish@chromium.org> + + Reviewed by Steve Block. + + Add WebKit plumbing to connect speech requests and callbacks between WebCore and the embedder. + https://bugs.webkit.org/show_bug.cgi?id=42367 + + No new tests, the relevant LayoutTestController bindings will be added in the next patch. + + * page/SpeechInput.cpp: renamed a method. + * page/SpeechInput.h: renamed a method. + * page/SpeechInputClient.h: added an extra method to optionally let users stop recording once they have spoken. + * page/SpeechInputClientListener.h: renamed a method. + * page/SpeechInputListener.h: renamed a method. + +2010-07-26 Andreas Kling <andreas.kling@nokia.com> + + Reviewed by Kenneth Rohde Christiansen. + + [Qt] getImageData(): Single-pass RGB->BGR and un-premultiplication + https://bugs.webkit.org/show_bug.cgi?id=42945 + + Combine the two operations into a single loop over the pixel data. + Yields a considerable FPS gain on http://www.semantix.gr/statue.html + + * platform/graphics/qt/ImageBufferQt.cpp: + (WebCore::getImageData): + +2010-07-26 Pavel Feldman <pfeldman@chromium.org> + + Reviewed by Shinichiro Hamaji. + + Web Inspector: make sure proxy objects are JSON-stringifiable. + + https://bugs.webkit.org/show_bug.cgi?id=42961 + + * inspector/front-end/InjectedScript.js: + (injectedScriptConstructor): + +2010-07-26 Alexander Pavlov <apavlov@chromium.org> + + Reviewed by Joseph Pecoraro. + + Inspector should remember resources sorting set by the user + https://bugs.webkit.org/show_bug.cgi?id=19208 + + Sorting options both for time and size graphs are memorized in a single property, + which makes them possible to retrieve in a single message (e.g. useful for remote debugging). + + * inspector/front-end/ResourcesPanel.js: + (WebInspector.ResourcesPanel.prototype.populateSidebar): + (WebInspector.ResourcesPanel.prototype._settingsLoaded): + (WebInspector.ResourcesPanel.prototype._loadSortOptions): + (WebInspector.ResourcesPanel.prototype._loadSortOptionForGraph): + (WebInspector.ResourcesPanel.prototype._graphSelected): + (WebInspector.ResourcesPanel.prototype._changeSortingFunction): + (WebInspector.ResourcesPanel.prototype._selectedOptionNameForGraph): + (WebInspector.ResourcesPanel.prototype._doChangeSortingFunction): + * inspector/front-end/Settings.js: + (WebInspector.populateApplicationSettings): + +2010-07-25 Ryosuke Niwa <rniwa@webkit.org> + + Reviewed by Darin Adler. + + Redo fails after text node is split by SplitTextNodeCommand + https://bugs.webkit.org/show_bug.cgi?id=42941 + + The bug was caused by SplitTextNodeCommand not implementing doReapply. + Implemented doReapply and added insertText1AndTrimText2 to share the code between doApply and doReapply. + + Test: editing/undo/redo-split-text-node.html + editing/undo/redo-split-text-node-with-removal.html + + * editing/SplitTextNodeCommand.cpp: + (WebCore::SplitTextNodeCommand::doApply): Calls executeApply. + (WebCore::SplitTextNodeCommand::doUnapply): Don't delete m_text1, which is later used in doReapply. + (WebCore::SplitTextNodeCommand::doReapply): Added. + (WebCore::SplitTextNodeCommand::insertText1AndTrimText2): Added. + * editing/SplitTextNodeCommand.h: + +2010-07-23 Philippe Normand <pnormand@igalia.com> + + Reviewed by Eric Carlson. + + [GTK] media/media-can-play-mpeg-audio.html fails + https://bugs.webkit.org/show_bug.cgi?id=42895 + + Fixed advertizing of mp3, mpeg and mp4 mime-types in the player. + + * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp: + (WebCore::mimeTypeCache): + +2010-07-23 Philippe Normand <pnormand@igalia.com> + + Reviewed by Eric Carlson. + + LayoutTests/media/media-document-audio-size.html failure + https://bugs.webkit.org/show_bug.cgi?id=38376 + + Advertize audio/x-wav along with audio/wav when appropriate, + otherwise WebKit attempts to use a plugin to play the media. + + * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp: + (WebCore::mimeTypeCache): + +2010-07-25 Ryosuke Niwa <rniwa@webkit.org> + + Reviewed by Kent Tamura. + + splitTextAt*IfNeed and splitTextElementAt*IfNeed need to be cleaned up + https://bugs.webkit.org/show_bug.cgi?id=42937 + + Isolated the code to decide whether or not text node should be split into isValidCaretPositionInTextNode. + Moved the condition check out of *IfNeeded methods to applyRelativeFontStyleChange and applyInlineStyle. + + No new tests added since this is a clean up. + + * editing/ApplyStyleCommand.cpp: + (WebCore::ApplyStyleCommand::applyRelativeFontStyleChange): Uses isValidCaretPositionInTextNode. + (WebCore::ApplyStyleCommand::applyInlineStyle): Uses isValidCaretPositionInTextNode. + (WebCore::ApplyStyleCommand::splitTextAtStart): Renamed from splitTextAtStartIfNeeded. + (WebCore::ApplyStyleCommand::splitTextAtEnd): Renamed from splitTextAtEndIfNeeded. + (WebCore::ApplyStyleCommand::splitTextElementAtStart): Renamed from splitTextElementAtStartIfNeeded. + (WebCore::ApplyStyleCommand::splitTextElementAtEnd): Renamed from splitTextElementAtEndIfNeeded. + (WebCore::ApplyStyleCommand::isValidCaretPositionInTextNode): Returns true if the position lies within a text node. + * editing/ApplyStyleCommand.h: + +2010-07-25 Patrick Gansterer <paroga@paroga.com> + + Reviewed by Kent Tamura. + + [WINCE] Buildfix for ImageBufferWince + https://bugs.webkit.org/show_bug.cgi?id=42928 + + * platform/graphics/wince/ImageBufferWince.cpp: + (WebCore::): + (WebCore::BufferedImage::draw): Pass through ColorSpace parameter. + (WebCore::BufferedImage::drawPattern): Ditto. + (WebCore::ImageBuffer::platformTransformColorSpace): Added. + +2010-07-25 Patrick Gansterer <paroga@paroga.com> + + Reviewed by Kent Tamura. + + [WINCE] Buildfix for PopupMenuWin.cpp + https://bugs.webkit.org/show_bug.cgi?id=42932 + + Add #if !OS(WINCE) around unsupported window messages. + + * platform/win/PopupMenuWin.cpp: + (WebCore::PopupMenu::show): + (WebCore::PopupMenu::wndProc): + +2010-07-25 Adam Barth <abarth@webkit.org> + + Reviewed by Eric Seidel. + + Implement adjustMathMLAttributes + https://bugs.webkit.org/show_bug.cgi?id=42952 + + This is kind of mechanical overkill for adjusting one attribute name, + but it's nice to use the same machinery as SVG. + + * html/HTMLTreeBuilder.cpp: + * mathml/mathattrs.in: + +2010-07-25 Adam Barth <abarth@webkit.org> + + Reviewed by Eric Seidel. + + Functions supporting the legacy tree builder are confusing + https://bugs.webkit.org/show_bug.cgi?id=42951 + + This patch just inlines these functions into their one call site and + removes the notImplemented() calls. We thought we were going to grow + these to support the new tree builder, but we took a different path. + Previous to this patch, these functions were confusing because they + looked like part of the new tree builder. + + * html/HTMLTreeBuilder.cpp: + (WebCore::HTMLTreeBuilder::passTokenToLegacyParser): + * html/HTMLTreeBuilder.h: + +2010-07-25 Adam Barth <abarth@webkit.org> + + Reviewed by Eric Seidel. + + Recent HTML5 TreeBuilder Regression? All canvas tests ASSERT + https://bugs.webkit.org/show_bug.cgi?id=42948 + + Remove ASSERT and replace with correct branch. I put this ASSERT in + to make sure we had test coverage for this branch. I guess we do. :) + + * html/HTMLConstructionSite.cpp: + (WebCore::HTMLConstructionSite::attach): + +2010-07-25 Pavel Feldman <pfeldman@chromium.org> + + Reviewed by Timothy Hatcher. + + Web Inspector: check of jQuery object type prior to treating it as an array. + + https://bugs.webkit.org/show_bug.cgi?id=42946 + + * inspector/front-end/InjectedScript.js: + (injectedScriptConstructor): + +2010-07-24 Daniel Bates <dbates@rim.com> + + Unreviewed, build fix when building with WML support. + + PageCache.cpp compile error when WML is enabled + https://bugs.webkit.org/show_bug.cgi?id=40765 + + Remove extraneous semicolon. + + Note, building with WML support enabled is broken + even with this fix. See Bug #42943 for more details. + + * history/PageCache.cpp: + (WebCore::PageCache::canCachePageContainingThisFrame): + +2010-07-24 Adam Barth <abarth@webkit.org> + + Reviewed by Eric Seidel. + + Atomize strings used by the HTML5 tree builder + https://bugs.webkit.org/show_bug.cgi?id=42875 + + This is about a 1% improvement to the parsing benchmark. + + * html/HTMLTagNames.in: + * html/HTMLTreeBuilder.cpp: + (WebCore::HTMLTreeBuilder::processStartTagForInBody): + (WebCore::HTMLTreeBuilder::processStartTag): + (WebCore::HTMLTreeBuilder::processEndTagForInBody): + (WebCore::HTMLTreeBuilder::processStartTagForInHead): + +2010-07-24 Patrick Gansterer <paroga@paroga.com> + + Reviewed by Darin Adler. + + Buildfix for !ENABLE(INSPECTOR) after r63891. + https://bugs.webkit.org/show_bug.cgi?id=42925 + + * bindings/js/ScriptValue.cpp: Added property svn:eol-style. + * bindings/js/ScriptValue.h: Added property svn:eol-style. + * inspector/ConsoleMessage.cpp: Added property svn:eol-style. + * inspector/ConsoleMessage.h: Added property svn:eol-style. + +2010-07-24 Adam Barth <abarth@webkit.org> + + Reviewed by Eric Seidel. + + Re-order whitespace checks in the tokenizer + https://bugs.webkit.org/show_bug.cgi?id=42923 + + This saves about 0.5% on the parsing benchmark. + + * html/HTMLTokenizer.cpp: + +2010-07-24 Andreas Kling <andreas.kling@nokia.com> + + Reviewed by Simon Hausmann. + + [Qt] tst_QWebFrame::callQtInvokable() fails + https://bugs.webkit.org/show_bug.cgi?id=41065 + + Converting JS objects to QVariantMaps was broken. + This is a partial revert of <http://trac.webkit.org/changeset/61478> + + * bridge/qt/qt_runtime.cpp: + (JSC::Bindings::convertValueToQVariant): Remove erroneous crash guard + around JSObject::getPropertyNames() + +2010-07-24 Adam Barth <abarth@webkit.org> + + Reviewed by Eric Seidel. + + Save a per-character branch in the HTML parser + https://bugs.webkit.org/show_bug.cgi?id=42921 + + The parsing benchmark claims this is a wash, but it makes me feel + better. + + * html/HTMLToken.h: + (WebCore::HTMLToken::clear): + (WebCore::HTMLToken::beginStartTag): + (WebCore::HTMLToken::beginEndTag): + (WebCore::HTMLToken::ensureIsCharacterToken): + (WebCore::HTMLToken::beginComment): + (WebCore::HTMLToken::beginDOCTYPE): + * html/HTMLTokenizer.cpp: + (WebCore::HTMLTokenizer::bufferCharacter): + +2010-07-23 Patrick Gansterer <paroga@paroga.com> + + Reviewed by Darin Adler. + + Buildfix for !ENABLE(FILTERS) after r63531. + https://bugs.webkit.org/show_bug.cgi?id=42914 + + * rendering/RenderSVGContainer.cpp: Add missing header. + +2010-07-23 Kavita Kanetkar <kkanetkar@chromium.org> + + Reviewed by Joseph Pecoraro. + + Implement remaining Inspector support for chrome's appcache + https://bugs.webkit.org/show_bug.cgi?id=42426 + + * inspector/InspectorApplicationCacheAgent.cpp: + (WebCore::InspectorApplicationCacheAgent::getApplicationCaches): + (WebCore::InspectorApplicationCacheAgent::buildObjectForApplicationCache): + (WebCore::InspectorApplicationCacheAgent::buildArrayForApplicationCacheResources): + (WebCore::InspectorApplicationCacheAgent::buildObjectForApplicationCacheResource): + * inspector/InspectorApplicationCacheAgent.h: + (WebCore::InspectorController::connectFrontend): + * loader/appcache/ApplicationCacheHost.cpp: + (WebCore::ApplicationCacheHost::fillResourceList): + (WebCore::ApplicationCacheHost::applicationCacheInfo): + * loader/appcache/ApplicationCacheHost.h: Changed creation + update times to double and moved appcache info here from InspectorApplicationCacheAgent.h + (WebCore::ApplicationCacheHost::CacheInfo::CacheInfo): + (WebCore::ApplicationCacheHost::ResourceInfo::ResourceInfo): + +2010-07-23 Rafael Antognolli <antognolli@profusion.mobi> + + Reviewed by Antonio Gomes. + + [EFL] Cleanup glib support (make it optional) + https://bugs.webkit.org/show_bug.cgi?id=42480 + + No new tests, no new features added. + Just add flags and directories for glib if necessary. + Put some ifdefs on glib calls. + + * CMakeListsEfl.txt: + * platform/graphics/cairo/FontPlatformDataCairo.cpp: + (WebCore::FontPlatformData::FontPlatformData): + +2010-07-23 James Robinson <jamesr@chromium.org> + + Reviewed by Dimitri Glazkov. + + CanvasRenderingContext2D has lots of style errors + https://bugs.webkit.org/show_bug.cgi?id=42918 + + CanvasRenderingContext2D.h and .cpp have lots of style errors. I'm planning to post patches + to both of these files soon, so to minimize merge conflicts and additional style violations + it seems best to fix all of these errors in bulk before posting any functional changes. In + particular the header file is incorrectly indented so any correctly formatted addition will + be out of place. + + * html/canvas/CanvasRenderingContext2D.cpp: + (WebCore::CanvasRenderingContext2D::CanvasRenderingContext2D): + (WebCore::CanvasRenderingContext2D::setFillStyle): + (WebCore::CanvasRenderingContext2D::transform): + (WebCore::CanvasRenderingContext2D::setTransform): + (WebCore::CanvasRenderingContext2D::arcTo): + (WebCore::CanvasRenderingContext2D::arc): + (WebCore::validateRectForCanvas): + (WebCore::CanvasRenderingContext2D::strokeRect): + (WebCore::CanvasRenderingContext2D::drawImage): + (WebCore::CanvasRenderingContext2D::createRadialGradient): + (WebCore::CanvasRenderingContext2D::createPattern): + (WebCore::CanvasRenderingContext2D::willDraw): + (WebCore::CanvasRenderingContext2D::createImageData): + (WebCore::CanvasRenderingContext2D::putImageData): + (WebCore::CanvasRenderingContext2D::setFont): + (WebCore::CanvasRenderingContext2D::drawTextInternal): + * html/canvas/CanvasRenderingContext2D.h: + (WebCore::CanvasRenderingContext2D::is2d): + (WebCore::CanvasRenderingContext2D::getLineCap): + (WebCore::CanvasRenderingContext2D::getLineJoin): + (WebCore::CanvasRenderingContext2D::state): + (WebCore::CanvasRenderingContext2D::): + +2010-07-23 Adam Barth <abarth@webkit.org> + + Remove FIXME that we already fixed. + + * html/HTMLTreeBuilder.cpp: + (WebCore::HTMLTreeBuilder::processCharacter): + +2010-06-24 Dimitri Glazkov <dglazkov@chromium.org> + + Reviewed by Kent Tamura. + + Move more form submission logic into FormSubmission. + https://bugs.webkit.org/show_bug.cgi?id=41110 + + Two major moves: + * Fold HTMLFormElement::prepareFormSubmission into FormSubmission::create + * Move non-static (non-FormData-building) methods of FormDataBuilder + to FormSubmission::Attributes. + + Mechanical moving, no change in behavior, so no new tests. + + * WebCore.xcodeproj/project.pbxproj: Gave FormDataBuilder.h "project" and + FormSubmission.h "private" visibility. + * html/HTMLFormElement.cpp: + (WebCore::HTMLFormElement::submit): Changed to use FormSubmission::create. + (WebCore::HTMLFormElement::parseMappedAttribute): Changed to use m_attributes. + * html/HTMLFormElement.h: + (WebCore::HTMLFormElement::enctype): Ditto. + (WebCore::HTMLFormElement::encoding): Ditto. + (WebCore::HTMLFormElement::acceptCharset): Ditto. + * loader/FormSubmission.cpp: + (WebCore::generateFormDataIdentifier): Moved from HTMLFormElement. + (WebCore::appendMailtoPostFormDataToURL): Ditto. + (WebCore::FormSubmission::Attributes::parseAction): Moved from FormDataBuilder. + (WebCore::FormSubmission::Attributes::parseEncodingType): Ditto. + (WebCore::FormSubmission::Attributes::parseMethodType): Ditto. + (WebCore::FormSubmission::FormSubmission): Made inline. + (WebCore::FormSubmission::create): Added logic that used to be in + HTMLFormElement::prepareFormSubmission. + * loader/FormSubmission.h: + (WebCore::FormSubmission::): + (WebCore::FormSubmission::Attributes::Attributes): Added new class. + (WebCore::FormSubmission::Attributes::method): Moved from FormDataBuilder. + (WebCore::FormSubmission::Attributes::isMultiPartForm): Ditto. + (WebCore::FormSubmission::Attributes::action): Ditto. + (WebCore::FormSubmission::Attributes::target): Ditto. + (WebCore::FormSubmission::Attributes::setTarget): Ditto. + (WebCore::FormSubmission::Attributes::encodingType): Ditto. + (WebCore::FormSubmission::Attributes::acceptCharset): Ditto. + (WebCore::FormSubmission::Attributes::setAcceptCharset): Ditto. + (WebCore::FormSubmission::target): Ditto. + (WebCore::FormSubmission::contentType): Const-ified return type. + (WebCore::FormSubmission::boundary): Ditto. + * platform/network/FormDataBuilder.cpp: + (WebCore::FormDataBuilder::encodingFromAcceptCharset): Renamed method for clarity, + made it use param instead of a class member. + * platform/network/FormDataBuilder.h: + (WebCore::FormDataBuilder::FormDataBuilder): Made constructor private. + * wml/WMLGoElement.cpp: Changed to use FormSubmision::Attributes. + * wml/WMLGoElement.h: Ditto. + +2010-07-23 Adam Barth <abarth@webkit.org> + + Reviewed by Eric Seidel. + + HTML5 Parser: document.write in a asynchronous script which is specified to load before page finish blows away document + https://bugs.webkit.org/show_bug.cgi?id=42365 + + This patch implements the changes Ian made to HTML5 to address these + issues. Let's try it and see how well it works. + + Test: http/tests/misc/write-from-dom-script.html + + * dom/Document.cpp: + (WebCore::Document::Document): + (WebCore::Document::write): + * dom/Document.h: + (WebCore::Document::writeDisabled): + (WebCore::Document::setWriteDisabled): + * dom/DocumentParser.h: + (WebCore::DocumentParser::hasInsertionPoint): + * dom/ScriptElement.cpp: + (WebCore::ScriptElement::insertedIntoDocument): + (WebCore::ScriptElementData::ScriptElementData): + (WebCore::ScriptElementData::evaluateScript): + * dom/ScriptElement.h: + (WebCore::ScriptElementData::writeDisabled): + (WebCore::ScriptElementData::setWriteDisabled): + * html/HTMLDocumentParser.cpp: + (WebCore::HTMLDocumentParser::hasInsertionPoint): + (WebCore::HTMLDocumentParser::insert): + * html/HTMLDocumentParser.h: + +2010-07-23 Patrick Gansterer <paroga@paroga.com> + + Reviewed by Adam Roben. + + [WINCE] Buildfix for PopupMenuWin.cpp + https://bugs.webkit.org/show_bug.cgi?id=42906 + + Use correct API for BitmapInfo landed in r63944. + + * platform/win/PopupMenuWin.cpp: + (WebCore::PopupMenu::paint): + +2010-07-23 fsamuel@chromium.org <fsamuel@chromium.org> + + Reviewed by David Hyatt. + + Updated table painting to draw cell layers in the correct order. + + Table Cell Layering + https://bugs.webkit.org/show_bug.cgi?id=40775 + + Tests: tables/layering/paint-test-layering-1.html + tables/layering/paint-test-layering-2.html + + * accessibility/AccessibilityTable.cpp: + (WebCore::AccessibilityTable::isTableExposableThroughAccessibility): + (WebCore::AccessibilityTable::addChildren): + (WebCore::AccessibilityTable::cellForColumnAndRow): + * accessibility/AccessibilityTableCell.cpp: + (WebCore::AccessibilityTableCell::titleUIElement): + * accessibility/AccessibilityTableColumn.cpp: + (WebCore::AccessibilityTableColumn::headerObjectForSection): + * rendering/AutoTableLayout.cpp: + (WebCore::AutoTableLayout::recalcColumn): + * rendering/RenderTable.cpp: + (WebCore::RenderTable::splitColumn): + (WebCore::RenderTable::calcBorderLeft): + (WebCore::RenderTable::calcBorderRight): + (WebCore::RenderTable::cellAbove): + (WebCore::RenderTable::cellBelow): + (WebCore::RenderTable::cellBefore): + (WebCore::RenderTable::cellAfter): + * rendering/RenderTableSection.cpp: + (WebCore::RenderTableSection::RenderTableSection): + (WebCore::RenderTableSection::ensureRows): + (WebCore::RenderTableSection::addCell): + (WebCore::RenderTableSection::setCellWidths): + (WebCore::RenderTableSection::calcRowHeight): + (WebCore::RenderTableSection::layoutRows): + (WebCore::RenderTableSection::calcOuterBorderTop): + (WebCore::RenderTableSection::calcOuterBorderBottom): + (WebCore::RenderTableSection::calcOuterBorderLeft): + (WebCore::RenderTableSection::calcOuterBorderRight): + (WebCore::RenderTableSection::firstLineBoxBaseline): + (WebCore::compareCellPositions): + (WebCore::RenderTableSection::paintCell): + (WebCore::RenderTableSection::paintObject): + (WebCore::RenderTableSection::numColumns): + (WebCore::RenderTableSection::appendColumn): + (WebCore::RenderTableSection::splitColumn): + (WebCore::RenderTableSection::nodeAtPoint): + * rendering/RenderTableSection.h: + (WebCore::RenderTableSection::CellStruct::CellStruct): + (WebCore::RenderTableSection::CellStruct::primaryCell): + (WebCore::RenderTableSection::CellStruct::hasCells): + (WebCore::RenderTableSection::primaryCellAt): + +2010-07-23 Patrick Gansterer <paroga@paroga.com> + + Reviewed by Adam Roben. + + [WINCE] Buildfix for Path.h + https://bugs.webkit.org/show_bug.cgi?id=42904 + + * platform/graphics/Path.h: Add missing typedef PlatformPath. + +2010-07-23 Adam Barth <abarth@webkit.org> + + Reviewed by Eric Seidel. + + Reserve capacity for attributes + https://bugs.webkit.org/show_bug.cgi?id=42877 + + This is about a 1.7% improvement to the parsing benchmark. + + * html/HTMLToken.h: + (WebCore::AtomicHTMLToken::AtomicHTMLToken): + +2010-07-23 Adam Barth <abarth@webkit.org> + + Reviewed by Eric Seidel. + + Inline HTMLElementStack::top + https://bugs.webkit.org/show_bug.cgi?id=42879 + + According to sampling, HTMLElementStack::top is the hotest function in + the treebuilder. Inlining it is about a 0.3% improvement to the + parsing benchmark. This squares with how often it occurs in samples. + + * html/HTMLElementStack.cpp: + * html/HTMLElementStack.h: + (WebCore::HTMLElementStack::top): + +2010-07-23 Patrick Gansterer <paroga@paroga.com> + + Reviewed by Adam Roben. + + [WINCE] Buildfix for GraphicsContext + https://bugs.webkit.org/show_bug.cgi?id=42888 + + Use AffineTransform insted of TransformationMatrix and + add ColorSpace parameter to the drawBitmap methods. + + * platform/graphics/GraphicsContext.h: + * platform/graphics/wince/GraphicsContextWince.cpp: + (WebCore::GraphicsContext::affineTransform): + (WebCore::GraphicsContext::fillRoundedRect): + (WebCore::GraphicsContext::drawBitmap): + (WebCore::GraphicsContext::drawBitmapPattern): + +2010-07-23 Rafael Antognolli <antognolli@profusion.mobi> + + Reviewed by Antonio Gomes. + + [EFL] Add support for using libcurl network backend. + https://bugs.webkit.org/show_bug.cgi?id=42286 + + Add files and flags for soup/curl specific backend being + used. + Put some ifdefs around soup/glib calls. + + No new tests, no new features implemented. + + * CMakeListsEfl.txt: + * platform/efl/FileSystemEfl.cpp: + (WebCore::fileSystemRepresentation): + +2010-07-23 Adam Barth <abarth@webkit.org> + + Reviewed by Eric Seidel. + + Add fast-reject path for InputStreamPreprocessor::peek + https://bugs.webkit.org/show_bug.cgi?id=42881 + + This is about a 2.5% speedup on the parsing benchmark. + + * html/HTMLTokenizer.h: + (WebCore::HTMLTokenizer::InputStreamPreprocessor::peek): + +2010-07-23 Patrick Gansterer <paroga@paroga.com> + + Reviewed by Adam Roben. + + [WINCE] Merge PasteboardWince.cpp into PasteboardWin.cpp + https://bugs.webkit.org/show_bug.cgi?id=42885 + + Make PasteboardWin more portable and remove the global namespace prefix + from GlobalLock/GlobalUnlock, since they are only macros on WinCE. + + * platform/win/PasteboardWin.cpp: + (WebCore::PasteboardOwnerWndProc): + (WebCore::Pasteboard::Pasteboard): + (WebCore::Pasteboard::plainText): + (WebCore::Pasteboard::documentFragment): + +2010-07-23 Justin Schuh <jschuh@chromium.org> + + Unreviewed, rolling out r63925. + http://trac.webkit.org/changeset/63925 + https://bugs.webkit.org/show_bug.cgi?id=42858 + + Introduced a regression in history state. + + * page/History.cpp: + (WebCore::History::urlForState): + +2010-07-23 Martin Robinson <mrobinson@igalia.com> + + Unreviewed build fix. + + Fix make dist by aligning the source list with currently used headers. + + * GNUmakefile.am: + +2010-07-23 Alex Milowski <alex@milowski.com> + + Reviewed by Darin Adler. + + Moved the 'mathml' group back to where it belongs as + siblings of the other major folders. + + * WebCore.xcodeproj/project.pbxproj: + +2010-07-23 Patrick Gansterer <paroga@paroga.com> + + Reviewed by Adam Roben. + + Buildfix for WinCE graphics after r56015. + https://bugs.webkit.org/show_bug.cgi?id=41354 + + Use fabs() insetead of abs(). + + * platform/graphics/wince/GraphicsContextWince.cpp: + (WebCore::GraphicsContext::fillRect): + * platform/graphics/wince/PlatformPathWince.cpp: + (WebCore::PlatformPath::addArcTo): + +2010-07-23 ryuan choi <ryuan.choi@samsung.com> + + Reviewed by Antonio Gomes. + + [EFL]build break because of r63927 + https://bugs.webkit.org/show_bug.cgi?id=42864 + + * CMakeLists.txt: + +2010-07-23 Adam Barth <abarth@webkit.org> + + Reviewed by Eric Seidel. + + Inline HTMLTokenizer::InputStreamPreprocessor::peek + https://bugs.webkit.org/show_bug.cgi?id=42880 + + According to sampling HTMLTokenizer::InputStreamPreprocessor::peek is + the hotest function in the tokenizer. Inlining this function is about + a 2.2% speedup on the parser benchmark. Turns out the tokenizer is + much hotter than the tree builder. :) + + * html/HTMLTokenizer.h: + (WebCore::HTMLTokenizer::InputStreamPreprocessor::peek): + +2010-07-23 Andras Becsi <abecsi@webkit.org> + + Unreviewed build fix. + + [Qt] Fix WebKit2 linkage. + + No new tests needed. + + * WebCore.pro: add InjectedBundlePageEditorClient.cpp to WK2 sources + +2010-07-23 Balazs Kelemen <kb@inf.u-szeged.hu> + + Reviewed by Kenneth Rohde Christiansen. + + [Qt] Setup the QtWebProcess + + https://bugs.webkit.org/show_bug.cgi?id=42623 + + * WebCore.pro: Added WebProcessMainQt.cpp to SOURCES. + +2010-07-23 Pavel Feldman <pfeldman@chromium.org> + + Not reviewed: Chromium tests fix. + + * inspector/CodeGeneratorInspector.pm: + +2010-07-23 Patrick Gansterer <paroga@paroga.com> + + Reviewed by Adam Roben. + + [WINCE] Buildfix for PluginDatabaseWin.cpp + https://bugs.webkit.org/show_bug.cgi?id=41887 + + Define KEY_ENUMERATE_SUB_KEYS only if not defined. + + * plugins/win/PluginDatabaseWin.cpp: + +2010-07-23 Pavel Feldman <pfeldman@chromium.org> + + Reviewed by Yury Semikhatsky. + + Chromium DevTools: migrate from utility context-based injected + script dispatch to upstream schema. + + https://bugs.webkit.org/show_bug.cgi?id=42883 + + * bindings/v8/ScriptProfile.cpp: + (WebCore::ScriptProfile::title): + * inspector/InspectorController.cpp: + (WebCore::InspectorController::getProfile): + * inspector/front-end/InjectedScriptAccess.js: + +2010-07-23 Pavel Feldman <pfeldman@chromium.org> + + Not reviewed: rolling out r63963. + + * bindings/v8/ScriptProfile.cpp: + (WebCore::ScriptProfile::title): + * inspector/InspectorController.cpp: + (WebCore::InspectorController::getProfile): + * inspector/front-end/InjectedScriptAccess.js: + +2010-07-23 Pavel Feldman <pfeldman@chromium.org> + + Reviewed by Yury Semikhatsky. + + Chromium DevTools: migrate from utility context-based injected + script dispatch to upstream schema. + + https://bugs.webkit.org/show_bug.cgi?id=42883 + + * bindings/v8/ScriptProfile.cpp: + (WebCore::ScriptProfile::title): + * inspector/InspectorController.cpp: + (WebCore::InspectorController::getProfile): + * inspector/front-end/InjectedScriptAccess.js: + (InjectedScriptAccess.get if): + (InjectedScriptAccess): + +2010-07-23 Yury Semikhatsky <yurys@chromium.org> + + Reviewed by Pavel Feldman. + + Web Inspector: error info propagation in InspectorBackendDispatch should be improved + https://bugs.webkit.org/show_bug.cgi?id=42873 + + * inspector/CodeGeneratorInspector.pm: report wrong parameter count and wrong + parametere type errror to the dispatch method caller + +2010-07-23 Pavel Feldman <pfeldman@chromium.org> + + Reviewed by Yury Semikhatsky. + + Web Inspector: injectedScriptId is missing in the stack frame wrappers. + + https://bugs.webkit.org/show_bug.cgi?id=42889 + + * inspector/front-end/InjectedScript.js: + (injectedScriptConstructor): + +2010-07-23 Shinichiro Hamaji <hamaji@chromium.org> + + Reviewed by Kent Tamura. + + Backslash isn't transcoded in <input> + https://bugs.webkit.org/show_bug.cgi?id=42878 + + * css/CSSStyleSelector.cpp: + (WebCore::CSSStyleSelector::applyProperty): + +2010-07-22 Ilya Tikhonovsky <loislo@chromium.org> + + Reviewed by Yury Semikhatsky. + + WebInspector: CodeGeneratorInspector was extended and now it can + generate InspectorBackedDispatcher's code. This dispatcher will + validate and dispatch incoming inspector commands only by native + code without using javaScript. That is necessary step for + RemoteDebugging support. + https://bugs.webkit.org/show_bug.cgi?id=42588 + + * GNUmakefile.am: + * WebCore.gyp/WebCore.gyp: + * WebCore.gypi: + * WebCore.pri: + * WebCore.vcproj/WebCore.vcproj: + * WebCore.xcodeproj/project.pbxproj: + * inspector/CodeGeneratorInspector.pm: + * inspector/InspectorController.cpp: + (WebCore::InspectorController::InspectorController): + * inspector/InspectorController.h: + (WebCore::InspectorController::inspectorBackendDispatcher): + * inspector/front-end/ElementsPanel.js: + (WebInspector.ElementsPanel.prototype.setDocument): + +2010-07-22 Shinichiro Hamaji <hamaji@chromium.org> + + Reviewed by Kent Tamura. + + Backslash is transcoded into yen sign even when non japanese font is specified + https://bugs.webkit.org/show_bug.cgi?id=39654 + + Test: fast/text/backslash-to-yen-sign-euc.html + + * css/CSSStyleSelector.cpp: + (WebCore::CSSStyleSelector::applyProperty): Call FontDescriptor::setIsSpecifiedFont. + * platform/graphics/Font.cpp: + (WebCore::Font::Font): + * platform/graphics/FontDescription.h: Added m_isSpecifiedFont and its accessors. + (WebCore::FontDescription::FontDescription): + (WebCore::FontDescription::isSpecifiedFont): + (WebCore::FontDescription::setIsSpecifiedFont): + (WebCore::FontDescription::operator==): + * platform/text/transcoder/FontTranscoder.cpp: + (WebCore::FontTranscoder::converterType): Don't transcode backslashes if a font family is explicitly specified. + (WebCore::FontTranscoder::convert): + (WebCore::FontTranscoder::needsTranscoding): + * platform/text/transcoder/FontTranscoder.h: Change the arguments from AtomicString fontFamily to Font. + * rendering/RenderText.cpp: + (WebCore::RenderText::updateNeedsTranscoding): + (WebCore::RenderText::setTextInternal): + +2010-07-22 Jon Honeycutt <jhoneycutt@apple.com> + + Windows build fix. + + Commit some changes missed by the commit-queue in r63944. + + * platform/win/BitmapInfo.h: + (WebCore::BitmapInfo::is16bit): + (WebCore::BitmapInfo::is32bit): + (WebCore::BitmapInfo::width): + (WebCore::BitmapInfo::height): + (WebCore::BitmapInfo::size): + (WebCore::BitmapInfo::paddedWidth): + (WebCore::BitmapInfo::numPixels): + (WebCore::BitmapInfo::paddedBytesPerLine): + (WebCore::BitmapInfo::bytesPerLine): + +2010-07-22 Patrick Gansterer <paroga@paroga.com> + + Reviewed by Adam Roben. + + [WINCE] Add additonal methods to BitmapInfo. + https://bugs.webkit.org/show_bug.cgi?id=42071 + + Added a parameter to create 16bit BitmapInfo and + some additional accessors for the WinCE port. + + Set bmiHeader.biSize only at constructor. + + * platform/win/BitmapInfo.cpp: Added property svn:eol-style. + (WebCore::bitmapInfoForSize): + (WebCore::BitmapInfo::create): + (WebCore::BitmapInfo::createBottomUp): + * platform/win/BitmapInfo.h: Added property svn:eol-style. + (WebCore::BitmapInfo::is16bit): + (WebCore::BitmapInfo::is32bit): + (WebCore::BitmapInfo::width): + (WebCore::BitmapInfo::height): + (WebCore::BitmapInfo::size): + (WebCore::BitmapInfo::paddedWidth): + (WebCore::BitmapInfo::numPixels): + (WebCore::BitmapInfo::paddedBytesPerLine): + (WebCore::BitmapInfo::bytesPerLine): + +2010-07-22 MORITA Hajime <morrita@google.com> + + Reviewed by Ojan Vafai. + + Autoscroll on selection should take scrollbars into account as outside of the content. + https://bugs.webkit.org/show_bug.cgi?id=40403 + + ScrollView's scroll-bar was considered as a part of content rect, + that prevents autoscroll to happen when the pointer is over the + scroll-bar. This change excluded scroll-bar region from scrolling + delta calculation. + + Test: WebCore/manual-tests/autoscroll-over-scrollbar.html + + * rendering/RenderLayer.cpp: + (WebCore::RenderLayer::scrollRectToVisible): + +2010-07-22 Kent Tamura <tkent@chromium.org> + + Reviewed by Darin Adler. + + maxLength should not be applied to non-text types + https://bugs.webkit.org/show_bug.cgi?id=42814 + + According to the HTML5 specification, maxLength attribute should + be applied to text, search, url, tel, email, and password types. + + Test: fast/forms/input-maxlength-unsupported.html + + * dom/InputElement.cpp: + (WebCore::InputElement::handleBeforeTextInsertedEvent): + Apply maxLength() only if supportsMaxLength() is true. + * dom/InputElement.h: + * html/HTMLInputElement.cpp: + (WebCore::HTMLInputElement::patternMismatch): + Code cleanup by isTextType(). + (WebCore::HTMLInputElement::tooLong): + ditto. + (WebCore::HTMLInputElement::isTextType): + Added. This returns true for types with maxLength/pattern/placeholder. + * html/HTMLInputElement.h: + (WebCore::HTMLInputElement::supportsMaxLength): + Added. Just calls isTextType(). + (WebCore::HTMLInputElement::supportsPlaceholder): + Code cleanup by isTextType(). + * wml/WMLInputElement.h: + (WebCore::WMLInputElement::supportsMaxLength): + Added. Always returns true. + +2010-07-22 Ryosuke Niwa <rniwa@webkit.org> + + Reviewed by Kent Tamura. + + [cleanup] logic to extract adjacent lists and list children in listifyParagraph and unlistifyParagraph should be isolated + https://bugs.webkit.org/show_bug.cgi?id=42841 + + Added enclosingListChild that takes the list node containing the node for the second argument + to ensure that it only returns the enclosing list child of the specified list node. + + Added adjacentEnclosingList that finds adjacent lists of the specified position. + It takes the current position, the adjacent position that may or may not have a list, and the list type, + and avoids a list that belongs to a different table cell or an outer list that contains the current position. + + No new tests needed. + + * editing/InsertListCommand.cpp: + (WebCore::enclosingListChild): Added. See above. + (WebCore::InsertListCommand::unlistifyParagraph): Uses enclosingListChild. + (WebCore::adjacentEnclosingList): Added. See above. + (WebCore::InsertListCommand::listifyParagraph): Uses adjacentEnclosingList. + +2010-07-22 Patrick Gansterer <paroga@paroga.com> + + Reviewed by Adam Roben. + + [WIN] Correct DeleteObject usage in PasteboardWin + https://bugs.webkit.org/show_bug.cgi?id=41956 + + Call DeleteObject() if OpenClipboard() fails and don't + call DeleteObject() on objects returned from SelectObject(). + + * platform/win/PasteboardWin.cpp: + (WebCore::Pasteboard::writeImage): + +2010-07-22 Lucas De Marchi <lucas.demarchi@profusion.mobi> + + Reviewed by Antonio Gomes. + + [EFL] Log function is incorrectly used. + r63804 used LOG function, but it should receive one more parameter. + Used LOG_ERROR instead, since this is an error message. + https://bugs.webkit.org/show_bug.cgi?id=42842 + + * platform/efl/WidgetEfl.cpp: + (WebCore::Widget::applyFallbackCursor): use LOG_ERROR in place of LOG + +2010-07-22 Kent Tamura <tkent@chromium.org> + + Reviewed by Ojan Vafai. + + Cancel button of search input field should fire input/change events + https://bugs.webkit.org/show_bug.cgi?id=34393 + + Test: fast/forms/search-cancel-button-events.html + + * rendering/TextControlInnerElements.cpp: + (WebCore::SearchFieldCancelButtonElement::defaultEventHandler): + +2010-07-22 Sam Weinig <sam@webkit.org> + + Reviewed by Maciej Stachowiak. + + Fix for <rdar://problem/8222626> + Send textDidChangeInTextField delegate callback only in response to typing or other forms of user text input. + + * GNUmakefile.am: + * WebCore.gypi: + * WebCore.pro: + * WebCore.vcproj/WebCore.vcproj: + * WebCore.xcodeproj/project.pbxproj: + Update project files. + + * dom/UserTypingGestureIndicator.cpp: Copied from dom/UserGestureIndicator.cpp. + (WebCore::UserTypingGestureIndicator::processingUserTypingGesture): + (WebCore::focusedNode): + (WebCore::UserTypingGestureIndicator::focusedElementAtGestureStart): + (WebCore::UserTypingGestureIndicator::UserTypingGestureIndicator): + (WebCore::UserTypingGestureIndicator::~UserTypingGestureIndicator): + * dom/UserTypingGestureIndicator.h: Copied from dom/UserGestureIndicator.h. + Version of UserGestureIndicator that just tracks keyboard gestures and the focused + node they were targeting. + + * editing/Editor.cpp: + (WebCore::Editor::confirmComposition): + (WebCore::Editor::setComposition): + * page/EventHandler.cpp: + (WebCore::EventHandler::keyEvent): + Put UserTypingGestureIndicator on the stack for user generated keyboard events. + +2010-07-22 Kent Tamura <tkent@chromium.org> + + Reviewed by Ojan Vafai. + + <input type=number> stepper buttons should dispatch input/change events + https://bugs.webkit.org/show_bug.cgi?id=42440 + + Test: fast/forms/input-number-events.html + + * html/HTMLInputElement.cpp: + (WebCore::HTMLInputElement::stepUpFromRenderer): + Sets a flag to dispatch 'change' event and dispatches 'input' event + if the value is changed. + +2010-07-22 Justin Schuh <jschuh@chromium.org> + + Reviewed by Adam Barth. + + Make history state methods validate against document URL + https://bugs.webkit.org/show_bug.cgi?id=42858 + + Test: fast/history/history-replace-illegal.html + + * page/History.cpp: + (WebCore::History::urlForState): + +2010-07-22 Andy Estes <aestes@apple.com> + + Reviewed by Maciej Stachowiak. + + When there are no beforeload listeners on a document, + HTMLLinkElement::process() should be called immediately when the node is + inserted into the document, rather than waiting until after attach is + performed. + <https://bugs.webkit.org/show_bug.cgi?id=42859> + <rdar://problem/8194528> + + No new tests. + + * html/HTMLLinkElement.cpp: + (WebCore::HTMLLinkElement::insertedIntoDocument): If there are no + beforeload listeners, call process() immediately. Otherwise, add it as + a post-attach callback. + +2010-07-22 James Robinson <jamesr@chromium.org> + + Reviewed by Simon Fraser. + + REGRESSION: box shadows on WebGL canvas elements repainted every frame + https://bugs.webkit.org/show_bug.cgi?id=42852 + + Avoid calling HTMLCanvasElement::willDraw() every time a WebGL canvas' + contents update. This call is only needed in the non-compositing + rendering path. + + Covered by fast/canvas/webgl/canvas-test.html + + * html/canvas/WebGLRenderingContext.cpp: + (WebCore::WebGLRenderingContext::markContextChanged): + (WebCore::WebGLRenderingContext::paintRenderingResultsToCanvas): + +2010-07-22 Patrick Gansterer <paroga@paroga.com> + + Reviewed by Ojan Vafai. + + Remove useless PlatformScrollBar + https://bugs.webkit.org/show_bug.cgi?id=41911 + + * WebCore.gypi: + * platform/win/PlatformScrollBar.h: Removed. + * platform/win/PlatformScrollBarWin.cpp: Removed. + +2010-07-22 Ryosuke Niwa <rniwa@webkit.org> + + Reviewed by Ojan Vafai. + + [Windows] Home hey doesn't work in first DIV inside a TABLE + https://bugs.webkit.org/show_bug.cgi?id=42767 + + The bug was caused by positionAvoidingFirstPositionInTable moving outside of the editing region. + Added a check so that it avoids the first position in the table only if the table is editable. + + Test: editing/selection/home-inside-noneditable-table.html + + * editing/visible_units.cpp: + (WebCore::positionAvoidingFirstPositionInTable): + +2010-07-22 Antonio Gomes <tonikitoo@webkit.org> + + Reviewed by Laszlo Gombos. + + Fix build warning for missing parentheses. + + WebCore/html/HTMLInputElement.cpp:113: warning: suggest parentheses around '&&' within '||' + + * html/HTMLInputElement.cpp: + (WebCore::isNumberCharacter): + +2010-07-22 John Gregg <johnnyg@google.com> + + Reviewed by Kent Tamura. + + [chromium] fast/forms/input-file-directory-upload.html fails on win after r63454 + https://bugs.webkit.org/show_bug.cgi?id=42768 + + Normalize path separators for the script API by convering \'s to /'s. + + Covered by input-file-directory-upload.html + + * html/HTMLInputElement.cpp: + (WebCore::HTMLInputElement::setFileListFromRenderer): + +2010-07-22 Dmitry Titov <dimich@chromium.org> + + Rubberstamped by Simon Fraser. + + * platform/PlatformStrategies.h: + (WebCore::PlatformStrategies::PlatformStrategies): Add initialization of m_localizationStrategy. + +2010-07-22 Dumitru Daniliuc <dumi@chromium.org> + + Reviewed by Ojan Vafai. + + Make db.changeVersion()'s third parameter optional, as required by the spec. + https://bugs.webkit.org/show_bug.cgi?id=42787 + + * bindings/js/JSDatabaseCustom.cpp: + (WebCore::JSDatabase::changeVersion): + * bindings/js/JSDatabaseSyncCustom.cpp: + (WebCore::JSDatabaseSync::changeVersion): + * bindings/v8/custom/V8DatabaseCustom.cpp: + (WebCore::V8Database::changeVersionCallback): + * bindings/v8/custom/V8DatabaseSyncCustom.cpp: + (WebCore::V8DatabaseSync::changeVersionCallback): + * storage/SQLTransaction.cpp: + (WebCore::SQLTransaction::deliverTransactionCallback): + * storage/SQLTransactionSync.cpp: + (WebCore::SQLTransactionSync::execute): + +2010-07-20 Jessie Berlin <jberlin@apple.com> + + Reviewed by Darin Adler. + + Code Generator: Allow negative and string constants. + Also add tests for hexadecimal numbers. + + * bindings/scripts/CodeGeneratorJS.pm: + If it is a string, do not try to cast it to an int. + + * bindings/scripts/IDLStructure.pm: + Add a regex just for constant values that allows strings, hexadecimal numbers, and integral numbers. + + * bindings/scripts/test/CPP/WebDOMTestObj.h: + Update the tests. + + * bindings/scripts/test/JS/JSTestObj.cpp: + Ditto. + + * bindings/scripts/test/JS/JSTestObj.h: + Ditto. + + * bindings/scripts/test/ObjC/DOMTestObj.h: + Ditto. + + * bindings/scripts/test/TestObj.idl: + Add tests for negative numbers, strings, and hexadecimal numbers. + + * bindings/scripts/test/V8/V8TestObj.cpp: + Update the tests. + +2010-07-22 Simon Fraser <simon.fraser@apple.com> + + Reviewed by Darin Adler. + + Composited layers don't scroll in WebKit2 + https://bugs.webkit.org/show_bug.cgi?id=42771 + + More prep work: make a single scrollPositionChanged() bottleneck method, and use it to + send the scroll event, repaint fixed elements, and update compositing layers. + + * page/FrameView.cpp: + (WebCore::FrameView::scrollPositionChangedViaPlatformWidget): + (WebCore::FrameView::scrollPositionChanged): + (WebCore::FrameView::repaintFixedElementsAfterScrolling): + (WebCore::FrameView::valueChanged): + * page/FrameView.h: + * platform/ScrollView.cpp: + (WebCore::ScrollView::valueChanged): + +2010-07-22 Sam Weinig <sam@webkit.org> + + Reviewed by Anders Carlsson. + + Patch for https://bugs.webkit.org/show_bug.cgi?id=42836 + Add localized strings stubs for WebKit2. + + - Convert WebKit (mac) to use a LocalizationStrategy rather than the WebCoreViewFactory + for localized strings. + + Gets us below 200 tests failing in WebKitTestRunner. + + * WebCore.exp.in: + * WebCore.xcodeproj/project.pbxproj: + * page/mac/WebCoreViewFactory.h: + * platform/LocalizationStrategy.h: Added. + (WebCore::LocalizationStrategy::~LocalizationStrategy): + * platform/PlatformStrategies.h: + (WebCore::PlatformStrategies::pluginStrategy): + (WebCore::PlatformStrategies::localizationStrategy): + (WebCore::PlatformStrategies::PlatformStrategies): + (WebCore::PlatformStrategies::~PlatformStrategies): + * platform/mac/LocalizedStringsMac.mm: + +2010-07-22 Andras Becsi <abecsi@webkit.org> + + Reviewed by Antonio Gomes. + + [Qt] Implement WebContext::applicationCacheDirectory() for the Qt port of WebKit2. + https://bugs.webkit.org/show_bug.cgi?id=42830 + + No new tests needed. + + * WebCore.pri: add ApplicationCacheStorage.h to wk2 headers + * WebCore.pro: add WebContextQt.cpp to sources + +2010-07-22 Joone Hur <joone.hur@samsung.com> + + Reviewed by Antonio Gomes. + + [EFL] add support for logging + https://bugs.webkit.org/show_bug.cgi?id=40807 + + Enable to turn log channels on for EFL port + + * platform/efl/LoggingEfl.cpp: + (WebCore::InitializeLoggingChannelsIfNecessary): + +2010-07-22 Balazs Kelemen <kb@inf.u-szeged.hu> + + Ureviewed build fix. + + [Qt] Fix WebKit2 build + + https://bugs.webkit.org/show_bug.cgi?id=42638 + + * WebCore.pri: + * WebCore.pro: + +2010-07-22 Andrey Kosyakov <caseq@chromium.org> + + Reviewed by Yury Semikhatsky. + + Web Inspector: Stop granting universal access to inspector front-end page. + https://bugs.webkit.org/show_bug.cgi?id=42817 + + * inspector/InspectorFrontendClientLocal.cpp: + (WebCore::InspectorFrontendClientLocal::windowObjectCleared): + +2010-07-22 Yury Semikhatsky <yurys@chromium.org> + + Unreviewed. Fix inspector console tests crashes. + + * bindings/v8/ScriptValue.cpp: + (WebCore::v8ToInspectorValue): + (WebCore::ScriptValue::toInspectorValue): enter v8 context before calling GetPropertyNames + +2010-07-22 Gyuyoung Kim <gyuyoung.kim@samsung.com> + + Unreviewed build fix. + + [EFL] Build break for SVN r63881 + https://bugs.webkit.org/show_bug.cgi?id=42813 + + * CMakeLists.txt: Add platform/SchemeRegistry.cpp + +2010-07-22 Hayato Ito <hayato@chromium.org> + + Reviewed by Darin Adler. + + Refactor CSSSelector's destructor and make it inline. + + https://bugs.webkit.org/show_bug.cgi?id=42726 + + Refactor with no behavior change, thus no new tests. + + * css/CSSSelector.cpp: + (WebCore::CSSSelectorBag::~CSSSelectorBag): Make sure the bag is empty. + (WebCore::CSSSelectorBag::add): Renamed from append(). + (WebCore::CSSSelector::releaseOwnedSelectorsToBag): + (WebCore::CSSSelector::deleteReachableSelectors): + * css/CSSSelector.h: + (WebCore::CSSSelector::~CSSSelector): + +2010-07-22 Yury Semikhatsky <yurys@chromium.org> + + Reviewed by Pavel Feldman. + + Web Inspector: should be possible to convert console message arguments to InspectorValues + https://bugs.webkit.org/show_bug.cgi?id=42457 + + Now it is possible to convert simple JavaScript objects to + InspectorValues. + + * bindings/js/ScriptValue.cpp: + (WebCore::jsToInspectorValue): + (WebCore::ScriptValue::toInspectorValue): + * bindings/js/ScriptValue.h: + * bindings/v8/ScriptValue.cpp: + (WebCore::v8ToInspectorValue): + (WebCore::ScriptValue::toInspectorValue): + * bindings/v8/ScriptValue.h: + * inspector/ConsoleMessage.cpp: console notifications are pushed to RemoteInspectorFrontend instead of InspectorFrontend. + (WebCore::ConsoleMessage::CallFrame::buildInspectorObject): + (WebCore::ConsoleMessage::addToFrontend): + (WebCore::ConsoleMessage::updateRepeatCountInConsole): + * inspector/ConsoleMessage.h: + * inspector/InjectedScript.cpp: + (WebCore::InjectedScript::wrapForConsole): return InspectorValue instead of SerializedScriptValue + * inspector/InjectedScript.h: + * inspector/Inspector.idl: + * inspector/InspectorBackend.cpp: + (WebCore::InspectorBackend::clearConsoleMessages): send response directly from the backend + (WebCore::InspectorBackend::remoteFrontend): + * inspector/InspectorBackend.h: + * inspector/InspectorController.cpp: + (WebCore::InspectorController::addConsoleMessage): + (WebCore::InspectorController::clearConsoleMessages): don't send notification to the front end, + it will be send either from InspectorBackend.cpp if it was a user request or reset message will + be send to the front end if the messages are cleared due to page navigation. + (WebCore::InspectorController::populateScriptObjects): + * inspector/front-end/ConsoleView.js: + * inspector/front-end/inspector.js: + +2010-07-22 Alexander Pavlov <apavlov@chromium.org> + + Reviewed by Pavel Feldman. + + Web Inspector: Modifying settings actually modifies defaultValues + https://bugs.webkit.org/show_bug.cgi?id=42816 + + Avoid using live modifiable objects as property default values. + + * inspector/front-end/Settings.js: + (WebInspector.Settings): + (WebInspector.Settings.prototype.reset): + (WebInspector.Settings.prototype._load): + (WebInspector.Settings.prototype.installSetting): + (WebInspector.Settings.prototype._get): + +2010-07-22 Ben Murdoch <benm@google.com> + + Reviewed by Simon Fraser. + + Touch events do not affect the :active CSS state + https://bugs.webkit.org/show_bug.cgi?id=39493 + + Clean the code up by using a typedef based on comments + post landing of the original patch. + + No change in functionality so no new tests. + + * rendering/HitTestRequest.h: Typedef the HitTestRequestType to unsigned. + * WebCore.exp.in: Update export signature. + * WebCore.order: Ditto. + * page/EventHandler.cpp: use the new typedef. + * page/EventHandler.h: ditto. + + +2010-07-22 Alexander Pavlov <apavlov@chromium.org> + + Reviewed by Pavel Feldman. + + Web Inspector: Rename method for CSS rule source range retrieval and fix return object format + https://bugs.webkit.org/show_bug.cgi?id=42379 + + * inspector/Inspector.idl: + * inspector/InspectorBackend.cpp: + (WebCore::InspectorBackend::getRuleRanges): + * inspector/InspectorBackend.h: + * inspector/InspectorBackend.idl: + * inspector/InspectorCSSStore.cpp: + (WebCore::InspectorCSSStore::getRuleRanges): + * inspector/InspectorCSSStore.h: + * inspector/InspectorDOMAgent.cpp: + (WebCore::InspectorDOMAgent::getRuleRanges): + * inspector/InspectorDOMAgent.h: + * inspector/front-end/DOMAgent.js: + +2010-07-21 Pavel Feldman <pfeldman@chromium.org> + + Reviewed by Yury Semikhatsky. + + Chromium Dev Tools: Separators are missing in the context menu. + + https://bugs.webkit.org/show_bug.cgi?id=42761 + + * bindings/js/JSInspectorFrontendHostCustom.cpp: + (WebCore::JSInspectorFrontendHost::showContextMenu): + * bindings/v8/custom/V8InspectorFrontendHostCustom.cpp: + (WebCore::V8InspectorFrontendHost::showContextMenuCallback): + * platform/ContextMenuItem.h: + (WebCore::): + +2010-07-22 Zoltan Herczeg <zherczeg@webkit.org> + + Reviewed by Nikolas Zimmermann. + + SVGFilterElement & SVGFE*Element don't support dynamic invalidation, when attributes change + https://bugs.webkit.org/show_bug.cgi?id=42244 + + Implementing svgAttributeChanged and childrenChanged for the base class of all filters, + called SVGFilterPrimitiveStandardAttributes. + + Tests: svg/dynamic-updates/SVGFilterPrimitiveStandardAttributes-dom-height-attr.html + svg/dynamic-updates/SVGFilterPrimitiveStandardAttributes-dom-result-attr.html + svg/dynamic-updates/SVGFilterPrimitiveStandardAttributes-dom-width-attr.html + svg/dynamic-updates/SVGFilterPrimitiveStandardAttributes-dom-x-attr.html + svg/dynamic-updates/SVGFilterPrimitiveStandardAttributes-dom-y-attr.html + svg/dynamic-updates/SVGFilterPrimitiveStandardAttributes-svgdom-height-prop.html + svg/dynamic-updates/SVGFilterPrimitiveStandardAttributes-svgdom-result-prop.html + svg/dynamic-updates/SVGFilterPrimitiveStandardAttributes-svgdom-width-prop.html + svg/dynamic-updates/SVGFilterPrimitiveStandardAttributes-svgdom-x-prop.html + svg/dynamic-updates/SVGFilterPrimitiveStandardAttributes-svgdom-y-prop.html + + * svg/SVGFilterPrimitiveStandardAttributes.cpp: + (WebCore::SVGFilterPrimitiveStandardAttributes::svgAttributeChanged): + (WebCore::SVGFilterPrimitiveStandardAttributes::childrenChanged): + * svg/SVGFilterPrimitiveStandardAttributes.h: + (WebCore::SVGFilterPrimitiveStandardAttributes::invalidateFilter): + +2010-07-22 Kent Tamura <tkent@chromium.org> + + Reviewed by Darin Adler. + + Small refactoring for input value sanitization + https://bugs.webkit.org/show_bug.cgi?id=42807 + + Rename some functions to clarify their roles. + + * dom/InputElement.cpp: + (WebCore::replaceEOLAndLimitLength): + Renamed from sanitizeUserInputValue(). + (WebCore::InputElement::sanitizeValueForTextField): + Renamed from sanitizeValue(), and call replaceEOLAndLimitLength() + instead of sanitizeUserInputValue(). + (WebCore::InputElement::sanitizeUserInputValue): + Just call replaceEOLAndLimitLength(). + (WebCore::InputElement::updateValueIfNeeded): + Use non-static sanitizeValue() for consistency. + * dom/InputElement.h: + * html/HTMLInputElement.cpp: + (WebCore::HTMLInputElement::setInputType): + Revert the change of r63876. It is not needed because of the + updateValueIfNeeded() change. + (WebCore::HTMLInputElement::sanitizeValue): + Apply the sanitizeValue() renaming. + +2010-07-22 Tony Gentilcore <tonyg@chromium.org> + + Reviewed by Darin Fisher. + + webkitPerformance.timing.responseEnd should not include document parse time + https://bugs.webkit.org/show_bug.cgi?id=42797 + + No new tests because timing based test would be flaky. + + * loader/FrameLoader.cpp: + (WebCore::FrameLoader::finishedLoading): finishedLoading() is called by the platform at the right time, but didReceiveData() synchronously invokes parsing without returning to the event loop prior to this. So by the time the didFinishLoading() method is executed, parsing is finished. The solution is to move this time to didReceiveData() prior to parsing. + * loader/MainResourceLoader.cpp: + (WebCore::MainResourceLoader::didReceiveData): Update the time each time didReceiveData() is called. + (WebCore::MainResourceLoader::didFinishLoading): When finished, and after parsing, set responseEnd appropriately. + * loader/MainResourceLoader.h: + * page/Timing.cpp: + (WebCore::Timing::resourceLoadTimeRelativeToAbsolute): Now that responseEnd is set correctly, it can be much shorter for very fast loads (like local files). This exposed the fact that this skew check was not tight enough. We need to make sure that the whole range of values from the ResourceLoadTiming API fit within fetchStart-responseEnd, not just that requestTime fits in this range. + +2010-07-21 Kent Tamura <tkent@chromium.org> + + Reviewed by Darin Adler. + + Assertion failure by changing the type of an input element with a + non-number value to 'range'. + https://bugs.webkit.org/show_bug.cgi?id=42643 + + Test: fast/forms/input-value-sanitization.html + + * html/HTMLInputElement.cpp: + (WebCore::HTMLInputElement::setInputType): + Update the value by HTMLInputElement::sanitizeValue() in a case that + storesValueSeparateFromAttribute() state is not changed. + +2010-07-21 Adam Barth <abarth@webkit.org> + + Reviewed by Eric Seidel. + + Implement spec changes for basefont and bgsound + https://bugs.webkit.org/show_bug.cgi?id=42792 + + * html/HTMLTreeBuilder.cpp: + (WebCore::HTMLTreeBuilder::processStartTagForInBody): + (WebCore::HTMLTreeBuilder::processStartTag): + (WebCore::HTMLTreeBuilder::processStartTagForInHead): + +2010-07-21 Adam Barth <abarth@webkit.org> + + Reviewed by Eric Seidel. + + Update a list of tags to match changes in the HTML5 spec + https://bugs.webkit.org/show_bug.cgi?id=42791 + + We need to atomize these strings at some point. + + * html/HTMLTreeBuilder.cpp: + (WebCore::HTMLTreeBuilder::processStartTagForInBody): + +2010-07-21 Adam Barth <abarth@webkit.org> + + Reviewed by Eric Seidel. + + HTMLTreeBuilder needs to update to match new spec behavior for <button> + https://bugs.webkit.org/show_bug.cgi?id=42233 + + The spec has some typos in this area, but this is my best guess for + what Ian means. I've filed bugs against the spec for each typo. + + * html/HTMLElementStack.cpp: + (WebCore::HTMLNames::isScopeMarker): + (WebCore::HTMLNames::isButtonScopeMarker): + (WebCore::HTMLElementStack::inButtonScope): + * html/HTMLElementStack.h: + * html/HTMLTreeBuilder.cpp: + (WebCore::HTMLTreeBuilder::processFakePEndTagIfPInButtonScope): + (WebCore::HTMLTreeBuilder::processCloseWhenNestedTag): + (WebCore::HTMLTreeBuilder::processStartTagForInBody): + (WebCore::HTMLTreeBuilder::processEndTagForInBody): + * html/HTMLTreeBuilder.h: + +2010-07-21 Justin Schuh <jschuh@chromium.org> + + Reviewed by Oliver Hunt. + + Prevent DeleteButtonController enable state from changing when not editing + https://bugs.webkit.org/show_bug.cgi?id=42659 + + Test: svg/custom/use-invalid-html.xhtml + + * dom/ContainerNode.cpp: + (WebCore::ContainerNode::cloneChildNodes): + +2010-07-21 Beth Dakin <bdakin@apple.com> + + Reviewed by Dan Bernstein. + + Fix for https://bugs.webkit.org/show_bug.cgi?id=42605 New border- + radius path-based drawing code has some issues with corner-joins + + GraphicsContext::clipConvexPolygon() now takes a boolean parameter + indicating whether or not the clip should be antialiased. + * platform/graphics/GraphicsContext.h: + * platform/graphics/cairo/GraphicsContextCairo.cpp: + (WebCore::GraphicsContext::clipConvexPolygon): + * platform/graphics/cg/GraphicsContextCG.cpp: + (WebCore::GraphicsContext::clipConvexPolygon): + * platform/graphics/haiku/GraphicsContextHaiku.cpp: + (WebCore::GraphicsContext::clipConvexPolygon): + * platform/graphics/qt/GraphicsContextQt.cpp: + (WebCore::GraphicsContext::clipConvexPolygon): + * platform/graphics/skia/GraphicsContextSkia.cpp: + (WebCore::GraphicsContext::clipConvexPolygon): + * platform/graphics/wince/GraphicsContextWince.cpp: + (WebCore::GraphicsContext::clipConvexPolygon): + * platform/graphics/wx/GraphicsContextWx.cpp: + (WebCore::GraphicsContext::clipConvexPolygon): + + Compute 4 booleans determining if each edge is a "matching" edge of + not. Send the two appropriate values to clipBorderSidePolygon() so + we can decide there whether or not to antialias the clip based on + matchy-ness. + * rendering/RenderBoxModelObject.cpp: + (WebCore::RenderBoxModelObject::paintBorder): + + If both edges are matching, don't antialias. If neither edge + matches, never antialias. If one edge matches and one does not, + apply two clips to get the appropriate antialiasing in each corner. + (WebCore::RenderBoxModelObject::clipBorderSidePolygon): + * rendering/RenderBoxModelObject.h: + +2010-07-21 Brady Eidson <beidson@apple.com> + + Reviewed by Geoffrey Garen. + + Break out "scheme registration" functionality from SecurityOrigin to a SchemeRegistry + https://bugs.webkit.org/show_bug.cgi?id=42783 + + No new tests. (No change in behavior) + + * GNUmakefile.am: + * WebCore.exp.in: + * WebCore.gypi: + * WebCore.pro: + * WebCore.vcproj/WebCore.vcproj: + * WebCore.xcodeproj/project.pbxproj: + + * loader/FrameLoader.cpp: + (WebCore::FrameLoader::isMixedContent): + (WebCore::FrameLoader::loadFrameRequest): + + * page/SecurityOrigin.cpp: + (WebCore::SecurityOrigin::SecurityOrigin): + (WebCore::SecurityOrigin::canLoad): + (WebCore::SecurityOrigin::isLocal): + * page/SecurityOrigin.h: + + * platform/SchemeRegistry.cpp: Added. + (WebCore::localSchemes): + (WebCore::secureSchemes): + (WebCore::schemesWithUniqueOrigins): + (WebCore::SchemeRegistry::registerURLSchemeAsLocal): + (WebCore::SchemeRegistry::removeURLSchemeRegisteredAsLocal): + (WebCore::SchemeRegistry::localURLSchemes): + (WebCore::SchemeRegistry::shouldTreatURLAsLocal): + (WebCore::SchemeRegistry::shouldTreatURLSchemeAsLocal): + (WebCore::SchemeRegistry::registerURLSchemeAsNoAccess): + (WebCore::SchemeRegistry::shouldTreatURLSchemeAsNoAccess): + (WebCore::SchemeRegistry::registerURLSchemeAsSecure): + (WebCore::SchemeRegistry::shouldTreatURLSchemeAsSecure): + * platform/SchemeRegistry.h: Added. + +2010-07-21 Chris Marrin <cmarrin@apple.com> + + Reviewed by Simon Fraser. + + Assertion failure in AnimationBase::updateStateMachine() coming out of paused state + https://bugs.webkit.org/show_bug.cgi?id=37993 + + Added logic to properly handle pausing and resuming when in the + AnimationStateStartWaitStyleAvailable state. This was causing an + assert when going out of the pause state because the paused flag + was not set. + + The fix is a straightforward implementation, going into a new + AnimationStatePausedWaitStyleAvailable state and setting the paused + flag (actually setting the m_pauseTime variable to something other + than -1). Also added handling of the new state, both when the + "style available" callback comes in while in this state and when + unpausing while in this state. + + For now a LayoutTest is not possible since there's no way to go in + and out of the pause state. I've opened https://bugs.webkit.org/show_bug.cgi?id=42790 + to track this. + + * page/animation/AnimationBase.cpp: + (WebCore::AnimationBase::updateStateMachine): + * page/animation/AnimationBase.h: + (WebCore::AnimationBase::): + 2010-07-21 Bo Liu <boliu@chromium.org> Reviewed by Darin Fisher. diff --git a/WebCore/Configurations/FeatureDefines.xcconfig b/WebCore/Configurations/FeatureDefines.xcconfig index 4b363aa..8e33a91 100644 --- a/WebCore/Configurations/FeatureDefines.xcconfig +++ b/WebCore/Configurations/FeatureDefines.xcconfig @@ -55,6 +55,7 @@ ENABLE_EVENTSOURCE = ENABLE_EVENTSOURCE; ENABLE_FILTERS = ENABLE_FILTERS; ENABLE_FILE_READER = ENABLE_FILE_READER; ENABLE_FILE_WRITER = ; +ENABLE_FILE_SYSTEM = ; ENABLE_GEOLOCATION = ENABLE_GEOLOCATION; ENABLE_ICONDATABASE = ENABLE_ICONDATABASE; ENABLE_IMAGE_RESIZER = ; @@ -85,4 +86,4 @@ ENABLE_XHTMLMP = ; ENABLE_XPATH = ENABLE_XPATH; ENABLE_XSLT = ENABLE_XSLT; -FEATURE_DEFINES = $(ENABLE_LINK_PREFETCH) $(ENABLE_3D_CANVAS) $(ENABLE_3D_RENDERING) $(ENABLE_BLOB_SLICE) $(ENABLE_CHANNEL_MESSAGING) $(ENABLE_CLIENT_BASED_GEOLOCATION) $(ENABLE_DATABASE) $(ENABLE_DATAGRID) $(ENABLE_DATALIST) $(ENABLE_DEVICE_ORIENTATION) $(ENABLE_DIRECTORY_UPLOAD) $(ENABLE_DOM_STORAGE) $(ENABLE_EVENTSOURCE) $(ENABLE_FILTERS) $(ENABLE_FILE_READER) $(ENABLE_FILE_WRITER) $(ENABLE_GEOLOCATION) $(ENABLE_ICONDATABASE) $(ENABLE_IMAGE_RESIZER) $(ENABLE_INDEXED_DATABASE) $(ENABLE_INPUT_SPEECH) $(ENABLE_JAVASCRIPT_DEBUGGER) $(ENABLE_MATHML) $(ENABLE_METER_TAG) $(ENABLE_NOTIFICATIONS) $(ENABLE_OFFLINE_WEB_APPLICATIONS) $(ENABLE_PROGRESS_TAG) $(ENABLE_RUBY) $(ENABLE_SANDBOX) $(ENABLE_SHARED_WORKERS) $(ENABLE_SVG) $(ENABLE_SVG_ANIMATION) $(ENABLE_SVG_AS_IMAGE) $(ENABLE_SVG_DOM_OBJC_BINDINGS) $(ENABLE_SVG_FONTS) $(ENABLE_SVG_FOREIGN_OBJECT) $(ENABLE_SVG_USE) $(ENABLE_VIDEO) $(ENABLE_WEB_SOCKETS) $(ENABLE_WEB_TIMING) $(ENABLE_WML) $(ENABLE_WORKERS) $(ENABLE_XHTMLMP) $(ENABLE_XPATH) $(ENABLE_XSLT); +FEATURE_DEFINES = $(ENABLE_LINK_PREFETCH) $(ENABLE_3D_CANVAS) $(ENABLE_3D_RENDERING) $(ENABLE_BLOB_SLICE) $(ENABLE_CHANNEL_MESSAGING) $(ENABLE_CLIENT_BASED_GEOLOCATION) $(ENABLE_DATABASE) $(ENABLE_DATAGRID) $(ENABLE_DATALIST) $(ENABLE_DEVICE_ORIENTATION) $(ENABLE_DIRECTORY_UPLOAD) $(ENABLE_DOM_STORAGE) $(ENABLE_EVENTSOURCE) $(ENABLE_FILTERS) $(ENABLE_FILE_READER) $(ENABLE_FILE_WRITER) $(ENABLE_FILE_SYSTEM) $(ENABLE_GEOLOCATION) $(ENABLE_ICONDATABASE) $(ENABLE_IMAGE_RESIZER) $(ENABLE_INDEXED_DATABASE) $(ENABLE_INPUT_SPEECH) $(ENABLE_JAVASCRIPT_DEBUGGER) $(ENABLE_MATHML) $(ENABLE_METER_TAG) $(ENABLE_NOTIFICATIONS) $(ENABLE_OFFLINE_WEB_APPLICATIONS) $(ENABLE_PROGRESS_TAG) $(ENABLE_RUBY) $(ENABLE_SANDBOX) $(ENABLE_SHARED_WORKERS) $(ENABLE_SVG) $(ENABLE_SVG_ANIMATION) $(ENABLE_SVG_AS_IMAGE) $(ENABLE_SVG_DOM_OBJC_BINDINGS) $(ENABLE_SVG_FONTS) $(ENABLE_SVG_FOREIGN_OBJECT) $(ENABLE_SVG_USE) $(ENABLE_VIDEO) $(ENABLE_WEB_SOCKETS) $(ENABLE_WEB_TIMING) $(ENABLE_WML) $(ENABLE_WORKERS) $(ENABLE_XHTMLMP) $(ENABLE_XPATH) $(ENABLE_XSLT); diff --git a/WebCore/Configurations/Version.xcconfig b/WebCore/Configurations/Version.xcconfig index 2749545..c1b6b32 100644 --- a/WebCore/Configurations/Version.xcconfig +++ b/WebCore/Configurations/Version.xcconfig @@ -22,7 +22,7 @@ // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. MAJOR_VERSION = 534; -MINOR_VERSION = 3; +MINOR_VERSION = 4; TINY_VERSION = 0; FULL_VERSION = $(MAJOR_VERSION).$(MINOR_VERSION); diff --git a/WebCore/DerivedSources.cpp b/WebCore/DerivedSources.cpp index 78c523f..ea6e47e 100644 --- a/WebCore/DerivedSources.cpp +++ b/WebCore/DerivedSources.cpp @@ -190,7 +190,6 @@ #include "JSImageData.cpp" #include "JSIndexedDatabaseRequest.cpp" #include "JSInjectedScriptHost.cpp" -#include "JSInspectorBackend.cpp" #include "JSInspectorFrontendHost.cpp" #include "JSJavaScriptCallFrame.cpp" #include "JSKeyboardEvent.cpp" diff --git a/WebCore/DerivedSources.make b/WebCore/DerivedSources.make index 7c53e86..3b0f38d 100644 --- a/WebCore/DerivedSources.make +++ b/WebCore/DerivedSources.make @@ -233,7 +233,6 @@ DOM_CLASSES = \ ImageData \ IndexedDatabaseRequest \ InjectedScriptHost \ - InspectorBackend \ InspectorFrontendHost \ KeyboardEvent \ Location \ @@ -477,10 +476,16 @@ INSPECTOR_CLASSES = Inspector JS_DOM_HEADERS=$(filter-out JSEventListener.h JSEventTarget.h,$(DOM_CLASSES:%=JS%.h) $(INSPECTOR_CLASSES:%=Remote%Frontend.h)) +WEB_DOM_HEADERS := +ifeq ($(findstring BUILDING_WX,$(FEATURE_DEFINES)), BUILDING_WX) +WEB_DOM_HEADERS := $(filter-out WebDOMXSLTProcessor.h,$(DOM_CLASSES:%=WebDOM%.h)) +endif # BUILDING_WX + all : \ remove-stray-plugin-and-mime-type-files \ \ $(JS_DOM_HEADERS) \ + $(WEB_DOM_HEADERS) \ \ JSJavaScriptCallFrame.h \ \ @@ -813,6 +818,13 @@ Remote%Frontend.h : %.idl $(INSPECTOR_GENERATOR_SCRIPTS) -include $(JS_DOM_HEADERS:.h=.dep) +ifeq ($(findstring BUILDING_WX,$(FEATURE_DEFINES)), BUILDING_WX) +CPP_BINDINGS_SCRIPTS = $(GENERATE_SCRIPTS) bindings/scripts/CodeGeneratorCPP.pm + +WebDOM%.h : %.idl $(CPP_BINDINGS_SCRIPTS) + $(call generator_script, $(CPP_BINDINGS_SCRIPTS)) $(IDL_COMMON_ARGS) --defines "$(FEATURE_DEFINES) $(ADDITIONAL_IDL_DEFINES) LANGUAGE_CPP" --generator CPP $< +endif # BUILDING_WX + # ------------------------ # Mac-specific rules diff --git a/WebCore/ForwardingHeaders/wtf/BumpPointerAllocator.h b/WebCore/ForwardingHeaders/wtf/BumpPointerAllocator.h new file mode 100644 index 0000000..25acbf4 --- /dev/null +++ b/WebCore/ForwardingHeaders/wtf/BumpPointerAllocator.h @@ -0,0 +1,4 @@ +#ifndef WebCore_FWD_BumpPointerAllocator_h +#define WebCore_FWD_BumpPointerAllocator_h +#include <JavaScriptCore/BumpPointerAllocator.h> +#endif diff --git a/WebCore/ForwardingHeaders/wtf/PageAllocation.h b/WebCore/ForwardingHeaders/wtf/PageAllocation.h new file mode 100644 index 0000000..6471b73 --- /dev/null +++ b/WebCore/ForwardingHeaders/wtf/PageAllocation.h @@ -0,0 +1,4 @@ +#ifndef WebCore_FWD_PageAllocation_h +#define WebCore_FWD_PageAllocation_h +#include <JavaScriptCore/PageAllocation.h> +#endif diff --git a/WebCore/GNUmakefile.am b/WebCore/GNUmakefile.am index 2aac9a1..8389ed6 100644 --- a/WebCore/GNUmakefile.am +++ b/WebCore/GNUmakefile.am @@ -1,6 +1,3 @@ - -WebCore := $(srcdir)/WebCore - FEATURE_DEFINES := SVG_FEATURES := HTML_FEATURES := @@ -86,8 +83,7 @@ webcoregtk_cppflags += \ webcore_built_nosources += \ DerivedSources/WebCore/DocTypeStrings.cpp \ DerivedSources/WebCore/tokenizer.cpp \ - DerivedSources/WebCore/ColorData.cpp \ - DerivedSources/webkit/webkitdomdummy.c + DerivedSources/WebCore/ColorData.cpp webcore_built_sources += \ DerivedSources/WebCore/CSSGrammar.cpp \ @@ -99,6 +95,8 @@ webcore_built_sources += \ DerivedSources/WebCore/HTMLEntityNames.cpp \ DerivedSources/WebCore/HTMLNames.cpp \ DerivedSources/WebCore/HTMLNames.h \ + DerivedSources/WebCore/InspectorBackendDispatcher.cpp \ + DerivedSources/WebCore/InspectorBackendDispatcher.h \ DerivedSources/WebCore/JSAbstractWorker.cpp \ DerivedSources/WebCore/JSAbstractWorker.h \ DerivedSources/WebCore/JSArrayBuffer.cpp \ @@ -394,8 +392,6 @@ webcore_built_sources += \ DerivedSources/WebCore/JSImageData.h \ DerivedSources/WebCore/JSInjectedScriptHost.cpp \ DerivedSources/WebCore/JSInjectedScriptHost.h \ - DerivedSources/WebCore/JSInspectorBackend.cpp \ - DerivedSources/WebCore/JSInspectorBackend.h \ DerivedSources/WebCore/JSInspectorFrontendHost.cpp \ DerivedSources/WebCore/JSInspectorFrontendHost.h \ DerivedSources/WebCore/JSInt16Array.cpp \ @@ -1164,6 +1160,8 @@ webcore_sources += \ WebCore/dom/UIEventWithKeyState.h \ WebCore/dom/UserGestureIndicator.cpp \ WebCore/dom/UserGestureIndicator.h \ + WebCore/dom/UserTypingGestureIndicator.cpp \ + WebCore/dom/UserTypingGestureIndicator.h \ WebCore/dom/ViewportArguments.cpp \ WebCore/dom/ViewportArguments.h \ WebCore/dom/WebKitAnimationEvent.cpp \ @@ -1647,6 +1645,7 @@ webcore_sources += \ WebCore/loader/CrossOriginPreflightResultCache.h \ WebCore/loader/DocLoader.cpp \ WebCore/loader/DocLoader.h \ + WebCore/loader/DocumentLoadTiming.h \ WebCore/loader/DocumentLoader.cpp \ WebCore/loader/DocumentLoader.h \ WebCore/loader/DocumentThreadableLoader.cpp \ @@ -1915,6 +1914,8 @@ webcore_sources += \ WebCore/platform/ScrollTypes.h \ WebCore/platform/ScrollView.cpp \ WebCore/platform/ScrollView.h \ + WebCore/platform/SchemeRegistry.cpp \ + WebCore/platform/SchemeRegistry.h \ WebCore/platform/Scrollbar.cpp \ WebCore/platform/Scrollbar.h \ WebCore/platform/ScrollbarClient.h \ @@ -2154,9 +2155,9 @@ webcore_sources += \ WebCore/plugins/PluginQuirkSet.h \ WebCore/plugins/PluginStream.cpp \ WebCore/plugins/PluginStream.h \ - WebCore/plugins/PluginWidget.h \ WebCore/plugins/PluginView.cpp \ WebCore/plugins/PluginView.h \ + WebCore/plugins/PluginViewBase.h \ WebCore/plugins/npapi.cpp \ WebCore/plugins/npfunctions.h \ WebCore/rendering/AutoTableLayout.cpp \ @@ -2275,6 +2276,7 @@ webcore_sources += \ WebCore/rendering/RenderScrollbarPart.h \ WebCore/rendering/RenderScrollbarTheme.cpp \ WebCore/rendering/RenderScrollbarTheme.h \ + WebCore/rendering/RenderSVGResourceContainer.cpp \ WebCore/rendering/RenderSVGResourceContainer.h \ WebCore/rendering/RenderSelectionInfo.h \ WebCore/rendering/RenderSlider.cpp \ @@ -2938,6 +2940,14 @@ webcore_sources += \ endif # END ENABLE_DOM_STORAGE # ---- +# HTML5 FileSystem API support +# ---- +if ENABLE_FILE_SYSTEM +FEATURE_DEFINES += ENABLE_FILE_SYSTEM=1 +webcore_cppflags += -DENABLE_FILE_SYSTEM=1 +endif # END ENABLE_FILE_SYSTEM + +# ---- # Speech Input API support # ---- if ENABLE_INPUT_SPEECH @@ -2949,7 +2959,6 @@ webcore_sources += \ WebCore/page/SpeechInput.cpp \ WebCore/page/SpeechInput.h \ WebCore/page/SpeechInputClient.h \ - WebCore/page/SpeechInputClientListener.h \ WebCore/page/SpeechInputListener.h else @@ -3829,6 +3838,12 @@ webcore_sources += \ WebCore/rendering/SVGRenderSupport.h \ WebCore/rendering/SVGRenderTreeAsText.cpp \ WebCore/rendering/SVGRenderTreeAsText.h \ + WebCore/rendering/SVGResources.cpp \ + WebCore/rendering/SVGResources.h \ + WebCore/rendering/SVGResourcesCache.cpp \ + WebCore/rendering/SVGResourcesCache.h \ + WebCore/rendering/SVGResourcesCycleSolver.cpp \ + WebCore/rendering/SVGResourcesCycleSolver.h \ WebCore/rendering/SVGRootInlineBox.cpp \ WebCore/rendering/SVGRootInlineBox.h \ WebCore/rendering/SVGShadowTreeElements.cpp \ @@ -4392,8 +4407,8 @@ DerivedSources/WebCore/XMLNSNames.cpp DerivedSources/WebCore/XMLNSNames.h: $(Web DerivedSources/WebCore/XMLNames.cpp DerivedSources/WebCore/XMLNames.h: $(WebCore)/dom/make_names.pl $(WebCore)/xml/xmlattrs.in $(AM_V_GEN)$(PERL) -I$(WebCore)/bindings/scripts $< --attrs $(WebCore)/xml/xmlattrs.in --outputDir "$(GENSOURCES_WEBCORE)" -# Remote Inspector frontend -DerivedSources/WebCore/RemoteInspectorFrontend.cpp DerivedSources/WebCore/RemoteInspectorFrontend.h: $(WebCore)/inspector/Inspector.idl $(SCRIPTS_BINDINGS) $(WebCore)/inspector/CodeGeneratorInspector.pm +# RemoteInspectorFrontend and InspectorBackendDispatcher +DerivedSources/WebCore/RemoteInspectorFrontend.cpp DerivedSources/WebCore/RemoteInspectorFrontend.h DerivedSources/WebCore/InspectorBackendDispatcher.cpp DerivedSources/WebCore/InspectorBackendDispatcher.h: $(WebCore)/inspector/Inspector.idl $(SCRIPTS_BINDINGS) $(WebCore)/inspector/CodeGeneratorInspector.pm $(AM_V_GEN)$(PERL) -I$(WebCore)/bindings/scripts -I$(WebCore)/inspector $(WebCore)/bindings/scripts/generate-bindings.pl $(IDL_PATH:%=--include "%") --outputDir "$(GENSOURCES_WEBCORE)" --defines "LANGUAGE_JAVASCRIPT=1 $(FEATURE_DEFINES)" --generator Inspector $< IDL_PATH := \ @@ -4421,197 +4436,6 @@ DerivedSources/WebCore/JS%.h: DerivedSources/WebCore/JS%.cpp; DerivedSources/WebCore/JS%.cpp: %.idl $(SCRIPTS_BINDINGS) $(WebCore)/bindings/scripts/CodeGeneratorJS.pm $(AM_V_GEN)$(PERL) -I$(WebCore)/bindings/scripts $(WebCore)/bindings/scripts/generate-bindings.pl $(IDL_PATH:%=--include "%") --outputDir "$(GENSOURCES_WEBCORE)" --defines "LANGUAGE_JAVASCRIPT=1 $(FEATURE_DEFINES)" --generator JS $< -DerivedSources/webkit/webkitdomdummy.c: - $(AM_V_GEN)mkdir -p DerivedSources/webkit || echo > $@ - -# Because WebCore/bindings/gobject/WebKitDOMObject.h is static source but is also a distributed header -# required by other distributed headers (both static and auto-generated), need to move this to the -# DerivedSources/webkit directory. The reason is that we want all header files distributed in the -# include/webkit-x.y/webkit directory, but do not want to name the WebCore/bindings/gobject directory -# "webkit", as that's a bit presumptuous for a GTK binding. -$(top_builddir)/DerivedSources/webkit/WebKitDOMObject.h: $(WebCore)/bindings/gobject/WebKitDOMObject.h - $(AM_V_GEN)cp -f $< $@ - -$(top_builddir)/DerivedSources/webkit/WebKitDOMEventTarget.h: $(WebCore)/bindings/gobject/WebKitDOMEventTarget.h - $(AM_V_GEN)cp -f $< $@ - -# Start with a subset of all the DOM bindings -IDL_BINDINGS_GDOM += \ - WebCore/css/CSSRule.idl \ - WebCore/css/CSSRuleList.idl \ - WebCore/css/CSSStyleDeclaration.idl \ - WebCore/css/CSSStyleSheet.idl \ - WebCore/css/CSSValue.idl \ - WebCore/css/MediaList.idl \ - WebCore/css/StyleMedia.idl \ - WebCore/css/StyleSheet.idl \ - WebCore/css/StyleSheetList.idl \ - WebCore/dom/Attr.idl \ - WebCore/dom/CDATASection.idl \ - WebCore/dom/CharacterData.idl \ - WebCore/dom/Comment.idl \ - WebCore/dom/Document.idl \ - WebCore/dom/DocumentFragment.idl \ - WebCore/dom/DocumentType.idl \ - WebCore/dom/DOMImplementation.idl \ - WebCore/dom/DOMStringList.idl \ - WebCore/dom/DOMStringMap.idl \ - WebCore/dom/Element.idl \ - WebCore/dom/EntityReference.idl \ - WebCore/dom/Event.idl \ - WebCore/dom/MessagePort.idl \ - WebCore/dom/NamedNodeMap.idl \ - WebCore/dom/Node.idl \ - WebCore/dom/NodeFilter.idl \ - WebCore/dom/NodeIterator.idl \ - WebCore/dom/NodeList.idl \ - WebCore/dom/ProcessingInstruction.idl \ - WebCore/dom/Range.idl \ - WebCore/dom/Text.idl \ - WebCore/dom/TreeWalker.idl \ - WebCore/html/Blob.idl \ - WebCore/html/File.idl \ - WebCore/html/FileList.idl \ - WebCore/html/HTMLAnchorElement.idl \ - WebCore/html/HTMLAppletElement.idl \ - WebCore/html/HTMLAreaElement.idl \ - WebCore/html/HTMLBaseElement.idl \ - WebCore/html/HTMLBaseFontElement.idl \ - WebCore/html/HTMLBlockquoteElement.idl \ - WebCore/html/HTMLBodyElement.idl \ - WebCore/html/HTMLBRElement.idl \ - WebCore/html/HTMLButtonElement.idl \ - WebCore/html/HTMLCanvasElement.idl \ - WebCore/html/HTMLCollection.idl \ - WebCore/html/HTMLDirectoryElement.idl \ - WebCore/html/HTMLDivElement.idl \ - WebCore/html/HTMLDListElement.idl \ - WebCore/html/HTMLDocument.idl \ - WebCore/html/HTMLElement.idl \ - WebCore/html/HTMLEmbedElement.idl \ - WebCore/html/HTMLFieldSetElement.idl \ - WebCore/html/HTMLFontElement.idl \ - WebCore/html/HTMLFormElement.idl \ - WebCore/html/HTMLFrameElement.idl \ - WebCore/html/HTMLFrameSetElement.idl \ - WebCore/html/HTMLHeadElement.idl \ - WebCore/html/HTMLHeadingElement.idl \ - WebCore/html/HTMLHRElement.idl \ - WebCore/html/HTMLHtmlElement.idl \ - WebCore/html/HTMLIFrameElement.idl \ - WebCore/html/HTMLImageElement.idl \ - WebCore/html/HTMLInputElement.idl \ - WebCore/html/HTMLIsIndexElement.idl \ - WebCore/html/HTMLLabelElement.idl \ - WebCore/html/HTMLLegendElement.idl \ - WebCore/html/HTMLLIElement.idl \ - WebCore/html/HTMLLinkElement.idl \ - WebCore/html/HTMLMapElement.idl \ - WebCore/html/HTMLMarqueeElement.idl \ - WebCore/html/HTMLMenuElement.idl \ - WebCore/html/HTMLMetaElement.idl \ - WebCore/html/HTMLModElement.idl \ - WebCore/html/HTMLObjectElement.idl \ - WebCore/html/HTMLOListElement.idl \ - WebCore/html/HTMLOptGroupElement.idl \ - WebCore/html/HTMLOptionElement.idl \ - WebCore/html/HTMLOptionsCollection.idl \ - WebCore/html/HTMLParagraphElement.idl \ - WebCore/html/HTMLParamElement.idl \ - WebCore/html/HTMLPreElement.idl \ - WebCore/html/HTMLQuoteElement.idl \ - WebCore/html/HTMLScriptElement.idl \ - WebCore/html/HTMLSelectElement.idl \ - WebCore/html/HTMLStyleElement.idl \ - WebCore/html/HTMLTableElement.idl \ - WebCore/html/HTMLTableCaptionElement.idl \ - WebCore/html/HTMLTableColElement.idl \ - WebCore/html/HTMLTableSectionElement.idl \ - WebCore/html/HTMLTableCellElement.idl \ - WebCore/html/HTMLTextAreaElement.idl \ - WebCore/html/HTMLTitleElement.idl \ - WebCore/html/HTMLTableRowElement.idl \ - WebCore/html/HTMLUListElement.idl \ - WebCore/html/ValidityState.idl \ - WebCore/loader/appcache/DOMApplicationCache.idl \ - WebCore/page/BarInfo.idl \ - WebCore/page/Console.idl \ - WebCore/page/DOMWindow.idl \ - WebCore/page/DOMSelection.idl \ - WebCore/page/History.idl \ - WebCore/page/Location.idl \ - WebCore/page/MemoryInfo.idl \ - WebCore/page/Navigator.idl \ - WebCore/page/Screen.idl \ - WebCore/page/WebKitPoint.idl \ - WebCore/plugins/DOMMimeType.idl \ - WebCore/plugins/DOMMimeTypeArray.idl \ - WebCore/plugins/DOMPlugin.idl \ - WebCore/plugins/DOMPluginArray.idl \ - WebCore/storage/Database.idl \ - WebCore/storage/Storage.idl \ - WebCore/xml/XPathExpression.idl \ - WebCore/xml/XPathNSResolver.idl \ - WebCore/xml/XPathResult.idl - -if ENABLE_GEOLOCATION -IDL_BINDINGS_GDOM += \ - WebCore/page/Geolocation.idl -endif # END ENABLE_GEOLOCATION - - -# All classes autogenerated in the GObject DOM bindings -GDOM_AUTO_CLASSES += $(basename $(notdir $(IDL_BINDINGS_GDOM))) - -# The classes implemented manually -GDOM_FIXED_CLASSES += Object EventTarget - -GDOM_CLASSES += $(GDOM_AUTO_CLASSES) $(GDOM_FIXED_CLASSES) - -# Filter out SVG for now -FEATURE_DEFINES_GDOM := $(filter-out ENABLE-SVG%, $(FEATURE_DEFINES)) - -# Autogenerated header files -GDOM_HEADERS_BUILT += $(patsubst %,$(top_builddir)/DerivedSources/webkit/WebKitDOM%.h,$(GDOM_AUTO_CLASSES)) \ - $(top_builddir)/DerivedSources/webkit/webkitdom.h \ - $(top_builddir)/DerivedSources/webkit/webkitdomdefines.h \ - $(top_builddir)/DerivedSources/webkit/WebKitDOMEventTarget.h \ - $(top_builddir)/DerivedSources/webkit/WebKitDOMObject.h - -# Autogenerated source files -GDOM_SOURCES_BUILT := $(patsubst %,DerivedSources/webkit/WebKitDOM%.cpp,$(GDOM_AUTO_CLASSES)) - -# Hand-coded header files -GDOM_HEADERS_FIXED += $(patsubst %,$(srcdir)/WebCore/bindings/gobject/WebKitDOM%.h,$(GDOM_FIXED_CLASSES)) - -# All header files that get installed -libgdom_h_api += $(GDOM_HEADERS_FIXED) $(GDOM_HEADERS_BUILT) - -DerivedSources/webkit/webkitdom.h: $(WebCore)/bindings/scripts/gobject-generate-headers.pl $(WebCore)/GNUmakefile.am - $(AM_V_GEN)echo $(GDOM_CLASSES) | $(PERL) $< gdom > $@ - -DerivedSources/webkit/webkitdomdefines.h: $(WebCore)/bindings/scripts/gobject-generate-headers.pl $(IDL_BINDINGS_GDOM) $(WebCore)/GNUmakefile.am - $(AM_V_GEN)echo $(GDOM_CLASSES) | $(PERL) $< defines > $@ - -DerivedSources/webkit/WebKitDOM%.h: DerivedSources/webkit/WebKitDOM%.cpp; - -DerivedSources/webkit/WebKitDOM%.cpp: %.idl $(SCRIPTS_BINDINGS) $(WebCore)/bindings/scripts/CodeGeneratorGObject.pm $(webcoregtk_dom_sources) - $(AM_V_GEN)$(PERL) -I$(WebCore)/bindings/scripts $(WebCore)/bindings/scripts/generate-bindings.pl --include $(WebCore)/dom --include $(WebCore)/html --include $(WebCore)/css --include $(WebCore)/page --include $(WebCore)/xml --include $(WebCore)/svg --outputDir "$(GENSOURCES_WEBKIT)" --defines "LANGUAGE_GOBJECT=1 $(FEATURE_DEFINES_GDOM)" --generator GObject $< - -gdom_built_nosources := $(GDOM_HEADERS_BUILT) $(GDOM_SOURCES_BUILT) - -libgdom_objects := $(subst .cpp,.lo,$(GDOM_SOURCES_BUILT)) -libgdom_depfiles := $(patsubst %.lo,$(top_builddir)/DerivedSources/webkit/$(DEPDIR)/%.Plo,$(notdir $(libgdom_objects))) -libgdom_depfiles += $(patsubst %.h,$(WebCore)/bindings/gobject/$(DEPDIR)/%.Plo,$(notdir $(GDOM_HEADERS_FIXED))) - --include $(libgdom_depfiles) - -$(libgdom_objects): AM_CPPFLAGS+=$(libwebkitgtk_@WEBKITGTK_API_MAJOR_VERSION@_@WEBKITGTK_API_MINOR_VERSION@_la_CPPFLAGS) -$(libgdom_objects): AM_CXXFLAGS+=$(libwebkitgtk_@WEBKITGTK_API_MAJOR_VERSION@_@WEBKITGTK_API_MINOR_VERSION@_la_CXXFLAGS) - -libgdom.la: $(libgdom_objects) - $(CXXLINK) $(libgdom_objects) $(LIBS) - EXTRA_DIST += \ $(shell ls $(srcdir)/WebCore/css/*.idl) \ $(shell ls $(srcdir)/WebCore/dom/*.idl) \ diff --git a/WebCore/WebCore.exp.in b/WebCore/WebCore.exp.in index cf66285..c1079d5 100644 --- a/WebCore/WebCore.exp.in +++ b/WebCore/WebCore.exp.in @@ -215,8 +215,9 @@ __ZN7WebCore12EventHandler14currentNSEventEv __ZN7WebCore12EventHandler14scrollOverflowENS_15ScrollDirectionENS_17ScrollGranularityEPNS_4NodeE __ZN7WebCore12EventHandler15sendScrollEventEv __ZN7WebCore12EventHandler16handleWheelEventERNS_18PlatformWheelEventE +__ZN7WebCore12EventHandler17scrollRecursivelyENS_15ScrollDirectionENS_17ScrollGranularityEPNS_4NodeE __ZN7WebCore12EventHandler20handleTextInputEventERKNS_6StringEPNS_5EventEbb -__ZN7WebCore12EventHandler20hitTestResultAtPointERKNS_8IntPointEbbNS_17HitTestScrollbarsEi +__ZN7WebCore12EventHandler20hitTestResultAtPointERKNS_8IntPointEbbNS_17HitTestScrollbarsEj __ZN7WebCore12EventHandler21handleMousePressEventERKNS_18PlatformMouseEventE __ZN7WebCore12EventHandler23handleMouseReleaseEventERKNS_18PlatformMouseEventE __ZN7WebCore12EventHandler27capsLockStateMayHaveChangedEv @@ -284,6 +285,7 @@ __ZN7WebCore13HitTestResultC1ERKS0_ __ZN7WebCore13HitTestResultD1Ev __ZN7WebCore13IdentifierRep3getEPKc __ZN7WebCore13IdentifierRep3getEi +__ZN7WebCore13JSHTMLElement6s_infoE __ZN7WebCore13KeyboardEventC1ERKNS_12AtomicStringEbbPNS_9DOMWindowERKNS_6StringEjbbbbb __ZN7WebCore13TypingCommand39insertParagraphSeparatorInQuotedContentEPNS_8DocumentE __ZN7WebCore13toDeviceSpaceERKNS_9FloatRectEP8NSWindow @@ -310,11 +312,12 @@ __ZN7WebCore14ResourceHandle20forceContentSniffingEv __ZN7WebCore14ResourceLoader14cancelledErrorEv __ZN7WebCore14ResourceLoader19setShouldBufferDataEb __ZN7WebCore14SVGSMILElement13isSMILElementEPNS_4NodeE +__ZN7WebCore14SchemeRegistry24registerURLSchemeAsLocalERKNS_6StringE +__ZN7WebCore14SchemeRegistry25registerURLSchemeAsSecureERKNS_6StringE +__ZN7WebCore14SchemeRegistry32registerURLSchemeAsEmptyDocumentERKNS_6StringE __ZN7WebCore14SecurityOrigin16createFromStringERKNS_6StringE __ZN7WebCore14SecurityOrigin18setLocalLoadPolicyENS0_15LocalLoadPolicyE __ZN7WebCore14SecurityOrigin18shouldHideReferrerERKNS_4KURLERKNS_6StringE -__ZN7WebCore14SecurityOrigin24registerURLSchemeAsLocalERKNS_6StringE -__ZN7WebCore14SecurityOrigin25registerURLSchemeAsSecureERKNS_6StringE __ZN7WebCore14SecurityOrigin27resetOriginAccessWhitelistsEv __ZN7WebCore14SecurityOrigin29addOriginAccessWhitelistEntryERKS0_RKNS_6StringES5_b __ZN7WebCore14SecurityOrigin32removeOriginAccessWhitelistEntryERKS0_RKNS_6StringES5_b @@ -406,6 +409,7 @@ __ZN7WebCore17nameForCursorTypeENS_6Cursor4TypeE __ZN7WebCore17openTemporaryFileEPKcRi __ZN7WebCore18deprecatedParseURLERKNS_6StringE __ZN7WebCore18isStartOfParagraphERKNS_15VisiblePositionE +__ZN7WebCore18pluginScriptObjectEPN3JSC9ExecStateEPNS_13JSHTMLElementE __ZN7WebCore19AnimationController16resumeAnimationsEPNS_8DocumentE __ZN7WebCore19AnimationController17suspendAnimationsEPNS_8DocumentE __ZN7WebCore19AnimationController20pauseAnimationAtTimeEPNS_12RenderObjectERKNS_6StringEd @@ -450,6 +454,7 @@ __ZN7WebCore21reportThreadViolationEPKcNS_20ThreadViolationRoundE __ZN7WebCore21setPlatformStrategiesEPNS_18PlatformStrategiesE __ZN7WebCore22ScriptExecutionContext26canSuspendActiveDOMObjectsEv __ZN7WebCore22applicationIsAppleMailEv +__ZN7WebCore22contextMenuItemTagBoldEv __ZN7WebCore22counterValueForElementEPNS_7ElementE __ZN7WebCore22createFragmentFromTextEPNS_5RangeERKNS_6StringE __ZN7WebCore22externalRepresentationEPNS_5FrameEj @@ -461,6 +466,8 @@ __ZN7WebCore23ApplicationCacheStorage5emptyEv __ZN7WebCore23ReplaceSelectionCommandC1EPNS_8DocumentEN3WTF10PassRefPtrINS_16DocumentFragmentEEEbbbbbNS_10EditActionE __ZN7WebCore23createFragmentFromNodesEPNS_8DocumentERKN3WTF6VectorIPNS_4NodeELm0EEE __ZN7WebCore24BinaryPropertyListWriter17writePropertyListEv +__ZN7WebCore24contextMenuItemTagItalicEv +__ZN7WebCore24contextMenuItemTagStylesEv __ZN7WebCore24createFragmentFromMarkupEPNS_8DocumentERKNS_6StringES4_NS_27FragmentScriptingPermissionE __ZN7WebCore24decodeURLEscapeSequencesERKNS_6StringE __ZN7WebCore24notifyHistoryItemChangedE @@ -474,21 +481,55 @@ __ZN7WebCore25PluginMainThreadScheduler12scheduleCallEP4_NPPPFvPvES3_ __ZN7WebCore25PluginMainThreadScheduler14registerPluginEP4_NPP __ZN7WebCore25PluginMainThreadScheduler16unregisterPluginEP4_NPP __ZN7WebCore25PluginMainThreadScheduler9schedulerEv +__ZN7WebCore25contextMenuItemTagOutlineEv __ZN7WebCore26CSSMutableStyleDeclarationC1Ev __ZN7WebCore26NetscapePlugInStreamLoader6createEPNS_5FrameEPNS_32NetscapePlugInStreamLoaderClientE +__ZN7WebCore26UserTypingGestureIndicator27processingUserTypingGestureEv +__ZN7WebCore26UserTypingGestureIndicator28focusedElementAtGestureStartEv +__ZN7WebCore26contextMenuItemTagFontMenuEv +__ZN7WebCore26contextMenuItemTagOpenLinkEv __ZN7WebCore26usesTestModeFocusRingColorEv __ZN7WebCore27CSSComputedStyleDeclarationC1EN3WTF10PassRefPtrINS_4NodeEEEbRKNS_6StringE __ZN7WebCore27applicationIsAdobeInstallerEv +__ZN7WebCore27contextMenuItemTagShowFontsEv +__ZN7WebCore27contextMenuItemTagUnderlineEv +__ZN7WebCore28contextMenuItemTagCapitalizeEv +__ZN7WebCore28contextMenuItemTagShowColorsEv +__ZN7WebCore28contextMenuItemTagSmartLinksEv +__ZN7WebCore28contextMenuItemTagSpeechMenuEv +__ZN7WebCore29contextMenuItemTagLeftToRightEv +__ZN7WebCore29contextMenuItemTagRightToLeftEv +__ZN7WebCore29contextMenuItemTagSmartDashesEv +__ZN7WebCore29contextMenuItemTagSmartQuotesEv __ZN7WebCore29isCharacterSmartReplaceExemptEib __ZN7WebCore29setUsesTestModeFocusRingColorEb +__ZN7WebCore30contextMenuItemTagSpellingMenuEv +__ZN7WebCore30contextMenuItemTagStopSpeakingEv __ZN7WebCore31CrossOriginPreflightResultCache5emptyEv __ZN7WebCore31CrossOriginPreflightResultCache6sharedEv __ZN7WebCore31applicationIsMicrosoftMessengerEv +__ZN7WebCore31contextMenuItemTagCheckSpellingEv +__ZN7WebCore31contextMenuItemTagIgnoreGrammarEv +__ZN7WebCore31contextMenuItemTagMakeLowerCaseEv +__ZN7WebCore31contextMenuItemTagMakeUpperCaseEv +__ZN7WebCore31contextMenuItemTagStartSpeakingEv +__ZN7WebCore32contextMenuItemTagInspectElementEv +__ZN7WebCore32contextMenuItemTagSmartCopyPasteEv __ZN7WebCore32plainTextToMallocAllocatedBufferEPKNS_5RangeERjb +__ZN7WebCore33contextMenuItemTagTextReplacementEv __ZN7WebCore33setDefaultThreadViolationBehaviorENS_23ThreadViolationBehaviorENS_20ThreadViolationRoundE +__ZN7WebCore34contextMenuItemTagDefaultDirectionEv +__ZN7WebCore35contextMenuItemTagShowSpellingPanelEb +__ZN7WebCore35contextMenuItemTagShowSubstitutionsEb +__ZN7WebCore35contextMenuItemTagSubstitutionsMenuEv __ZN7WebCore36InitializeLoggingChannelsIfNecessaryEv +__ZN7WebCore37contextMenuItemTagTransformationsMenuEv +__ZN7WebCore38contextMenuItemTagWritingDirectionMenuEv __ZN7WebCore3macERKNS_10CredentialE __ZN7WebCore3macERKNS_23AuthenticationChallengeE +__ZN7WebCore42contextMenuItemTagCheckGrammarWithSpellingEv +__ZN7WebCore42contextMenuItemTagCheckSpellingWhileTypingEv +__ZN7WebCore46contextMenuItemTagCorrectSpellingAutomaticallyEv __ZN7WebCore4Font11setCodePathENS0_8CodePathE __ZN7WebCore4Font18shouldUseSmoothingEv __ZN7WebCore4Font21setShouldUseSmoothingEb @@ -526,7 +567,7 @@ __ZN7WebCore4Page6goBackEv __ZN7WebCore4Page8goToItemEPNS_11HistoryItemENS_13FrameLoadTypeE __ZN7WebCore4Page9goForwardEv __ZN7WebCore4Page9initGroupEv -__ZN7WebCore4PageC1EPNS_12ChromeClientEPNS_17ContextMenuClientEPNS_12EditorClientEPNS_10DragClientEPNS_15InspectorClientEPNS_18PluginHalterClientEPNS_27GeolocationControllerClientEPNS_23DeviceOrientationClientEPNS_27BackForwardControllerClientE +__ZN7WebCore4PageC1ERKNS0_11PageClientsE __ZN7WebCore4PageD1Ev __ZN7WebCore4coreEP20NSURLProtectionSpace __ZN7WebCore4toJSEPN3JSC9ExecStateEPNS_17JSDOMGlobalObjectEPNS_19CSSStyleDeclarationE @@ -726,13 +767,13 @@ __ZN7WebCore9FrameView16setPaintBehaviorEj __ZN7WebCore9FrameView18updateControlTintsEv __ZN7WebCore9FrameView20enterCompositingModeEv __ZN7WebCore9FrameView21flushDeferredRepaintsEv -__ZN7WebCore9FrameView38scrollPositionChangedViaPlatformWidgetEv __ZN7WebCore9FrameView22setBaseBackgroundColorENS_5ColorE __ZN7WebCore9FrameView23layoutIfNeededRecursiveEv __ZN7WebCore9FrameView23updateCanHaveScrollbarsEv __ZN7WebCore9FrameView29forceLayoutWithPageWidthRangeEffb __ZN7WebCore9FrameView29setShouldUpdateWhileOffscreenEb __ZN7WebCore9FrameView29syncCompositingStateRecursiveEv +__ZN7WebCore9FrameView38scrollPositionChangedViaPlatformWidgetEv __ZN7WebCore9FrameView6createEPNS_5FrameE __ZN7WebCore9FrameView6createEPNS_5FrameERKNS_7IntSizeE __ZN7WebCore9HTMLNames10listingTagE @@ -1156,6 +1197,7 @@ __ZN7WebCore28InspectorFrontendClientLocal17setAttachedWindowEb __ZN7WebCore28InspectorFrontendClientLocal19requestAttachWindowEv __ZN7WebCore28InspectorFrontendClientLocal19requestDetachWindowEv __ZN7WebCore28InspectorFrontendClientLocal19windowObjectClearedEv +__ZN7WebCore28InspectorFrontendClientLocal20sendMessageToBackendERKNS_6StringE __ZN7WebCore28InspectorFrontendClientLocal26changeAttachedWindowHeightEj __ZN7WebCore28InspectorFrontendClientLocal27restoreAttachedWindowHeightEv __ZN7WebCore28InspectorFrontendClientLocalC2EPNS_19InspectorControllerEPNS_4PageE @@ -1347,7 +1389,7 @@ __ZNK7WebCore15ProtectionSpace20authenticationSchemeEv .objc_class_name_DOMSVGZoomEvent #endif -#if ENABLE(SVG_FILTERS) && ENABLE(SVG_DOM_OBJC_BINDINGS) +#if ENABLE(FILTERS) && ENABLE(SVG_DOM_OBJC_BINDINGS) .objc_class_name_DOMSVGComponentTransferFunctionElement .objc_class_name_DOMSVGFEBlendElement .objc_class_name_DOMSVGFEColorMatrixElement diff --git a/WebCore/WebCore.gyp/WebCore.gyp b/WebCore/WebCore.gyp/WebCore.gyp index 6193294..abd49e7 100644 --- a/WebCore/WebCore.gyp/WebCore.gyp +++ b/WebCore/WebCore.gyp/WebCore.gyp @@ -476,15 +476,20 @@ }, { 'action_name': 'RemoteInspectorFrontend', + # The second input item will be used as item name in vcproj. + # It is not possible to put Inspector.idl there because + # all idl files are marking as excluded by gyp generator. 'inputs': [ '../bindings/scripts/generate-bindings.pl', + '../inspector/CodeGeneratorInspector.pm', '../bindings/scripts/CodeGenerator.pm', '../bindings/scripts/IDLParser.pm', '../bindings/scripts/IDLStructure.pm', - '../inspector/CodeGeneratorInspector.pm', '../inspector/Inspector.idl', ], 'outputs': [ + '<(SHARED_INTERMEDIATE_DIR)/webcore/bindings/InspectorBackendDispatcher.cpp', + '<(SHARED_INTERMEDIATE_DIR)/webkit/bindings/InspectorBackendDispatcher.h', '<(SHARED_INTERMEDIATE_DIR)/webcore/bindings/RemoteInspectorFrontend.cpp', '<(SHARED_INTERMEDIATE_DIR)/webkit/bindings/RemoteInspectorFrontend.h', ], @@ -505,7 +510,7 @@ '--generator', 'Inspector', '<@(generator_include_dirs)' ], - 'message': 'Generating RemoteInspectorFrontend class from Inspector.idl', + 'message': 'Generating Inspector interface classes from Inspector.idl', }, { 'action_name': 'XMLNames', @@ -714,6 +719,7 @@ # Additional .cpp files from the webcore_inspector_sources list. '<(SHARED_INTERMEDIATE_DIR)/webcore/bindings/RemoteInspectorFrontend.cpp', + '<(SHARED_INTERMEDIATE_DIR)/webcore/bindings/InspectorBackendDispatcher.cpp', ], 'conditions': [ ['javascript_engine=="v8"', { diff --git a/WebCore/WebCore.gypi b/WebCore/WebCore.gypi index 7aa5d60..698e302 100644 --- a/WebCore/WebCore.gypi +++ b/WebCore/WebCore.gypi @@ -196,7 +196,6 @@ 'html/ValidityState.idl', 'html/VoidCallback.idl', 'inspector/InjectedScriptHost.idl', - 'inspector/InspectorBackend.idl', 'inspector/InspectorFrontendHost.idl', 'inspector/JavaScriptCallFrame.idl', 'inspector/ScriptProfile.idl', @@ -278,9 +277,6 @@ 'xml/XPathResult.idl', 'xml/XSLTProcessor.idl', ], - 'webcore_inspector_idl_files': [ - 'inspector/Inspector.idl', - ], 'webcore_svg_bindings_idl_files': [ 'svg/ElementTimeControl.idl', 'svg/SVGAElement.idl', @@ -1273,6 +1269,8 @@ 'dom/UIEventWithKeyState.h', 'dom/UserGestureIndicator.cpp', 'dom/UserGestureIndicator.h', + 'dom/UserTypingGestureIndicator.cpp', + 'dom/UserTypingGestureIndicator.h', 'dom/ViewportArguments.cpp', 'dom/ViewportArguments.h', 'dom/WebKitAnimationEvent.cpp', @@ -1827,6 +1825,7 @@ 'loader/CrossOriginPreflightResultCache.h', 'loader/DocLoader.cpp', 'loader/DocLoader.h', + 'loader/DocumentLoadTiming.h', 'loader/DocumentLoader.cpp', 'loader/DocumentLoader.h', 'loader/DocumentThreadableLoader.cpp', @@ -2040,7 +2039,6 @@ 'page/SpeechInput.cpp', 'page/SpeechInput.h', 'page/SpeechInputClient.h', - 'page/SpeechInputClientListener.h', 'page/SpeechInputListener.h', 'page/SuspendableTimer.cpp', 'page/SuspendableTimer.h', @@ -2183,6 +2181,10 @@ 'platform/graphics/chromium/FontPlatformDataLinux.h', 'platform/graphics/chromium/FontUtilsChromiumWin.cpp', 'platform/graphics/chromium/FontUtilsChromiumWin.h', + 'platform/graphics/chromium/GLES2Canvas.cpp', + 'platform/graphics/chromium/GLES2Canvas.h', + 'platform/graphics/chromium/GLES2Texture.cpp', + 'platform/graphics/chromium/GLES2Texture.h', 'platform/graphics/chromium/GlyphPageTreeNodeChromiumWin.cpp', 'platform/graphics/chromium/GlyphPageTreeNodeLinux.cpp', 'platform/graphics/chromium/GraphicsLayerChromium.cpp', @@ -2906,8 +2908,6 @@ 'platform/win/PasteboardWin.cpp', 'platform/win/PlatformMouseEventWin.cpp', 'platform/win/PlatformScreenWin.cpp', - 'platform/win/PlatformScrollBar.h', - 'platform/win/PlatformScrollBarWin.cpp', 'platform/win/PopupMenuWin.cpp', 'platform/win/ScrollbarThemeSafari.cpp', 'platform/win/ScrollbarThemeSafari.h', @@ -3029,6 +3029,8 @@ 'platform/ScrollTypes.h', 'platform/ScrollView.cpp', 'platform/ScrollView.h', + 'platform/SchemeRegistry.cpp', + 'platform/SchemeRegistry.h', 'platform/Scrollbar.cpp', 'platform/Scrollbar.h', 'platform/ScrollbarClient.h', @@ -3310,6 +3312,8 @@ 'rendering/RenderSVGResource.h', 'rendering/RenderSVGResourceClipper.cpp', 'rendering/RenderSVGResourceClipper.h', + 'rendering/RenderSVGResourceContainer.cpp', + 'rendering/RenderSVGResourceContainer.h', 'rendering/RenderSVGResourceFilter.cpp', 'rendering/RenderSVGResourceFilter.h', 'rendering/RenderSVGResourceGradient.cpp', @@ -3416,6 +3420,12 @@ 'rendering/SVGRenderSupport.h', 'rendering/SVGRenderTreeAsText.cpp', 'rendering/SVGRenderTreeAsText.h', + 'rendering/SVGResources.cpp', + 'rendering/SVGResources.h', + 'rendering/SVGResourcesCache.cpp', + 'rendering/SVGResourcesCache.h', + 'rendering/SVGResourcesCycleSolver.cpp', + 'rendering/SVGResourcesCycleSolver.h', 'rendering/SVGRootInlineBox.cpp', 'rendering/SVGRootInlineBox.h', 'rendering/SVGShadowTreeElements.cpp', diff --git a/WebCore/WebCore.order b/WebCore/WebCore.order index 8fa6586..0ac5610 100644 --- a/WebCore/WebCore.order +++ b/WebCore/WebCore.order @@ -2999,7 +2999,7 @@ __ZN7WebCore24StringWrapperCFAllocatorL22deallocateOnMainThreadEPv __ZNK7WebCore12RenderObject5themeEv __ZNK7WebCore14RenderThemeMac20supportsControlTintsEv __ZN7WebCore15GraphicsContext23setUpdatingControlTintsEb -__ZN7WebCore12EventHandler20hitTestResultAtPointERKNS_8IntPointEbbNS_17HitTestScrollbarsEi +__ZN7WebCore12EventHandler20hitTestResultAtPointERKNS_8IntPointEbbNS_17HitTestScrollbarsEj __ZNK7WebCore13HitTestResult10isSelectedEv __ZN7WebCore19SelectionController8containsERKNS_8IntPointE __ZN7WebCore13InlineTextBox11nodeAtPointERKNS_14HitTestRequestERNS_13HitTestResultEiiii diff --git a/WebCore/WebCore.pri b/WebCore/WebCore.pri index 7205add..ef87a45 100644 --- a/WebCore/WebCore.pri +++ b/WebCore/WebCore.pri @@ -42,6 +42,7 @@ contains(DEFINES, ENABLE_SINGLE_THREADED=1) { !contains(DEFINES, ENABLE_CHANNEL_MESSAGING=.): DEFINES += ENABLE_CHANNEL_MESSAGING=1 !contains(DEFINES, ENABLE_ORIENTATION_EVENTS=.): DEFINES += ENABLE_ORIENTATION_EVENTS=0 !contains(DEFINES, ENABLE_DIRECTORY_UPLOAD=.): DEFINES += ENABLE_DIRECTORY_UPLOAD=0 +!contains(DEFINES, ENABLE_FILE_SYSTEM=.): DEFINES += ENABLE_FILE_SYSTEM=0 # turn on SQLITE support if any of the dependent features are turned on !contains(DEFINES, ENABLE_SQLITE=.) { @@ -448,7 +449,6 @@ IDL_BINDINGS += \ html/ValidityState.idl \ html/VoidCallback.idl \ inspector/InjectedScriptHost.idl \ - inspector/InspectorBackend.idl \ inspector/InspectorFrontendHost.idl \ inspector/JavaScriptCallFrame.idl \ inspector/ScriptProfile.idl \ @@ -681,6 +681,7 @@ WEBCORE_HEADERS_FOR_WEBKIT2 += \ html/HTMLFormElement.h \ html/HTMLFrameOwnerElement.h \ inspector/InspectorClient.h \ + loader/appcache/ApplicationCacheStorage.h \ loader/DocumentLoader.h \ loader/FormState.h \ loader/FrameLoader.h \ @@ -702,11 +703,17 @@ WEBCORE_HEADERS_FOR_WEBKIT2 += \ page/Page.h \ page/Settings.h \ page/WindowFeatures.h \ + platform/Cursor.h \ platform/PlatformKeyboardEvent.h \ platform/PlatformMouseEvent.h \ platform/PlatformWheelEvent.h \ platform/Widget.h \ platform/KURL.h \ + platform/graphics/Color.h \ + platform/graphics/ColorSpace.h \ + platform/graphics/GraphicsTypes.h \ + platform/graphics/Image.h \ + platform/graphics/ImageSource.h \ platform/graphics/FloatRect.h \ platform/graphics/GraphicsContext.h \ platform/graphics/GraphicsLayerClient.h \ @@ -716,6 +723,7 @@ WEBCORE_HEADERS_FOR_WEBKIT2 += \ platform/graphics/Tile.h \ platform/graphics/TiledBackingStore.h \ platform/graphics/TiledBackingStoreClient.h \ + platform/sql/SQLiteDatabase.h \ platform/text/PlatformString.h \ platform/text/StringImpl.h \ platform/MIMETypeRegistry.h \ @@ -808,7 +816,7 @@ idl.depends = $$PWD/bindings/scripts/CodeGenerator.pm \ addExtraCompiler(idl) # GENERATOR 2: inspector idl compiler -inspectorIDL.output = $${WC_GENERATED_SOURCES_DIR}/Remote${QMAKE_FILE_BASE}Frontend.cpp +inspectorIDL.output = $${WC_GENERATED_SOURCES_DIR}/Remote${QMAKE_FILE_BASE}Frontend.cpp $${WC_GENERATED_SOURCES_DIR}/${QMAKE_FILE_BASE}BackendDispatcher.cpp inspectorIDL.input = INSPECTOR_INTERFACES inspectorIDL.wkScript = $$PWD/bindings/scripts/generate-bindings.pl inspectorIDL.commands = perl -I$$PWD/bindings/scripts -I$$PWD/inspector $$inspectorIDL.wkScript --defines \"$${FEATURE_DEFINES_JAVASCRIPT}\" --generator Inspector --outputDir $$WC_GENERATED_SOURCES_DIR --preprocessor \"$${QMAKE_MOC} -E\" ${QMAKE_FILE_NAME} diff --git a/WebCore/WebCore.pro b/WebCore/WebCore.pro index 8ed7157..b7f152e 100644 --- a/WebCore/WebCore.pro +++ b/WebCore/WebCore.pro @@ -549,6 +549,7 @@ SOURCES += \ dom/UIEvent.cpp \ dom/UIEventWithKeyState.cpp \ dom/UserGestureIndicator.cpp \ + dom/UserTypingGestureIndicator.cpp \ dom/ViewportArguments.cpp \ dom/WebKitAnimationEvent.cpp \ dom/WebKitTransitionEvent.cpp \ @@ -925,6 +926,7 @@ SOURCES += \ platform/network/ResourceRequestBase.cpp \ platform/network/ResourceResponseBase.cpp \ platform/text/RegularExpression.cpp \ + platform/SchemeRegistry.cpp \ platform/Scrollbar.cpp \ platform/ScrollbarThemeComposite.cpp \ platform/ScrollView.cpp \ @@ -1610,7 +1612,6 @@ HEADERS += \ page/SpatialNavigation.h \ page/SpeechInput.h \ page/SpeechInputClient.h \ - page/SpeechInputClientListener.h \ page/SpeechInputListener.h \ page/WindowFeatures.h \ page/WorkerNavigator.h \ @@ -1825,6 +1826,7 @@ HEADERS += \ rendering/RenderSVGModelObject.h \ rendering/RenderSVGResource.h \ rendering/RenderSVGResourceClipper.h \ + rendering/RenderSVGResourceContainer.h \ rendering/RenderSVGResourceFilter.h \ rendering/RenderSVGResourceGradient.h \ rendering/RenderSVGResourceLinearGradient.h \ @@ -1893,6 +1895,9 @@ HEADERS += \ rendering/SVGMarkerLayoutInfo.h \ rendering/SVGRenderSupport.h \ rendering/SVGRenderTreeAsText.h \ + rendering/SVGResources.h \ + rendering/SVGResourcesCache.h \ + rendering/SVGResourcesCycleSolver.h \ rendering/SVGRootInlineBox.h \ rendering/SVGShadowTreeElements.h \ rendering/SVGTextChunkLayoutInfo.h \ @@ -2905,6 +2910,7 @@ contains(DEFINES, ENABLE_SVG=1) { rendering/RenderSVGModelObject.cpp \ rendering/RenderSVGResource.cpp \ rendering/RenderSVGResourceClipper.cpp \ + rendering/RenderSVGResourceContainer.cpp \ rendering/RenderSVGResourceFilter.cpp \ rendering/RenderSVGResourceGradient.cpp \ rendering/RenderSVGResourceLinearGradient.cpp \ @@ -2926,6 +2932,9 @@ contains(DEFINES, ENABLE_SVG=1) { rendering/SVGInlineTextBox.cpp \ rendering/SVGMarkerLayoutInfo.cpp \ rendering/SVGRenderSupport.cpp \ + rendering/SVGResources.cpp \ + rendering/SVGResourcesCache.cpp \ + rendering/SVGResourcesCycleSolver.cpp \ rendering/SVGRootInlineBox.cpp \ rendering/SVGShadowTreeElements.cpp \ rendering/SVGTextChunkLayoutInfo.cpp \ @@ -3342,11 +3351,13 @@ SOURCES += \ ../WebKit2/UIProcess/WebProcessProxy.cpp \ ../WebKit2/UIProcess/WebUIClient.cpp \ ../WebKit2/WebProcess/InjectedBundle/InjectedBundle.cpp \ + ../WebKit2/WebProcess/InjectedBundle/InjectedBundlePageEditorClient.cpp \ ../WebKit2/WebProcess/InjectedBundle/InjectedBundlePageUIClient.cpp \ ../WebKit2/WebProcess/InjectedBundle/InjectedBundlePageLoaderClient.cpp \ ../WebKit2/WebProcess/InjectedBundle/qt/InjectedBundleQt.cpp \ ../WebKit2/UIProcess/API/qt/ClientImpl.cpp \ ../WebKit2/UIProcess/qt/ChunkedUpdateDrawingAreaProxyQt.cpp \ + ../WebKit2/UIProcess/qt/WebContextQt.cpp \ ../WebKit2/WebProcess/WebCoreSupport/WebChromeClient.cpp \ ../WebKit2/WebProcess/WebCoreSupport/WebContextMenuClient.cpp \ ../WebKit2/WebProcess/WebCoreSupport/WebDragClient.cpp \ @@ -3363,6 +3374,7 @@ SOURCES += \ ../WebKit2/WebProcess/WebPage/qt/ChunkedUpdateDrawingAreaQt.cpp \ ../WebKit2/WebProcess/WebPage/qt/WebPageQt.cpp \ ../WebKit2/WebProcess/WebProcess.cpp \ + ../WebKit2/WebProcess/qt/WebProcessMainQt.cpp } diff --git a/WebCore/WebCore.vcproj/WebCore.vcproj b/WebCore/WebCore.vcproj/WebCore.vcproj index 17a6b7f..de4b3c4 100644 --- a/WebCore/WebCore.vcproj/WebCore.vcproj +++ b/WebCore/WebCore.vcproj/WebCore.vcproj @@ -8781,62 +8781,6 @@ >
</File>
<File
- RelativePath="$(WebKitOutputDir)\obj\$(ProjectName)\DerivedSources\JSInspectorBackend.cpp"
- >
- <FileConfiguration
- Name="Debug|Win32"
- ExcludedFromBuild="true"
- >
- <Tool
- Name="VCCLCompilerTool"
- />
- </FileConfiguration>
- <FileConfiguration
- Name="Release|Win32"
- ExcludedFromBuild="true"
- >
- <Tool
- Name="VCCLCompilerTool"
- />
- </FileConfiguration>
- <FileConfiguration
- Name="Debug_Internal|Win32"
- ExcludedFromBuild="true"
- >
- <Tool
- Name="VCCLCompilerTool"
- />
- </FileConfiguration>
- <FileConfiguration
- Name="Debug_Cairo|Win32"
- ExcludedFromBuild="true"
- >
- <Tool
- Name="VCCLCompilerTool"
- />
- </FileConfiguration>
- <FileConfiguration
- Name="Release_Cairo|Win32"
- ExcludedFromBuild="true"
- >
- <Tool
- Name="VCCLCompilerTool"
- />
- </FileConfiguration>
- <FileConfiguration
- Name="Debug_All|Win32"
- ExcludedFromBuild="true"
- >
- <Tool
- Name="VCCLCompilerTool"
- />
- </FileConfiguration>
- </File>
- <File
- RelativePath="$(WebKitOutputDir)\obj\$(ProjectName)\DerivedSources\JSInspectorBackend.h"
- >
- </File>
- <File
RelativePath="$(WebKitOutputDir)\obj\$(ProjectName)\DerivedSources\JSInspectorFrontendHost.cpp"
>
<FileConfiguration
@@ -20741,6 +20685,14 @@ >
</File>
<File
+ RelativePath="$(WebKitOutputDir)\obj\$(ProjectName)\DerivedSources\InspectorBackendDispatcher.cpp"
+ >
+ </File>
+ <File
+ RelativePath="$(WebKitOutputDir)\obj\$(ProjectName)\DerivedSources\InspectorBackendDispatcher.h"
+ >
+ </File>
+ <File
RelativePath="$(WebKitOutputDir)\obj\$(ProjectName)\DerivedSources\RemoteInspectorFrontend.cpp"
>
</File>
@@ -22513,10 +22465,6 @@ >
</File>
<File
- RelativePath="..\page\SpeechInputClientListener.h"
- >
- </File>
- <File
RelativePath="..\page\SpeechInputListener.h"
>
</File>
@@ -22777,6 +22725,10 @@ >
</File>
<File
+ RelativePath="..\loader\DocumentLoadTiming.h"
+ >
+ </File>
+ <File
RelativePath="..\loader\DocumentLoader.cpp"
>
</File>
@@ -23477,6 +23429,14 @@ >
</File>
<File
+ RelativePath="..\platform\SchemeRegistry.cpp"
+ >
+ </File>
+ <File
+ RelativePath="..\platform\SchemeRegistry.h"
+ >
+ </File>
+ <File
RelativePath="..\platform\Scrollbar.cpp"
>
</File>
@@ -29945,6 +29905,62 @@ >
</File>
<File
+ RelativePath="..\rendering\RenderSVGResourceContainer.cpp"
+ >
+ <FileConfiguration
+ Name="Debug|Win32"
+ ExcludedFromBuild="true"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Release|Win32"
+ ExcludedFromBuild="true"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Debug_Internal|Win32"
+ ExcludedFromBuild="true"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Debug_Cairo|Win32"
+ ExcludedFromBuild="true"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Release_Cairo|Win32"
+ ExcludedFromBuild="true"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Debug_All|Win32"
+ ExcludedFromBuild="true"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ />
+ </FileConfiguration>
+ </File>
+ <File
+ RelativePath="..\rendering\RenderSVGResourceContainer.h"
+ >
+ </File>
+ <File
RelativePath="..\rendering\RenderSVGResourceFilter.cpp"
>
<FileConfiguration
@@ -31419,6 +31435,174 @@ >
</File>
<File
+ RelativePath="..\rendering\SVGResources.cpp"
+ >
+ <FileConfiguration
+ Name="Debug|Win32"
+ ExcludedFromBuild="true"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Release|Win32"
+ ExcludedFromBuild="true"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Debug_Internal|Win32"
+ ExcludedFromBuild="true"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Debug_Cairo|Win32"
+ ExcludedFromBuild="true"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Release_Cairo|Win32"
+ ExcludedFromBuild="true"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Debug_All|Win32"
+ ExcludedFromBuild="true"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ />
+ </FileConfiguration>
+ </File>
+ <File
+ RelativePath="..\rendering\SVGResources.h"
+ >
+ </File>
+ <File
+ RelativePath="..\rendering\SVGResourcesCache.cpp"
+ >
+ <FileConfiguration
+ Name="Debug|Win32"
+ ExcludedFromBuild="true"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Release|Win32"
+ ExcludedFromBuild="true"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Debug_Internal|Win32"
+ ExcludedFromBuild="true"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Debug_Cairo|Win32"
+ ExcludedFromBuild="true"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Release_Cairo|Win32"
+ ExcludedFromBuild="true"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Debug_All|Win32"
+ ExcludedFromBuild="true"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ />
+ </FileConfiguration>
+ </File>
+ <File
+ RelativePath="..\rendering\SVGResourcesCache.h"
+ >
+ </File>
+ <File
+ RelativePath="..\rendering\SVGResourcesCycleSolver.cpp"
+ >
+ <FileConfiguration
+ Name="Debug|Win32"
+ ExcludedFromBuild="true"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Release|Win32"
+ ExcludedFromBuild="true"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Debug_Internal|Win32"
+ ExcludedFromBuild="true"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Debug_Cairo|Win32"
+ ExcludedFromBuild="true"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Release_Cairo|Win32"
+ ExcludedFromBuild="true"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Debug_All|Win32"
+ ExcludedFromBuild="true"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ />
+ </FileConfiguration>
+ </File>
+ <File
+ RelativePath="..\rendering\SVGResourcesCycleSolver.h"
+ >
+ </File>
+ <File
RelativePath="..\rendering\SVGRootInlineBox.cpp"
>
<FileConfiguration
@@ -33025,6 +33209,14 @@ >
</File>
<File
+ RelativePath="..\dom\UserTypingGestureIndicator.cpp"
+ >
+ </File>
+ <File
+ RelativePath="..\dom\UserTypingGestureIndicator.h"
+ >
+ </File>
+ <File
RelativePath="..\dom\ViewportArguments.cpp"
>
</File>
diff --git a/WebCore/WebCore.xcodeproj/project.pbxproj b/WebCore/WebCore.xcodeproj/project.pbxproj index af1949f..7af6387 100644 --- a/WebCore/WebCore.xcodeproj/project.pbxproj +++ b/WebCore/WebCore.xcodeproj/project.pbxproj @@ -99,6 +99,10 @@ 084CE5CC0F27DADC00E6240E /* WMLOptGroupElement.h in Headers */ = {isa = PBXBuildFile; fileRef = 084CE5C80F27DADC00E6240E /* WMLOptGroupElement.h */; }; 084CE5CD0F27DADC00E6240E /* WMLOptionElement.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 084CE5C90F27DADC00E6240E /* WMLOptionElement.cpp */; }; 084CE5CE0F27DADC00E6240E /* WMLOptionElement.h in Headers */ = {isa = PBXBuildFile; fileRef = 084CE5CA0F27DADC00E6240E /* WMLOptionElement.h */; }; + 084D0E3C11F5816100081E1A /* SVGResources.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 084D0E3811F5816100081E1A /* SVGResources.cpp */; }; + 084D0E3D11F5816100081E1A /* SVGResources.h in Headers */ = {isa = PBXBuildFile; fileRef = 084D0E3911F5816100081E1A /* SVGResources.h */; settings = {ATTRIBUTES = (Private, ); }; }; + 084D0E3E11F5816100081E1A /* SVGResourcesCache.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 084D0E3A11F5816100081E1A /* SVGResourcesCache.cpp */; }; + 084D0E3F11F5816100081E1A /* SVGResourcesCache.h in Headers */ = {isa = PBXBuildFile; fileRef = 084D0E3B11F5816100081E1A /* SVGResourcesCache.h */; settings = {ATTRIBUTES = (Private, ); }; }; 084D2833110A7FCB0038239A /* SVGAnimatedPropertySynchronizer.h in Headers */ = {isa = PBXBuildFile; fileRef = 084D2831110A7FCB0038239A /* SVGAnimatedPropertySynchronizer.h */; settings = {ATTRIBUTES = (Private, ); }; }; 084D2834110A7FCB0038239A /* SVGAnimatedPropertyTraits.h in Headers */ = {isa = PBXBuildFile; fileRef = 084D2832110A7FCB0038239A /* SVGAnimatedPropertyTraits.h */; settings = {ATTRIBUTES = (Private, ); }; }; 084DBAA10ED39D360038C226 /* WMLVariables.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 084DBA9D0ED39D350038C226 /* WMLVariables.cpp */; }; @@ -112,10 +116,13 @@ 08591AA50F085C4E009BACB1 /* InputElement.h in Headers */ = {isa = PBXBuildFile; fileRef = 08591AA40F085C4E009BACB1 /* InputElement.h */; settings = {ATTRIBUTES = (Private, ); }; }; 085AFDC80F2977350061F2B3 /* WMLFormControlElement.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 085AFDC60F2977350061F2B3 /* WMLFormControlElement.cpp */; }; 085AFDC90F2977350061F2B3 /* WMLFormControlElement.h in Headers */ = {isa = PBXBuildFile; fileRef = 085AFDC70F2977350061F2B3 /* WMLFormControlElement.h */; settings = {ATTRIBUTES = (); }; }; + 085B05C211FAE16C004D65F6 /* SVGResourcesCycleSolver.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 085B05C011FAE16C004D65F6 /* SVGResourcesCycleSolver.cpp */; }; + 085B05C311FAE16C004D65F6 /* SVGResourcesCycleSolver.h in Headers */ = {isa = PBXBuildFile; fileRef = 085B05C111FAE16C004D65F6 /* SVGResourcesCycleSolver.h */; }; 085B92BA0EFDE73D00E6123C /* FormDataBuilder.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 085B92B80EFDE73D00E6123C /* FormDataBuilder.cpp */; }; - 085B92BB0EFDE73D00E6123C /* FormDataBuilder.h in Headers */ = {isa = PBXBuildFile; fileRef = 085B92B90EFDE73D00E6123C /* FormDataBuilder.h */; settings = {ATTRIBUTES = (Private, ); }; }; + 085B92BB0EFDE73D00E6123C /* FormDataBuilder.h in Headers */ = {isa = PBXBuildFile; fileRef = 085B92B90EFDE73D00E6123C /* FormDataBuilder.h */; settings = {ATTRIBUTES = (); }; }; 0865CCE60EDDF51B00DF9EC3 /* WMLNoopElement.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0865CCE40EDDF51B00DF9EC3 /* WMLNoopElement.cpp */; }; 0865CCE70EDDF51B00DF9EC3 /* WMLNoopElement.h in Headers */ = {isa = PBXBuildFile; fileRef = 0865CCE50EDDF51B00DF9EC3 /* WMLNoopElement.h */; }; + 086A400611F6D6B7002CEC53 /* RenderSVGResourceContainer.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 086A400511F6D6B7002CEC53 /* RenderSVGResourceContainer.cpp */; }; 08700BE70F086C5300919419 /* InputElement.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 08700BE60F086C5300919419 /* InputElement.cpp */; }; 087281550F26B9B600AFC596 /* OptionElement.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 087281510F26B9B600AFC596 /* OptionElement.cpp */; }; 087281560F26B9B600AFC596 /* OptionElement.h in Headers */ = {isa = PBXBuildFile; fileRef = 087281520F26B9B600AFC596 /* OptionElement.h */; }; @@ -345,7 +352,7 @@ 1A3417C90CECFF250049CBDE /* JSCustomVoidCallback.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A3417C70CECFF250049CBDE /* JSCustomVoidCallback.h */; }; 1A3417CA0CECFF250049CBDE /* JSCustomVoidCallback.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A3417C80CECFF250049CBDE /* JSCustomVoidCallback.cpp */; }; 1A494BFA0A122F4400FDAFC1 /* JSHTMLElement.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A494BF80A122F4400FDAFC1 /* JSHTMLElement.cpp */; }; - 1A494BFB0A122F4400FDAFC1 /* JSHTMLElement.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A494BF90A122F4400FDAFC1 /* JSHTMLElement.h */; }; + 1A494BFB0A122F4400FDAFC1 /* JSHTMLElement.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A494BF90A122F4400FDAFC1 /* JSHTMLElement.h */; settings = {ATTRIBUTES = (Private, ); }; }; 1A494E340A12358B00FDAFC1 /* JSHTMLDocument.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A494E320A12358A00FDAFC1 /* JSHTMLDocument.cpp */; }; 1A494E350A12358B00FDAFC1 /* JSHTMLDocument.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A494E330A12358B00FDAFC1 /* JSHTMLDocument.h */; }; 1A494EDE0A123F4C00FDAFC1 /* JSDocumentFragment.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A494EDC0A123F4C00FDAFC1 /* JSDocumentFragment.cpp */; }; @@ -806,7 +813,7 @@ 416E75CB0EDF90C700360E1D /* ScriptCallFrame.h in Headers */ = {isa = PBXBuildFile; fileRef = 416E75C90EDF90C700360E1D /* ScriptCallFrame.h */; }; 416E75CC0EDF90C700360E1D /* ScriptCallFrame.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 416E75CA0EDF90C700360E1D /* ScriptCallFrame.cpp */; }; 416F45F00ED7B311008215B6 /* ScriptString.h in Headers */ = {isa = PBXBuildFile; fileRef = 416F45EF0ED7B311008215B6 /* ScriptString.h */; settings = {ATTRIBUTES = (Private, ); }; }; - 41885B9311B6FDA6003383BB /* FormSubmission.h in Headers */ = {isa = PBXBuildFile; fileRef = 41885B9111B6FDA6003383BB /* FormSubmission.h */; }; + 41885B9311B6FDA6003383BB /* FormSubmission.h in Headers */ = {isa = PBXBuildFile; fileRef = 41885B9111B6FDA6003383BB /* FormSubmission.h */; settings = {ATTRIBUTES = (Private, ); }; }; 41885B9411B6FDA6003383BB /* FormSubmission.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 41885B9211B6FDA6003383BB /* FormSubmission.cpp */; }; 418F88040FF957AE0080F045 /* JSAbstractWorker.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 418F88020FF957AE0080F045 /* JSAbstractWorker.cpp */; }; 418F88050FF957AF0080F045 /* JSAbstractWorker.h in Headers */ = {isa = PBXBuildFile; fileRef = 418F88030FF957AE0080F045 /* JSAbstractWorker.h */; }; @@ -832,8 +839,6 @@ 41E1B1D10FF5986900576B3B /* AbstractWorker.h in Headers */ = {isa = PBXBuildFile; fileRef = 41E1B1CB0FF5986900576B3B /* AbstractWorker.h */; }; 41E1B1D30FF5986900576B3B /* SharedWorker.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 41E1B1CD0FF5986900576B3B /* SharedWorker.cpp */; }; 41E1B1D40FF5986900576B3B /* SharedWorker.h in Headers */ = {isa = PBXBuildFile; fileRef = 41E1B1CE0FF5986900576B3B /* SharedWorker.h */; }; - 41F060CD0F5EEB2B00A07EAC /* JSInspectorBackend.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 41F060CB0F5EEB2B00A07EAC /* JSInspectorBackend.cpp */; }; - 41F060CE0F5EEB2B00A07EAC /* JSInspectorBackend.h in Headers */ = {isa = PBXBuildFile; fileRef = 41F060CC0F5EEB2B00A07EAC /* JSInspectorBackend.h */; }; 41F061740F5F00AC00A07EAC /* InspectorDOMStorageResource.h in Headers */ = {isa = PBXBuildFile; fileRef = 41F061720F5F00AC00A07EAC /* InspectorDOMStorageResource.h */; }; 41F061750F5F00AC00A07EAC /* InspectorDOMStorageResource.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 41F061730F5F00AC00A07EAC /* InspectorDOMStorageResource.cpp */; }; 41F0618E0F5F069800A07EAC /* ConsoleMessage.h in Headers */ = {isa = PBXBuildFile; fileRef = 41F0618C0F5F069800A07EAC /* ConsoleMessage.h */; }; @@ -1030,6 +1035,8 @@ 4F3289B511A42AAB005ABE7E /* InspectorValues.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4F3289B311A42AAB005ABE7E /* InspectorValues.cpp */; }; 4F3289B611A42AAB005ABE7E /* InspectorValues.h in Headers */ = {isa = PBXBuildFile; fileRef = 4F3289B411A42AAB005ABE7E /* InspectorValues.h */; settings = {ATTRIBUTES = (Private, ); }; }; 4F4F5FFB11CBD2E100A186BF /* RemoteInspectorFrontend.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4F4F5FFA11CBD2D200A186BF /* RemoteInspectorFrontend.cpp */; }; + 4F707A9911EF679400ACDA69 /* InspectorBackendDispatcher.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4F707A9711EF679400ACDA69 /* InspectorBackendDispatcher.cpp */; }; + 4F707A9A11EF679400ACDA69 /* InspectorBackendDispatcher.h in Headers */ = {isa = PBXBuildFile; fileRef = 4F707A9811EF679400ACDA69 /* InspectorBackendDispatcher.h */; }; 4FD8D0F2119C718B002FA825 /* ScriptGCEvent.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4FD8D0F0119C718B002FA825 /* ScriptGCEvent.cpp */; }; 4FD8D0F3119C718B002FA825 /* ScriptGCEvent.h in Headers */ = {isa = PBXBuildFile; fileRef = 4FD8D0F1119C718B002FA825 /* ScriptGCEvent.h */; }; 510184690B08602A004A825F /* CachedPage.h in Headers */ = {isa = PBXBuildFile; fileRef = 510184670B08602A004A825F /* CachedPage.h */; settings = {ATTRIBUTES = (Private, ); }; }; @@ -1106,6 +1113,8 @@ 5160300B0CC4251200C8AC25 /* FileSystemPOSIX.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 5160300A0CC4251200C8AC25 /* FileSystemPOSIX.cpp */; }; 5160306C0CC4362300C8AC25 /* FileSystemCF.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 5160306B0CC4362300C8AC25 /* FileSystemCF.cpp */; }; 5160F4980B0AA75F00C1D2AF /* HistoryItemMac.mm in Sources */ = {isa = PBXBuildFile; fileRef = 5160F4970B0AA75F00C1D2AF /* HistoryItemMac.mm */; }; + 5162C7F411F77EFB00612EFE /* SchemeRegistry.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 5162C7F211F77EFA00612EFE /* SchemeRegistry.cpp */; }; + 5162C7F511F77EFB00612EFE /* SchemeRegistry.h in Headers */ = {isa = PBXBuildFile; fileRef = 5162C7F311F77EFB00612EFE /* SchemeRegistry.h */; settings = {ATTRIBUTES = (Private, ); }; }; 516BB7940CE91E6800512F79 /* JSTreeWalkerCustom.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 516BB7920CE91E6800512F79 /* JSTreeWalkerCustom.cpp */; }; 51721FBB11D2790700638B42 /* BeforeProcessEvent.h in Headers */ = {isa = PBXBuildFile; fileRef = 51721FB911D2790700638B42 /* BeforeProcessEvent.h */; }; 51721FD211D27EF200638B42 /* JSBeforeProcessEvent.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 51721FD011D27EF200638B42 /* JSBeforeProcessEvent.cpp */; }; @@ -1347,7 +1356,6 @@ 7578F90B11DDF26900D933C5 /* SpeechInput.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 7578F90811DDF26900D933C5 /* SpeechInput.cpp */; }; 7578F90C11DDF26900D933C5 /* SpeechInput.h in Headers */ = {isa = PBXBuildFile; fileRef = 7578F90911DDF26900D933C5 /* SpeechInput.h */; }; 7578F90D11DDF26900D933C5 /* SpeechInputClient.h in Headers */ = {isa = PBXBuildFile; fileRef = 7578F90A11DDF26900D933C5 /* SpeechInputClient.h */; }; - 7578F91F11E4E32800D933C5 /* SpeechInputClientListener.h in Headers */ = {isa = PBXBuildFile; fileRef = 7578F91D11E4E32800D933C5 /* SpeechInputClientListener.h */; }; 7578F92011E4E32800D933C5 /* SpeechInputListener.h in Headers */ = {isa = PBXBuildFile; fileRef = 7578F91E11E4E32800D933C5 /* SpeechInputListener.h */; }; 75793E830D0CE0B3007FC0AC /* MessageEvent.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 75793E800D0CE0B3007FC0AC /* MessageEvent.cpp */; }; 75793E840D0CE0B3007FC0AC /* MessageEvent.h in Headers */ = {isa = PBXBuildFile; fileRef = 75793E810D0CE0B3007FC0AC /* MessageEvent.h */; }; @@ -2323,6 +2331,7 @@ 89BED5EC11BE11CE00448492 /* BlobBuilder.h in Headers */ = {isa = PBXBuildFile; fileRef = 89BED5EA11BE11CE00448492 /* BlobBuilder.h */; }; 89CD029311C85B870070B791 /* JSBlobBuilder.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 89CD029111C85B870070B791 /* JSBlobBuilder.cpp */; }; 89CD029411C85B870070B791 /* JSBlobBuilder.h in Headers */ = {isa = PBXBuildFile; fileRef = 89CD029211C85B870070B791 /* JSBlobBuilder.h */; }; + 8A12E35D11FA33280025836A /* DocumentLoadTiming.h in Headers */ = {isa = PBXBuildFile; fileRef = 8A12E35C11FA33280025836A /* DocumentLoadTiming.h */; settings = {ATTRIBUTES = (Private, ); }; }; 8A81BF8511DCFD9000DA2B98 /* ResourceLoadTiming.h in Headers */ = {isa = PBXBuildFile; fileRef = 8A81BF8411DCFD9000DA2B98 /* ResourceLoadTiming.h */; settings = {ATTRIBUTES = (Private, ); }; }; 8A844D0411D3C18E0014065C /* Performance.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 8A844D0111D3C18E0014065C /* Performance.cpp */; }; 8A844D0511D3C18E0014065C /* Performance.h in Headers */ = {isa = PBXBuildFile; fileRef = 8A844D0211D3C18E0014065C /* Performance.h */; }; @@ -2448,7 +2457,7 @@ 934F71420D5A6F4400018D69 /* ResourceError.h in Headers */ = {isa = PBXBuildFile; fileRef = 934F71410D5A6F4400018D69 /* ResourceError.h */; settings = {ATTRIBUTES = (Private, ); }; }; 934F71440D5A6F5300018D69 /* AuthenticationChallenge.h in Headers */ = {isa = PBXBuildFile; fileRef = 934F71430D5A6F5300018D69 /* AuthenticationChallenge.h */; settings = {ATTRIBUTES = (Private, ); }; }; 934FE9E50B5CA539003E4A73 /* FileChooser.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 934FE9E40B5CA539003E4A73 /* FileChooser.cpp */; }; - 935207BE09BD410A00F2038D /* LocalizedStrings.h in Headers */ = {isa = PBXBuildFile; fileRef = 935207BD09BD410A00F2038D /* LocalizedStrings.h */; }; + 935207BE09BD410A00F2038D /* LocalizedStrings.h in Headers */ = {isa = PBXBuildFile; fileRef = 935207BD09BD410A00F2038D /* LocalizedStrings.h */; settings = {ATTRIBUTES = (Private, ); }; }; 935207C009BD412100F2038D /* LocalizedStringsMac.mm in Sources */ = {isa = PBXBuildFile; fileRef = 935207BF09BD412000F2038D /* LocalizedStringsMac.mm */; }; 9352084509BD43B900F2038D /* Language.mm in Sources */ = {isa = PBXBuildFile; fileRef = 9352084409BD43B900F2038D /* Language.mm */; }; 9352087709BD453400F2038D /* CookieJar.mm in Sources */ = {isa = PBXBuildFile; fileRef = 9352087609BD453400F2038D /* CookieJar.mm */; }; @@ -2506,7 +2515,7 @@ 93B70D6909EB0C7C009D8468 /* JSEventListener.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 93B70D4D09EB0C7C009D8468 /* JSEventListener.cpp */; }; 93B70D6A09EB0C7C009D8468 /* JSEventListener.h in Headers */ = {isa = PBXBuildFile; fileRef = 93B70D4E09EB0C7C009D8468 /* JSEventListener.h */; }; 93B70D6B09EB0C7C009D8468 /* JSPluginElementFunctions.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 93B70D4F09EB0C7C009D8468 /* JSPluginElementFunctions.cpp */; }; - 93B70D6C09EB0C7C009D8468 /* JSPluginElementFunctions.h in Headers */ = {isa = PBXBuildFile; fileRef = 93B70D5009EB0C7C009D8468 /* JSPluginElementFunctions.h */; }; + 93B70D6C09EB0C7C009D8468 /* JSPluginElementFunctions.h in Headers */ = {isa = PBXBuildFile; fileRef = 93B70D5009EB0C7C009D8468 /* JSPluginElementFunctions.h */; settings = {ATTRIBUTES = (Private, ); }; }; 93B70D6F09EB0C7C009D8468 /* ScriptController.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 93B70D5309EB0C7C009D8468 /* ScriptController.cpp */; }; 93B70D7009EB0C7C009D8468 /* ScriptController.h in Headers */ = {isa = PBXBuildFile; fileRef = 93B70D5409EB0C7C009D8468 /* ScriptController.h */; settings = {ATTRIBUTES = (Private, ); }; }; 93B77A380ADD792500EA4B81 /* FrameLoaderTypes.h in Headers */ = {isa = PBXBuildFile; fileRef = 93B77A370ADD792500EA4B81 /* FrameLoaderTypes.h */; settings = {ATTRIBUTES = (Private, ); }; }; @@ -4501,6 +4510,7 @@ BC5A86850C33676000EEA649 /* DOMSelection.h in Headers */ = {isa = PBXBuildFile; fileRef = BC5A86820C33676000EEA649 /* DOMSelection.h */; }; BC5A86B50C3367E800EEA649 /* JSDOMSelection.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BC5A86B30C3367E800EEA649 /* JSDOMSelection.cpp */; }; BC5A86B60C3367E800EEA649 /* JSDOMSelection.h in Headers */ = {isa = PBXBuildFile; fileRef = BC5A86B40C3367E800EEA649 /* JSDOMSelection.h */; }; + BC5CFCA911F793320099ED09 /* LocalizationStrategy.h in Headers */ = {isa = PBXBuildFile; fileRef = BC5CFCA811F793320099ED09 /* LocalizationStrategy.h */; settings = {ATTRIBUTES = (Private, ); }; }; BC5EB5DB0E81B7EA00B25965 /* BorderValue.h in Headers */ = {isa = PBXBuildFile; fileRef = BC5EB5DA0E81B7EA00B25965 /* BorderValue.h */; settings = {ATTRIBUTES = (Private, ); }; }; BC5EB5DD0E81B8DD00B25965 /* OutlineValue.h in Headers */ = {isa = PBXBuildFile; fileRef = BC5EB5DC0E81B8DD00B25965 /* OutlineValue.h */; settings = {ATTRIBUTES = (Private, ); }; }; BC5EB5DF0E81B9AB00B25965 /* CollapsedBorderValue.h in Headers */ = {isa = PBXBuildFile; fileRef = BC5EB5DE0E81B9AB00B25965 /* CollapsedBorderValue.h */; settings = {ATTRIBUTES = (Private, ); }; }; @@ -4782,6 +4792,8 @@ BCDBB8AD0E088CA500C60FF6 /* FileList.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BCDBB8AB0E088CA500C60FF6 /* FileList.cpp */; }; BCDBB8CD0E08958400C60FF6 /* File.h in Headers */ = {isa = PBXBuildFile; fileRef = BCDBB8CB0E08958400C60FF6 /* File.h */; }; BCDBB8CE0E08958400C60FF6 /* File.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BCDBB8CC0E08958400C60FF6 /* File.cpp */; }; + BCDF317B11F8D683003C5BF8 /* UserTypingGestureIndicator.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BCDF317911F8D683003C5BF8 /* UserTypingGestureIndicator.cpp */; }; + BCDF317C11F8D683003C5BF8 /* UserTypingGestureIndicator.h in Headers */ = {isa = PBXBuildFile; fileRef = BCDF317A11F8D683003C5BF8 /* UserTypingGestureIndicator.h */; settings = {ATTRIBUTES = (Private, ); }; }; BCDFD48E0E305290009D10AD /* XMLHttpRequestUpload.h in Headers */ = {isa = PBXBuildFile; fileRef = BCDFD48C0E305290009D10AD /* XMLHttpRequestUpload.h */; }; BCDFD48F0E305290009D10AD /* XMLHttpRequestUpload.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BCDFD48D0E305290009D10AD /* XMLHttpRequestUpload.cpp */; }; BCDFD4920E3056BD009D10AD /* JSXMLHttpRequestUploadCustom.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BCDFD4910E3056BD009D10AD /* JSXMLHttpRequestUploadCustom.cpp */; }; @@ -5087,7 +5099,7 @@ E1C8BE5D0E8BD15A0064CB7D /* JSWorker.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E1C8BE5C0E8BD15A0064CB7D /* JSWorker.cpp */; }; E1CA5CBC0E8CDCAF00E8EF90 /* JSWorkerCustom.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E1CA5CBB0E8CDCAF00E8EF90 /* JSWorkerCustom.cpp */; }; E1CAA5C60E8BD23600A73ECA /* JSWorker.h in Headers */ = {isa = PBXBuildFile; fileRef = E1CAA5C50E8BD23600A73ECA /* JSWorker.h */; }; - E1E1BF00115FF6FB006F52CA /* WindowsKeyboardCodes.h in Headers */ = {isa = PBXBuildFile; fileRef = E1E1BEFF115FF6FB006F52CA /* WindowsKeyboardCodes.h */; }; + E1E1BF00115FF6FB006F52CA /* WindowsKeyboardCodes.h in Headers */ = {isa = PBXBuildFile; fileRef = E1E1BEFF115FF6FB006F52CA /* WindowsKeyboardCodes.h */; settings = {ATTRIBUTES = (Private, ); }; }; E1E6EEA40B628DA8005F2F70 /* JSHTMLSelectElement.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E1E6EEA30B628DA8005F2F70 /* JSHTMLSelectElement.cpp */; }; E1E6EEA80B628DB3005F2F70 /* JSHTMLSelectElement.h in Headers */ = {isa = PBXBuildFile; fileRef = E1E6EEA70B628DB3005F2F70 /* JSHTMLSelectElement.h */; }; E1EBBBD40AAC9B87001FE8E2 /* CSSCharsetRule.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E1EBBBD30AAC9B87001FE8E2 /* CSSCharsetRule.cpp */; }; @@ -5749,6 +5761,10 @@ 084CE5C80F27DADC00E6240E /* WMLOptGroupElement.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WMLOptGroupElement.h; sourceTree = "<group>"; }; 084CE5C90F27DADC00E6240E /* WMLOptionElement.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = WMLOptionElement.cpp; sourceTree = "<group>"; }; 084CE5CA0F27DADC00E6240E /* WMLOptionElement.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WMLOptionElement.h; sourceTree = "<group>"; }; + 084D0E3811F5816100081E1A /* SVGResources.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = SVGResources.cpp; sourceTree = "<group>"; }; + 084D0E3911F5816100081E1A /* SVGResources.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SVGResources.h; sourceTree = "<group>"; }; + 084D0E3A11F5816100081E1A /* SVGResourcesCache.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = SVGResourcesCache.cpp; sourceTree = "<group>"; }; + 084D0E3B11F5816100081E1A /* SVGResourcesCache.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SVGResourcesCache.h; sourceTree = "<group>"; }; 084D2831110A7FCB0038239A /* SVGAnimatedPropertySynchronizer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SVGAnimatedPropertySynchronizer.h; sourceTree = "<group>"; }; 084D2832110A7FCB0038239A /* SVGAnimatedPropertyTraits.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SVGAnimatedPropertyTraits.h; sourceTree = "<group>"; }; 084DBA9D0ED39D350038C226 /* WMLVariables.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = WMLVariables.cpp; sourceTree = "<group>"; }; @@ -5762,10 +5778,13 @@ 08591AA40F085C4E009BACB1 /* InputElement.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = InputElement.h; sourceTree = "<group>"; }; 085AFDC60F2977350061F2B3 /* WMLFormControlElement.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = WMLFormControlElement.cpp; sourceTree = "<group>"; }; 085AFDC70F2977350061F2B3 /* WMLFormControlElement.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WMLFormControlElement.h; sourceTree = "<group>"; }; + 085B05C011FAE16C004D65F6 /* SVGResourcesCycleSolver.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = SVGResourcesCycleSolver.cpp; sourceTree = "<group>"; }; + 085B05C111FAE16C004D65F6 /* SVGResourcesCycleSolver.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SVGResourcesCycleSolver.h; sourceTree = "<group>"; }; 085B92B80EFDE73D00E6123C /* FormDataBuilder.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = FormDataBuilder.cpp; sourceTree = "<group>"; }; 085B92B90EFDE73D00E6123C /* FormDataBuilder.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = FormDataBuilder.h; sourceTree = "<group>"; }; 0865CCE40EDDF51B00DF9EC3 /* WMLNoopElement.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = WMLNoopElement.cpp; sourceTree = "<group>"; }; 0865CCE50EDDF51B00DF9EC3 /* WMLNoopElement.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WMLNoopElement.h; sourceTree = "<group>"; }; + 086A400511F6D6B7002CEC53 /* RenderSVGResourceContainer.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = RenderSVGResourceContainer.cpp; sourceTree = "<group>"; }; 08700BE60F086C5300919419 /* InputElement.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = InputElement.cpp; sourceTree = "<group>"; }; 087281510F26B9B600AFC596 /* OptionElement.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = OptionElement.cpp; sourceTree = "<group>"; }; 087281520F26B9B600AFC596 /* OptionElement.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = OptionElement.h; sourceTree = "<group>"; }; @@ -6533,8 +6552,6 @@ 41E1B1CD0FF5986900576B3B /* SharedWorker.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = SharedWorker.cpp; path = workers/SharedWorker.cpp; sourceTree = "<group>"; }; 41E1B1CE0FF5986900576B3B /* SharedWorker.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = SharedWorker.h; path = workers/SharedWorker.h; sourceTree = "<group>"; }; 41E1B1CF0FF5986900576B3B /* SharedWorker.idl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; name = SharedWorker.idl; path = workers/SharedWorker.idl; sourceTree = "<group>"; }; - 41F060CB0F5EEB2B00A07EAC /* JSInspectorBackend.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSInspectorBackend.cpp; sourceTree = "<group>"; }; - 41F060CC0F5EEB2B00A07EAC /* JSInspectorBackend.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSInspectorBackend.h; sourceTree = "<group>"; }; 41F061720F5F00AC00A07EAC /* InspectorDOMStorageResource.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = InspectorDOMStorageResource.h; sourceTree = "<group>"; }; 41F061730F5F00AC00A07EAC /* InspectorDOMStorageResource.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = InspectorDOMStorageResource.cpp; sourceTree = "<group>"; }; 41F0618C0F5F069800A07EAC /* ConsoleMessage.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ConsoleMessage.h; sourceTree = "<group>"; }; @@ -6772,6 +6789,8 @@ 4F3289B411A42AAB005ABE7E /* InspectorValues.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = InspectorValues.h; sourceTree = "<group>"; }; 4F4F5FFA11CBD2D200A186BF /* RemoteInspectorFrontend.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = RemoteInspectorFrontend.cpp; sourceTree = "<group>"; }; 4F4F5FFC11CBD30100A186BF /* RemoteInspectorFrontend.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RemoteInspectorFrontend.h; sourceTree = "<group>"; }; + 4F707A9711EF679400ACDA69 /* InspectorBackendDispatcher.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = InspectorBackendDispatcher.cpp; sourceTree = "<group>"; }; + 4F707A9811EF679400ACDA69 /* InspectorBackendDispatcher.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = InspectorBackendDispatcher.h; sourceTree = "<group>"; }; 4FD8D0F0119C718B002FA825 /* ScriptGCEvent.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ScriptGCEvent.cpp; sourceTree = "<group>"; }; 4FD8D0F1119C718B002FA825 /* ScriptGCEvent.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ScriptGCEvent.h; sourceTree = "<group>"; }; 510184670B08602A004A825F /* CachedPage.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CachedPage.h; sourceTree = "<group>"; }; @@ -6850,6 +6869,8 @@ 5160300A0CC4251200C8AC25 /* FileSystemPOSIX.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = FileSystemPOSIX.cpp; sourceTree = "<group>"; }; 5160306B0CC4362300C8AC25 /* FileSystemCF.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = FileSystemCF.cpp; sourceTree = "<group>"; }; 5160F4970B0AA75F00C1D2AF /* HistoryItemMac.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; name = HistoryItemMac.mm; path = mac/HistoryItemMac.mm; sourceTree = "<group>"; }; + 5162C7F211F77EFA00612EFE /* SchemeRegistry.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = SchemeRegistry.cpp; sourceTree = "<group>"; }; + 5162C7F311F77EFB00612EFE /* SchemeRegistry.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SchemeRegistry.h; sourceTree = "<group>"; }; 516BB7920CE91E6800512F79 /* JSTreeWalkerCustom.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSTreeWalkerCustom.cpp; sourceTree = "<group>"; }; 51721FB911D2790700638B42 /* BeforeProcessEvent.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = BeforeProcessEvent.h; sourceTree = "<group>"; }; 51721FBA11D2790700638B42 /* BeforeProcessEvent.idl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = BeforeProcessEvent.idl; sourceTree = "<group>"; }; @@ -7114,7 +7135,6 @@ 7578F90811DDF26900D933C5 /* SpeechInput.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = SpeechInput.cpp; sourceTree = "<group>"; }; 7578F90911DDF26900D933C5 /* SpeechInput.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SpeechInput.h; sourceTree = "<group>"; }; 7578F90A11DDF26900D933C5 /* SpeechInputClient.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SpeechInputClient.h; sourceTree = "<group>"; }; - 7578F91D11E4E32800D933C5 /* SpeechInputClientListener.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SpeechInputClientListener.h; sourceTree = "<group>"; }; 7578F91E11E4E32800D933C5 /* SpeechInputListener.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SpeechInputListener.h; sourceTree = "<group>"; }; 75793E800D0CE0B3007FC0AC /* MessageEvent.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; name = MessageEvent.cpp; path = dom/MessageEvent.cpp; sourceTree = SOURCE_ROOT; }; 75793E810D0CE0B3007FC0AC /* MessageEvent.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = MessageEvent.h; path = dom/MessageEvent.h; sourceTree = SOURCE_ROOT; }; @@ -7161,7 +7181,6 @@ 7A24587A1021EAF4000A00AA /* InspectorDOMAgent.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = InspectorDOMAgent.h; sourceTree = "<group>"; }; 7A674BD90F9EBF4E006CF099 /* PageGroupLoadDeferrer.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = PageGroupLoadDeferrer.cpp; sourceTree = "<group>"; }; 7A674BDA0F9EBF4E006CF099 /* PageGroupLoadDeferrer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PageGroupLoadDeferrer.h; sourceTree = "<group>"; }; - 7A74ECB61018399A00BF939E /* InspectorBackend.idl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = InspectorBackend.idl; sourceTree = "<group>"; }; 7A74ECB8101839A500BF939E /* InspectorBackend.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = InspectorBackend.cpp; sourceTree = "<group>"; }; 7A74ECB9101839A600BF939E /* InspectorBackend.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = InspectorBackend.h; sourceTree = "<group>"; }; 7A74ECBC101839DA00BF939E /* JSInspectorFrontendHostCustom.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSInspectorFrontendHostCustom.cpp; sourceTree = "<group>"; }; @@ -8046,6 +8065,7 @@ 89CD027911C859A80070B791 /* BlobBuilder.idl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = BlobBuilder.idl; sourceTree = "<group>"; }; 89CD029111C85B870070B791 /* JSBlobBuilder.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSBlobBuilder.cpp; sourceTree = "<group>"; }; 89CD029211C85B870070B791 /* JSBlobBuilder.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSBlobBuilder.h; sourceTree = "<group>"; }; + 8A12E35C11FA33280025836A /* DocumentLoadTiming.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DocumentLoadTiming.h; sourceTree = "<group>"; }; 8A81BF8411DCFD9000DA2B98 /* ResourceLoadTiming.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ResourceLoadTiming.h; sourceTree = "<group>"; }; 8A844D0111D3C18E0014065C /* Performance.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = Performance.cpp; sourceTree = "<group>"; }; 8A844D0211D3C18E0014065C /* Performance.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Performance.h; sourceTree = "<group>"; }; @@ -10121,6 +10141,7 @@ BC5A86830C33676000EEA649 /* DOMSelection.idl */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = text; path = DOMSelection.idl; sourceTree = "<group>"; }; BC5A86B30C3367E800EEA649 /* JSDOMSelection.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = JSDOMSelection.cpp; sourceTree = "<group>"; }; BC5A86B40C3367E800EEA649 /* JSDOMSelection.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = JSDOMSelection.h; sourceTree = "<group>"; }; + BC5CFCA811F793320099ED09 /* LocalizationStrategy.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = LocalizationStrategy.h; sourceTree = "<group>"; }; BC5EB5DA0E81B7EA00B25965 /* BorderValue.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = BorderValue.h; path = style/BorderValue.h; sourceTree = "<group>"; }; BC5EB5DC0E81B8DD00B25965 /* OutlineValue.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = OutlineValue.h; path = style/OutlineValue.h; sourceTree = "<group>"; }; BC5EB5DE0E81B9AB00B25965 /* CollapsedBorderValue.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = CollapsedBorderValue.h; path = style/CollapsedBorderValue.h; sourceTree = "<group>"; }; @@ -10422,6 +10443,8 @@ BCDBB8AB0E088CA500C60FF6 /* FileList.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = FileList.cpp; sourceTree = "<group>"; }; BCDBB8CB0E08958400C60FF6 /* File.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = File.h; sourceTree = "<group>"; }; BCDBB8CC0E08958400C60FF6 /* File.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = File.cpp; sourceTree = "<group>"; }; + BCDF317911F8D683003C5BF8 /* UserTypingGestureIndicator.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = UserTypingGestureIndicator.cpp; sourceTree = "<group>"; }; + BCDF317A11F8D683003C5BF8 /* UserTypingGestureIndicator.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = UserTypingGestureIndicator.h; sourceTree = "<group>"; }; BCDFD48C0E305290009D10AD /* XMLHttpRequestUpload.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = XMLHttpRequestUpload.h; sourceTree = "<group>"; }; BCDFD48D0E305290009D10AD /* XMLHttpRequestUpload.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = XMLHttpRequestUpload.cpp; sourceTree = "<group>"; }; BCDFD4900E305644009D10AD /* XMLHttpRequestUpload.idl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = XMLHttpRequestUpload.idl; sourceTree = "<group>"; }; @@ -11010,6 +11033,7 @@ 93EEC1EC09C2877700C515D1 /* html */, 1C81B94D0E9732D900266E07 /* inspector */, BCB16BFB0979C38700467741 /* loader */, + FABE72EC1059C1EB00D999DD /* mathml */, 333F703D0FB49C16008E12A6 /* notifications */, 65BF02180974806300C43196 /* page */, BCF1A5BA097832090061A123 /* platform */, @@ -11416,10 +11440,10 @@ 1C5FAECA0DCFD8C900D58F78 /* Inspector */ = { isa = PBXGroup; children = ( + 4F707A9711EF679400ACDA69 /* InspectorBackendDispatcher.cpp */, + 4F707A9811EF679400ACDA69 /* InspectorBackendDispatcher.h */, 7A0E76D810BF059800A0276E /* JSInjectedScriptHost.cpp */, 7A0E76D910BF059800A0276E /* JSInjectedScriptHost.h */, - 41F060CB0F5EEB2B00A07EAC /* JSInspectorBackend.cpp */, - 41F060CC0F5EEB2B00A07EAC /* JSInspectorBackend.h */, 7A0E771C10C00DB100A0276E /* JSInspectorFrontendHost.cpp */, 7A0E771D10C00DB100A0276E /* JSInspectorFrontendHost.h */, 1C5FAECF0DCFD90100D58F78 /* JSJavaScriptCallFrame.cpp */, @@ -11449,7 +11473,6 @@ B885E8D311E06DD2009FFBF4 /* InspectorApplicationCacheAgent.h */, 7A74ECB8101839A500BF939E /* InspectorBackend.cpp */, 7A74ECB9101839A600BF939E /* InspectorBackend.h */, - 7A74ECB61018399A00BF939E /* InspectorBackend.idl */, 1C81B9580E97330800266E07 /* InspectorClient.h */, 1C81B9570E97330800266E07 /* InspectorController.cpp */, 1C81B9560E97330800266E07 /* InspectorController.h */, @@ -12367,7 +12390,6 @@ 7578F90811DDF26900D933C5 /* SpeechInput.cpp */, 7578F90911DDF26900D933C5 /* SpeechInput.h */, 7578F90A11DDF26900D933C5 /* SpeechInputClient.h */, - 7578F91D11E4E32800D933C5 /* SpeechInputClientListener.h */, 7578F91E11E4E32800D933C5 /* SpeechInputListener.h */, 62C1217A11AB9E76003C462C /* SuspendableTimer.cpp */, 62C1217B11AB9E77003C462C /* SuspendableTimer.h */, @@ -15612,14 +15634,14 @@ BC1A3790097C6F970019F3D8 /* bindings */ = { isa = PBXGroup; children = ( - 8C6EA61711EF7E0400FD8EE3 /* RuntimeEnabledFeatures.cpp */, - 8C6EA61811EF7E0400FD8EE3 /* RuntimeEnabledFeatures.h */, BC1A3793097C6FB10019F3D8 /* js */, BC1A3794097C6FC40019F3D8 /* objc */, 93F8B3050A300FE100F61AB8 /* CodeGenerator.pm */, 93F8B3070A300FEA00F61AB8 /* generate-bindings.pl */, 14813BF309EDF88E00F757E1 /* IDLParser.pm */, 93F8B3080A300FEA00F61AB8 /* IDLStructure.pm */, + 8C6EA61711EF7E0400FD8EE3 /* RuntimeEnabledFeatures.cpp */, + 8C6EA61811EF7E0400FD8EE3 /* RuntimeEnabledFeatures.h */, 97EF7DFD107E55B700D7C49C /* ScriptControllerBase.cpp */, CE02F0C311E83ADD00C6684A /* ScriptControllerBase.h */, ); @@ -16005,7 +16027,6 @@ 512DD8E80D91E691000F89EE /* archive */, 5126E6B60A2E3AEF005C29FA /* icon */, 93A1EAA20A5634D8006960A0 /* mac */, - FABE72EC1059C1EB00D999DD /* mathml */, BCB16BFE0979C3BD00467741 /* Cache.cpp */, BCB16BFF0979C3BD00467741 /* Cache.h */, BCB16C000979C3BD00467741 /* CachedCSSStyleSheet.cpp */, @@ -16037,6 +16058,7 @@ BCB16C110979C3BD00467741 /* DocLoader.h */, 93E227DB0AF589AD00D48324 /* DocumentLoader.cpp */, 656D371E0ADBA5DE00A4554D /* DocumentLoader.h */, + 8A12E35C11FA33280025836A /* DocumentLoadTiming.h */, 0B9056150F2578BE0095FF6A /* DocumentThreadableLoader.cpp */, 0B9056160F2578BE0095FF6A /* DocumentThreadableLoader.h */, 9738899E116EA9DC00ADF313 /* DocumentWriter.cpp */, @@ -16217,6 +16239,7 @@ BCFF64900EAD15C200C1D6F7 /* LengthSize.h */, A7AD2F850EC89D07008AB002 /* LinkHash.cpp */, A7AD2F860EC89D07008AB002 /* LinkHash.h */, + BC5CFCA811F793320099ED09 /* LocalizationStrategy.h */, 935207BD09BD410A00F2038D /* LocalizedStrings.h */, A8239DFE09B3CF8A00B60641 /* Logging.cpp */, A8239DFF09B3CF8A00B60641 /* Logging.h */, @@ -16235,6 +16258,8 @@ BC3BE12A0E98092F00835588 /* PopupMenuStyle.h */, E4D687780ED7AE4F006EA978 /* PurgeableBuffer.h */, 1C63A2460F71646600C09D5A /* RunLoopTimer.h */, + 5162C7F211F77EFA00612EFE /* SchemeRegistry.cpp */, + 5162C7F311F77EFB00612EFE /* SchemeRegistry.h */, BC7B2AF80450824100A8000F /* Scrollbar.h */, BC9BC64D0E7C4889008B9849 /* ScrollbarClient.h */, BC8B854A0E7C7F5600AB6984 /* ScrollbarTheme.h */, @@ -16755,6 +16780,7 @@ 083192A7112B43050083C3B9 /* RenderSVGResource.h */, 84BDA16911358D2A00DBF64C /* RenderSVGResourceClipper.cpp */, 84BDA16A11358D2A00DBF64C /* RenderSVGResourceClipper.h */, + 086A400511F6D6B7002CEC53 /* RenderSVGResourceContainer.cpp */, 08082372117987C100241DE8 /* RenderSVGResourceContainer.h */, 841FDC241178C9BE00F8AC9B /* RenderSVGResourceFilter.cpp */, 841FDC251178C9BE00F8AC9B /* RenderSVGResourceFilter.h */, @@ -16841,6 +16867,12 @@ A8F4FB930C169E7B002AFED5 /* SVGRenderSupport.h */, B2EBDC9A0AF77E3400AE4A68 /* SVGRenderTreeAsText.cpp */, B2EBDC9B0AF77E3400AE4A68 /* SVGRenderTreeAsText.h */, + 084D0E3811F5816100081E1A /* SVGResources.cpp */, + 084D0E3911F5816100081E1A /* SVGResources.h */, + 084D0E3A11F5816100081E1A /* SVGResourcesCache.cpp */, + 084D0E3B11F5816100081E1A /* SVGResourcesCache.h */, + 085B05C011FAE16C004D65F6 /* SVGResourcesCycleSolver.cpp */, + 085B05C111FAE16C004D65F6 /* SVGResourcesCycleSolver.h */, 853CA9E40AEEC608002372DC /* SVGRootInlineBox.cpp */, 853CA9E50AEEC608002372DC /* SVGRootInlineBox.h */, 08DAB9C01103D9C1003E7ABA /* SVGShadowTreeElements.cpp */, @@ -17118,6 +17150,8 @@ 85031B390A44EFC700F992E0 /* UIEventWithKeyState.h */, 2542F4D81166C25A00E89A86 /* UserGestureIndicator.cpp */, 2542F4D91166C25A00E89A86 /* UserGestureIndicator.h */, + BCDF317911F8D683003C5BF8 /* UserTypingGestureIndicator.cpp */, + BCDF317A11F8D683003C5BF8 /* UserTypingGestureIndicator.h */, CEF418CC1179678C009D112C /* ViewportArguments.cpp */, CEF418CD1179678C009D112C /* ViewportArguments.h */, 31C0FF1B0E4CEB6E007D6FE5 /* WebKitAnimationEvent.cpp */, @@ -17172,8 +17206,7 @@ FA7EFB031120D25400CF79C7 /* RenderMathMLUnderOver.cpp */, FA7EFB041120D25400CF79C7 /* RenderMathMLUnderOver.h */, ); - name = mathml; - path = ../mathml; + path = mathml; sourceTree = "<group>"; }; /* End PBXGroup section */ @@ -17445,6 +17478,7 @@ A8185F4009765766005826D9 /* Document.h in Headers */, A8185F3D09765766005826D9 /* DocumentFragment.h in Headers */, 656D37360ADBA5DE00A4554D /* DocumentLoader.h in Headers */, + 8A12E35D11FA33280025836A /* DocumentLoadTiming.h in Headers */, ED2BA83C09A24B91006C0AC4 /* DocumentMarker.h in Headers */, BCCFBAE80B5152ED0001F1D7 /* DocumentParser.h in Headers */, 0B90561A0F2578BF0095FF6A /* DocumentThreadableLoader.h in Headers */, @@ -18498,6 +18532,7 @@ 93309DF2099E64920056E581 /* InsertTextCommand.h in Headers */, B885E8D511E06DD2009FFBF4 /* InspectorApplicationCacheAgent.h in Headers */, 7A74ECBB101839A600BF939E /* InspectorBackend.h in Headers */, + 4F707A9A11EF679400ACDA69 /* InspectorBackendDispatcher.h in Headers */, 1C81B95C0E97330800266E07 /* InspectorClient.h in Headers */, 1C81B95A0E97330800266E07 /* InspectorController.h in Headers */, 82B658981189E39200E052A1 /* InspectorCSSStore.h in Headers */, @@ -18716,7 +18751,6 @@ A77979290D6B9E64003851B9 /* JSImageData.h in Headers */, C585A69711D4FB13004C3E4B /* JSIndexedDatabaseRequest.h in Headers */, 7A0E76DB10BF059800A0276E /* JSInjectedScriptHost.h in Headers */, - 41F060CE0F5EEB2B00A07EAC /* JSInspectorBackend.h in Headers */, 7A0E771F10C00DB100A0276E /* JSInspectorFrontendHost.h in Headers */, 49EECF07105070C400099FAB /* JSInt16Array.h in Headers */, 49EECF05105070C400099FAB /* JSInt32Array.h in Headers */, @@ -18989,6 +19023,7 @@ BCB16C2D0979C3BD00467741 /* loader.h in Headers */, 656D37320ADBA5DE00A4554D /* LoaderNSURLExtras.h in Headers */, 06E81ED70AB5D5E900C87837 /* LocalCurrentGraphicsContext.h in Headers */, + BC5CFCA911F793320099ED09 /* LocalizationStrategy.h in Headers */, 935207BE09BD410A00F2038D /* LocalizedStrings.h in Headers */, 511F23180DC160DA004F0032 /* LocalStorageTask.h in Headers */, 511F231A0DC160DA004F0032 /* LocalStorageThread.h in Headers */, @@ -19276,9 +19311,11 @@ 1A569D230D7E2B82007C3983 /* runtime_object.h in Headers */, 1A569D250D7E2B82007C3983 /* runtime_root.h in Headers */, 447D69030FA626810015CCB1 /* RuntimeApplicationChecks.h in Headers */, + 8C6EA61A11EF7E0400FD8EE3 /* RuntimeEnabledFeatures.h in Headers */, 49E911CB0EF86D47009D0CAF /* ScaleTransformOperation.h in Headers */, 5DFE8F570D16477C0076E937 /* ScheduledAction.h in Headers */, 1CEFC9B90D78DC8C007D2579 /* SchedulePair.h in Headers */, + 5162C7F511F77EFB00612EFE /* SchemeRegistry.h in Headers */, BCEC01BE0C274DAC009F4EC9 /* Screen.h in Headers */, A84D82C111D3474800972990 /* ScriptableDocumentParser.h in Headers */, 7A1E88F6101CC384000C4DF5 /* ScriptArray.h in Headers */, @@ -19355,7 +19392,6 @@ 626CDE0F1140424C001E5A68 /* SpatialNavigation.h in Headers */, 7578F90C11DDF26900D933C5 /* SpeechInput.h in Headers */, 7578F90D11DDF26900D933C5 /* SpeechInputClient.h in Headers */, - 7578F91F11E4E32800D933C5 /* SpeechInputClientListener.h in Headers */, 7578F92011E4E32800D933C5 /* SpeechInputListener.h in Headers */, 93309E12099E64920056E581 /* SplitElementCommand.h in Headers */, 93309E14099E64920056E581 /* SplitTextNodeCommand.h in Headers */, @@ -19686,6 +19722,7 @@ BCA2B08B10505BCD0043BD1C /* UserScriptTypes.h in Headers */, BC8BF151105813BF00A40A07 /* UserStyleSheet.h in Headers */, BC8BF15A1058141800A40A07 /* UserStyleSheetTypes.h in Headers */, + BCDF317C11F8D683003C5BF8 /* UserTypingGestureIndicator.h in Headers */, 2E3BBF081162DA1100B9409A /* UUID.h in Headers */, 15C7708D100D3C6B005BA267 /* ValidityState.h in Headers */, CEF418CF1179678C009D112C /* ViewportArguments.h in Headers */, @@ -19831,7 +19868,9 @@ E1BE512E0CF6C512002EA959 /* XSLTUnicodeSort.h in Headers */, 97DD4D870FDF4D6E00ECF9A4 /* XSSAuditor.h in Headers */, CE172E011136E8CE0062A533 /* ZoomMode.h in Headers */, - 8C6EA61A11EF7E0400FD8EE3 /* RuntimeEnabledFeatures.h in Headers */, + 084D0E3D11F5816100081E1A /* SVGResources.h in Headers */, + 084D0E3F11F5816100081E1A /* SVGResourcesCache.h in Headers */, + 085B05C311FAE16C004D65F6 /* SVGResourcesCycleSolver.h in Headers */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -19891,7 +19930,6 @@ isa = PBXProject; buildConfigurationList = 149C284308902B11008A9EFC /* Build configuration list for PBXProject "WebCore" */; compatibilityVersion = "Xcode 2.4"; - developmentRegion = English; hasScannedForEncodings = 1; knownRegions = ( English, @@ -19976,7 +20014,7 @@ ); runOnlyForDeploymentPostprocessing = 0; shellPath = /bin/sh; - shellScript = "# Don't do anything for Debug builds, so the Inspector is easier to debug.\nif [[ ${BUILD_STYLE:=Debug} == \"Debug\" ]]; then\n exit\nfi\n\n# Combine all script resources in the inspector.html file.\n\"$SRCROOT/combine-javascript-resources\" --input-html \"${SRCROOT}/inspector/front-end/inspector.html\" --output-dir \"${DERIVED_FILE_DIR}/WebCore\" --output-script-name inspector.js\n\nif [ -d \"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/inspector\" ]; then\n # Remove any JavaScript files, since they will be replaced with the combined file.\n cd \"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/inspector\"\n rm *.js\n\n # Copy the modified HTML file and the combined script.\n cp \"${DERIVED_FILE_DIR}/WebCore/inspector.html\" inspector.html\n cp \"${DERIVED_FILE_DIR}/WebCore/inspector.js\" inspector.js\nfi\n"; + shellScript = "# Don't do anything for Debug builds, so the Inspector is easier to debug.\nif [[ ${CONFIGURATION:=Debug} == \"Debug\" ]]; then\n exit\nfi\n\n# Combine all script resources in the inspector.html file.\n\"$SRCROOT/combine-javascript-resources\" --input-html \"${SRCROOT}/inspector/front-end/inspector.html\" --output-dir \"${DERIVED_FILE_DIR}/WebCore\" --output-script-name inspector.js\n\nif [ -d \"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/inspector\" ]; then\n # Remove any JavaScript files, since they will be replaced with the combined file.\n cd \"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/inspector\"\n rm *.js\n\n # Copy the modified HTML file and the combined script.\n cp \"${DERIVED_FILE_DIR}/WebCore/inspector.html\" inspector.html\n cp \"${DERIVED_FILE_DIR}/WebCore/inspector.js\" inspector.js\nfi\n"; }; 1C81BA330E97357C00266E07 /* Copy Inspector Resources */ = { isa = PBXShellScriptBuildPhase; @@ -20911,6 +20949,7 @@ 93309DF1099E64920056E581 /* InsertTextCommand.cpp in Sources */, B885E8D411E06DD2009FFBF4 /* InspectorApplicationCacheAgent.cpp in Sources */, 7A74ECBA101839A600BF939E /* InspectorBackend.cpp in Sources */, + 4F707A9911EF679400ACDA69 /* InspectorBackendDispatcher.cpp in Sources */, 1C81B95B0E97330800266E07 /* InspectorController.cpp in Sources */, 82B6589A1189E47600E052A1 /* InspectorCSSStore.cpp in Sources */, 41F062150F5F192600A07EAC /* InspectorDatabaseResource.cpp in Sources */, @@ -21178,7 +21217,6 @@ C585A69611D4FB13004C3E4B /* JSIndexedDatabaseRequest.cpp in Sources */, 7A0E76DA10BF059800A0276E /* JSInjectedScriptHost.cpp in Sources */, 7A0E76D510BF050700A0276E /* JSInjectedScriptHostCustom.cpp in Sources */, - 41F060CD0F5EEB2B00A07EAC /* JSInspectorBackend.cpp in Sources */, 7A0E771E10C00DB100A0276E /* JSInspectorFrontendHost.cpp in Sources */, 7A74ECBD101839DA00BF939E /* JSInspectorFrontendHostCustom.cpp in Sources */, 49EECF06105070C400099FAB /* JSInt16Array.cpp in Sources */, @@ -21741,10 +21779,12 @@ 1A569D220D7E2B82007C3983 /* runtime_object.cpp in Sources */, 1A569D240D7E2B82007C3983 /* runtime_root.cpp in Sources */, 447D69040FA626810015CCB1 /* RuntimeApplicationChecks.mm in Sources */, + 8C6EA61911EF7E0400FD8EE3 /* RuntimeEnabledFeatures.cpp in Sources */, 49E911CA0EF86D47009D0CAF /* ScaleTransformOperation.cpp in Sources */, 5DFE8F560D16477B0076E937 /* ScheduledAction.cpp in Sources */, 1CEFC9BA0D78DC8C007D2579 /* SchedulePair.cpp in Sources */, 1CE24F970D7CAF0E007E04C2 /* SchedulePairMac.mm in Sources */, + 5162C7F411F77EFB00612EFE /* SchemeRegistry.cpp in Sources */, BCEC01BD0C274DAC009F4EC9 /* Screen.cpp in Sources */, A84D82C211D3474800972990 /* ScriptableDocumentParser.cpp in Sources */, 7A1E88F5101CC384000C4DF5 /* ScriptArray.cpp in Sources */, @@ -22096,6 +22136,7 @@ 65DF326109D1E199000BE325 /* UserAgentStyleSheetsData.cpp in Sources */, BCACF3BC1072921A00C0C8A3 /* UserContentURLPattern.cpp in Sources */, 2542F4DA1166C25A00E89A86 /* UserGestureIndicator.cpp in Sources */, + BCDF317B11F8D683003C5BF8 /* UserTypingGestureIndicator.cpp in Sources */, 2E3BBF071162DA1100B9409A /* UUID.cpp in Sources */, 15C7708E100D3C6B005BA267 /* ValidityState.cpp in Sources */, CEF418CE1179678C009D112C /* ViewportArguments.cpp in Sources */, @@ -22225,7 +22266,10 @@ 93F19B0508245E59001E9ABC /* XSLTProcessorLibxslt.cpp in Sources */, E1BE512D0CF6C512002EA959 /* XSLTUnicodeSort.cpp in Sources */, 97DD4D860FDF4D6E00ECF9A4 /* XSSAuditor.cpp in Sources */, - 8C6EA61911EF7E0400FD8EE3 /* RuntimeEnabledFeatures.cpp in Sources */, + 084D0E3C11F5816100081E1A /* SVGResources.cpp in Sources */, + 084D0E3E11F5816100081E1A /* SVGResourcesCache.cpp in Sources */, + 086A400611F6D6B7002CEC53 /* RenderSVGResourceContainer.cpp in Sources */, + 085B05C211FAE16C004D65F6 /* SVGResourcesCycleSolver.cpp in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; diff --git a/WebCore/accessibility/AccessibilityObject.cpp b/WebCore/accessibility/AccessibilityObject.cpp index bc4e2f5..a0959e6 100644 --- a/WebCore/accessibility/AccessibilityObject.cpp +++ b/WebCore/accessibility/AccessibilityObject.cpp @@ -977,31 +977,18 @@ bool AccessibilityObject::supportsARIALiveRegion() const return equalIgnoringCase(liveRegion, "polite") || equalIgnoringCase(liveRegion, "assertive"); } -int AccessibilityObject::intValue() const +AccessibilityButtonState AccessibilityObject::checkboxOrRadioValue() const { - if (isPasswordField()) - return 0; - - if (isHeading()) - return headingLevel(); - // If this is a real checkbox or radio button, AccessibilityRenderObject will handle. // If it's an ARIA checkbox or radio, the aria-checked attribute should be used. - if (isCheckboxOrRadio()) - return equalIgnoringCase(getAttribute(aria_checkedAttr), "true"); - - return 0; -} -bool AccessibilityObject::hasIntValue() const -{ - if (isHeading()) - return true; + const AtomicString& result = getAttribute(aria_checkedAttr); + if (equalIgnoringCase(result, "true")) + return ButtonStateOn; + if (equalIgnoringCase(result, "mixed")) + return ButtonStateMixed; - if (isCheckboxOrRadio()) - return true; - - return false; + return ButtonStateOff; } } // namespace WebCore diff --git a/WebCore/accessibility/AccessibilityObject.h b/WebCore/accessibility/AccessibilityObject.h index 400a200..b8b0875 100644 --- a/WebCore/accessibility/AccessibilityObject.h +++ b/WebCore/accessibility/AccessibilityObject.h @@ -209,6 +209,12 @@ enum AccessibilityObjectInclusion { IgnoreObject, DefaultBehavior, }; + +enum AccessibilityButtonState { + ButtonStateOff = 0, + ButtonStateOn, + ButtonStateMixed, +}; struct VisiblePositionRange { @@ -327,9 +333,6 @@ public: virtual bool canSetSelectedChildrenAttribute() const { return false; } virtual bool canSetExpandedAttribute() const { return false; } - bool hasIntValue() const; - virtual int intValue() const; - // A programmatic way to set a name on an AccessibleObject. virtual void setAccessibleName(String&) { } @@ -338,6 +341,7 @@ public: virtual bool accessibilityIsIgnored() const { return true; } virtual int headingLevel() const { return 0; } + virtual AccessibilityButtonState checkboxOrRadioValue() const; virtual String valueDescription() const { return String(); } virtual float valueForRange() const { return 0.0f; } virtual float maxValueForRange() const { return 0.0f; } diff --git a/WebCore/accessibility/AccessibilityRenderObject.cpp b/WebCore/accessibility/AccessibilityRenderObject.cpp index 1b3c461..5144950 100644 --- a/WebCore/accessibility/AccessibilityRenderObject.cpp +++ b/WebCore/accessibility/AccessibilityRenderObject.cpp @@ -189,7 +189,7 @@ AccessibilityObject* AccessibilityRenderObject::firstChild() const if (!firstChild) return 0; - return m_renderer->document()->axObjectCache()->getOrCreate(firstChild); + return axObjectCache()->getOrCreate(firstChild); } AccessibilityObject* AccessibilityRenderObject::lastChild() const @@ -202,7 +202,7 @@ AccessibilityObject* AccessibilityRenderObject::lastChild() const if (!lastChild) return 0; - return m_renderer->document()->axObjectCache()->getOrCreate(lastChild); + return axObjectCache()->getOrCreate(lastChild); } static inline RenderInline* startOfContinuations(RenderObject* r) @@ -304,7 +304,7 @@ AccessibilityObject* AccessibilityRenderObject::previousSibling() const if (!previousSibling) return 0; - return m_renderer->document()->axObjectCache()->getOrCreate(previousSibling); + return axObjectCache()->getOrCreate(previousSibling); } static inline bool lastChildHasContinuation(RenderObject* renderer) @@ -354,10 +354,10 @@ AccessibilityObject* AccessibilityRenderObject::nextSibling() const if (!nextSibling) return 0; - return m_renderer->document()->axObjectCache()->getOrCreate(nextSibling); + return axObjectCache()->getOrCreate(nextSibling); } -AccessibilityObject* AccessibilityRenderObject::parentObjectIfExists() const +RenderObject* AccessibilityRenderObject::renderParentObject() const { if (!m_renderer) return 0; @@ -374,11 +374,13 @@ AccessibilityObject* AccessibilityRenderObject::parentObjectIfExists() const // the earliest node in the continuation chain. else if (parent && parent->isRenderInline() && (startOfConts = startOfContinuations(parent))) parent = startOfConts; - - if (!parent) - return 0; - - return m_renderer->document()->axObjectCache()->get(parent); + + return parent; +} + +AccessibilityObject* AccessibilityRenderObject::parentObjectIfExists() const +{ + return axObjectCache()->get(renderParentObject()); } AccessibilityObject* AccessibilityRenderObject::parentObject() const @@ -386,24 +388,8 @@ AccessibilityObject* AccessibilityRenderObject::parentObject() const if (!m_renderer) return 0; - RenderObject* parent = m_renderer->parent(); - - // Case 1: node is a block and is an inline's continuation. Parent - // is the start of the continuation chain. - RenderInline* startOfConts = 0; - if (m_renderer->isRenderBlock() && (startOfConts = startOfContinuations(m_renderer))) - parent = startOfConts; - - // Case 2: node's parent is an inline which is some node's continuation; parent is - // the earliest node in the continuation chain. - else if (parent && parent->isRenderInline() && (startOfConts = startOfContinuations(parent))) - parent = startOfConts; - - if (!parent) - return 0; - if (ariaRoleAttribute() == MenuBarRole) - return m_renderer->document()->axObjectCache()->getOrCreate(parent); + return axObjectCache()->getOrCreate(m_renderer->parent()); // menuButton and its corresponding menu are DOM siblings, but Accessibility needs them to be parent/child if (ariaRoleAttribute() == MenuRole) { @@ -412,7 +398,7 @@ AccessibilityObject* AccessibilityRenderObject::parentObject() const return parent; } - return m_renderer->document()->axObjectCache()->getOrCreate(parent); + return axObjectCache()->getOrCreate(renderParentObject()); } bool AccessibilityRenderObject::isWebArea() const @@ -569,6 +555,15 @@ bool AccessibilityRenderObject::isIndeterminate() const return inputElement->isIndeterminate(); } +bool AccessibilityRenderObject::isNativeCheckboxOrRadio() const +{ + Node* elementNode = node(); + if (elementNode && elementNode->isElementNode()) + return toInputElement(static_cast<Element*>(elementNode)); + + return false; +} + bool AccessibilityRenderObject::isChecked() const { ASSERT(m_renderer); @@ -724,7 +719,7 @@ AccessibilityObject* AccessibilityRenderObject::selectedRadioButton() int count = m_children.size(); for (int i = 0; i < count; ++i) { AccessibilityObject* object = m_children[i].get(); - if (object->roleValue() == RadioButtonRole && object->intValue() == 1) + if (object->roleValue() == RadioButtonRole && object->checkboxOrRadioValue() == ButtonStateOn) return object; } return 0; @@ -742,7 +737,7 @@ AccessibilityObject* AccessibilityRenderObject::selectedTabItem() int count = tabs.size(); for (int i = 0; i < count; ++i) { AccessibilityObject* object = m_children[i].get(); - if (object->isTabItem() && object->intValue() == 1) + if (object->isTabItem() && object->isChecked()) return object; } return 0; @@ -882,7 +877,7 @@ AccessibilityObject* AccessibilityRenderObject::menuForMenuButton() const { Element* menu = menuElementForMenuButton(); if (menu && menu->renderer()) - return m_renderer->document()->axObjectCache()->getOrCreate(menu->renderer()); + return axObjectCache()->getOrCreate(menu->renderer()); return 0; } @@ -900,7 +895,7 @@ AccessibilityObject* AccessibilityRenderObject::menuButtonForMenu() const if (menuItem && menuItem->renderer()) { // ARIA just has generic menu items. AppKit needs to know if this is a top level items like MenuBarButton or MenuBarItem - AccessibilityObject* menuItemAX = m_renderer->document()->axObjectCache()->getOrCreate(menuItem->renderer()); + AccessibilityObject* menuItemAX = axObjectCache()->getOrCreate(menuItem->renderer()); if (menuItemAX->isMenuButton()) return menuItemAX; } @@ -1009,12 +1004,12 @@ Node* AccessibilityRenderObject::node() const return m_renderer ? m_renderer->node() : 0; } -int AccessibilityRenderObject::intValue() const +AccessibilityButtonState AccessibilityRenderObject::checkboxOrRadioValue() const { - if (isCheckboxOrRadio()) - return isChecked() ? 1 : 0; - - return AccessibilityObject::intValue(); + if (isNativeCheckboxOrRadio()) + return isChecked() ? ButtonStateOn : ButtonStateOff; + + return AccessibilityObject::checkboxOrRadioValue(); } String AccessibilityRenderObject::valueDescription() const @@ -1468,7 +1463,7 @@ void AccessibilityRenderObject::addRadioButtonGroupMembers(AccessibilityChildren unsigned len = formElements.size(); for (unsigned i = 0; i < len; ++i) { Node* associateElement = formElements[i].get(); - if (AccessibilityObject* object = m_renderer->document()->axObjectCache()->getOrCreate(associateElement->renderer())) + if (AccessibilityObject* object = axObjectCache()->getOrCreate(associateElement->renderer())) linkedUIElements.append(object); } } else { @@ -1478,7 +1473,7 @@ void AccessibilityRenderObject::addRadioButtonGroupMembers(AccessibilityChildren if (list->item(i)->hasTagName(inputTag)) { HTMLInputElement* associateElement = static_cast<HTMLInputElement*>(list->item(i)); if (associateElement->isRadioButton() && associateElement->name() == input->name()) { - if (AccessibilityObject* object = m_renderer->document()->axObjectCache()->getOrCreate(associateElement->renderer())) + if (AccessibilityObject* object = axObjectCache()->getOrCreate(associateElement->renderer())) linkedUIElements.append(object); } } @@ -2267,6 +2262,7 @@ Widget* AccessibilityRenderObject::widget() const AXObjectCache* AccessibilityRenderObject::axObjectCache() const { + ASSERT(m_renderer); return m_renderer->document()->axObjectCache(); } @@ -3176,7 +3172,7 @@ bool AccessibilityRenderObject::canSetTextRangeAttributes() const void AccessibilityRenderObject::contentChanged() { // If this element supports ARIA live regions, then notify the AT of changes. - AXObjectCache* cache = m_renderer->document()->axObjectCache(); + AXObjectCache* cache = axObjectCache(); for (RenderObject* renderParent = m_renderer; renderParent; renderParent = renderParent->parent()) { AccessibilityObject* parent = cache->get(renderParent); if (!parent) @@ -3298,7 +3294,7 @@ void AccessibilityRenderObject::addChildren() // add an <area> element for this child if it has a link if (current->hasTagName(areaTag) && current->isLink()) { - AccessibilityImageMapLink* areaObject = static_cast<AccessibilityImageMapLink*>(m_renderer->document()->axObjectCache()->getOrCreate(ImageMapLinkRole)); + AccessibilityImageMapLink* areaObject = static_cast<AccessibilityImageMapLink*>(axObjectCache()->getOrCreate(ImageMapLinkRole)); areaObject->setHTMLAreaElement(static_cast<HTMLAreaElement*>(current)); areaObject->setHTMLMapElement(map); areaObject->setParent(this); diff --git a/WebCore/accessibility/AccessibilityRenderObject.h b/WebCore/accessibility/AccessibilityRenderObject.h index 526324f..c05bc2d 100644 --- a/WebCore/accessibility/AccessibilityRenderObject.h +++ b/WebCore/accessibility/AccessibilityRenderObject.h @@ -117,7 +117,7 @@ public: virtual bool accessibilityIsIgnored() const; virtual int headingLevel() const; - virtual int intValue() const; + virtual AccessibilityButtonState checkboxOrRadioValue() const; virtual String valueDescription() const; virtual float valueForRange() const; virtual float maxValueForRange() const; @@ -283,12 +283,14 @@ private: AccessibilityRole determineAriaRoleAttribute() const; bool isTabItemSelected() const; + bool isNativeCheckboxOrRadio() const; IntRect checkboxOrRadioRect() const; void addRadioButtonGroupMembers(AccessibilityChildrenVector& linkedUIElements) const; AccessibilityObject* internalLinkElement() const; AccessibilityObject* accessibilityImageMapHitTest(HTMLAreaElement*, const IntPoint&) const; AccessibilityObject* accessibilityParentForImageMap(HTMLMapElement* map) const; bool renderObjectIsObservable(RenderObject*) const; + RenderObject* renderParentObject() const; void ariaSelectedRows(AccessibilityChildrenVector&); diff --git a/WebCore/accessibility/AccessibilityTable.cpp b/WebCore/accessibility/AccessibilityTable.cpp index a0bb655..04ecac3 100644 --- a/WebCore/accessibility/AccessibilityTable.cpp +++ b/WebCore/accessibility/AccessibilityTable.cpp @@ -145,7 +145,7 @@ bool AccessibilityTable::isTableExposableThroughAccessibility() int headersInFirstRowCount = 0; for (int col = 0; col < numCols; ++col) { - RenderTableCell* cell = firstBody->cellAt(row, col).cell; + RenderTableCell* cell = firstBody->primaryCellAt(row, col); if (!cell) continue; Node* cellNode = cell->node(); @@ -287,7 +287,7 @@ void AccessibilityTable::addChildren() for (unsigned rowIndex = 0; rowIndex < numRows; ++rowIndex) { for (unsigned colIndex = 0; colIndex < numCols; ++colIndex) { - RenderTableCell* cell = tableSection->cellAt(rowIndex, colIndex).cell; + RenderTableCell* cell = tableSection->primaryCellAt(rowIndex, colIndex); if (!cell) continue; @@ -441,7 +441,7 @@ AccessibilityTableCell* AccessibilityTable::cellForColumnAndRow(unsigned column, unsigned sectionSpecificRow = row - rowOffset; if (row < rowCount && column < numCols && sectionSpecificRow < numRows) { - cell = tableSection->cellAt(sectionSpecificRow, column).cell; + cell = tableSection->primaryCellAt(sectionSpecificRow, column); // we didn't find the cell, which means there's spanning happening // search backwards to find the spanning cell @@ -449,7 +449,7 @@ AccessibilityTableCell* AccessibilityTable::cellForColumnAndRow(unsigned column, // first try rows for (int testRow = sectionSpecificRow-1; testRow >= 0; --testRow) { - cell = tableSection->cellAt(testRow, column).cell; + cell = tableSection->primaryCellAt(testRow, column); // cell overlapped. use this one if (cell && ((cell->row() + (cell->rowSpan()-1)) >= (int)sectionSpecificRow)) break; @@ -459,7 +459,7 @@ AccessibilityTableCell* AccessibilityTable::cellForColumnAndRow(unsigned column, if (!cell) { // try cols for (int testCol = column-1; testCol >= 0; --testCol) { - cell = tableSection->cellAt(sectionSpecificRow, testCol).cell; + cell = tableSection->primaryCellAt(sectionSpecificRow, testCol); // cell overlapped. use this one if (cell && ((cell->col() + (cell->colSpan()-1)) >= (int)column)) break; diff --git a/WebCore/accessibility/AccessibilityTableCell.cpp b/WebCore/accessibility/AccessibilityTableCell.cpp index 28e66ad..e2efb5e 100644 --- a/WebCore/accessibility/AccessibilityTableCell.cpp +++ b/WebCore/accessibility/AccessibilityTableCell.cpp @@ -165,7 +165,7 @@ AccessibilityObject* AccessibilityTableCell::titleUIElement() const if (!section) return 0; - RenderTableCell* headerCell = section->cellAt(row, 0).cell; + RenderTableCell* headerCell = section->primaryCellAt(row, 0); if (!headerCell || headerCell == renderCell) return 0; diff --git a/WebCore/accessibility/AccessibilityTableColumn.cpp b/WebCore/accessibility/AccessibilityTableColumn.cpp index 45137ff..f776e40 100644 --- a/WebCore/accessibility/AccessibilityTableColumn.cpp +++ b/WebCore/accessibility/AccessibilityTableColumn.cpp @@ -136,7 +136,7 @@ AccessibilityObject* AccessibilityTableColumn::headerObjectForSection(RenderTabl RenderTableCell* cell = 0; // also account for cells that have a span for (int testCol = m_columnIndex; testCol >= 0; --testCol) { - RenderTableCell* testCell = section->cellAt(0, testCol).cell; + RenderTableCell* testCell = section->primaryCellAt(0, testCol); if (!testCell) continue; diff --git a/WebCore/accessibility/mac/AccessibilityObjectWrapper.mm b/WebCore/accessibility/mac/AccessibilityObjectWrapper.mm index a711116..94d2be3 100644 --- a/WebCore/accessibility/mac/AccessibilityObjectWrapper.mm +++ b/WebCore/accessibility/mac/AccessibilityObjectWrapper.mm @@ -41,6 +41,7 @@ #import "AccessibilityTableRow.h" #import "AccessibilityTableColumn.h" #import "ColorMac.h" +#import "EditorClient.h" #import "Frame.h" #import "HTMLAnchorElement.h" #import "HTMLAreaElement.h" @@ -390,32 +391,24 @@ static void AXAttributeStringSetBlockquoteLevel(NSMutableAttributedString* attrS [attrString removeAttribute:NSAccessibilityBlockQuoteLevelAttribute range:range]; } -static void AXAttributeStringSetSpelling(NSMutableAttributedString* attrString, Node* node, int offset, NSRange range) +static void AXAttributeStringSetSpelling(NSMutableAttributedString* attrString, Node* node, const UChar* chars, int charLength, NSRange range) { - Vector<DocumentMarker> markers = node->renderer()->document()->markersForNode(node); - Vector<DocumentMarker>::iterator markerIt = markers.begin(); - - unsigned endOffset = (unsigned)offset + range.length; - for ( ; markerIt != markers.end(); markerIt++) { - DocumentMarker marker = *markerIt; - - if (marker.type != DocumentMarker::Spelling) - continue; - - if (marker.endOffset <= (unsigned)offset) - continue; - - if (marker.startOffset > endOffset) + // Check the spelling directly since document->markersForNode() does not store the misspelled marking when the cursor is in a word. + EditorClient* client = node->document()->page()->editorClient(); + int currentPosition = 0; + while (charLength > 0) { + const UChar* charData = chars + currentPosition; + + int misspellingLocation = -1; + int misspellingLength = 0; + client->checkSpellingOfString(charData, charLength, &misspellingLocation, &misspellingLength); + if (misspellingLocation == -1 || !misspellingLength) break; - // add misspelling attribute for the intersection of the marker and the range - int rStart = range.location + (marker.startOffset - offset); - int rLength = min(marker.endOffset, endOffset) - marker.startOffset; - NSRange spellRange = NSMakeRange(rStart, rLength); + NSRange spellRange = NSMakeRange(range.location + currentPosition + misspellingLocation, misspellingLength); AXAttributeStringSetNumber(attrString, NSAccessibilityMisspelledTextAttribute, [NSNumber numberWithBool:YES], spellRange); - - if (marker.endOffset > endOffset + 1) - break; + charLength -= (misspellingLocation + misspellingLength); + currentPosition += (misspellingLocation + misspellingLength); } } @@ -459,7 +452,7 @@ static void AXAttributeStringSetElement(NSMutableAttributedString* attrString, N [attrString removeAttribute:attribute range:range]; } -static void AXAttributedStringAppendText(NSMutableAttributedString* attrString, Node* node, int offset, const UChar* chars, int length) +static void AXAttributedStringAppendText(NSMutableAttributedString* attrString, Node* node, const UChar* chars, int length) { // skip invisible text if (!node->renderer()) @@ -478,6 +471,7 @@ static void AXAttributedStringAppendText(NSMutableAttributedString* attrString, // remove inherited attachment from prior AXAttributedStringAppendReplaced [attrString removeAttribute:NSAccessibilityAttachmentTextAttribute range:attrStringRange]; + [attrString removeAttribute:NSAccessibilityMisspelledTextAttribute range:attrStringRange]; // set new attributes AXAttributeStringSetStyle(attrString, node->renderer(), attrStringRange); @@ -486,7 +480,7 @@ static void AXAttributedStringAppendText(NSMutableAttributedString* attrString, AXAttributeStringSetElement(attrString, NSAccessibilityLinkTextAttribute, AccessibilityObject::anchorElementForNode(node), attrStringRange); // do spelling last because it tends to break up the range - AXAttributeStringSetSpelling(attrString, node, offset, attrStringRange); + AXAttributeStringSetSpelling(attrString, node, chars, length, attrStringRange); } static NSString* nsStringForReplacedNode(Node* replacedNode) @@ -538,9 +532,9 @@ static NSString* nsStringForReplacedNode(Node* replacedNode) // Add the text of the list marker item if necessary. String listMarkerText = m_object->listMarkerTextForNodeAndPosition(node, VisiblePosition(it.range()->startPosition())); if (!listMarkerText.isEmpty()) - AXAttributedStringAppendText(attrString, node, offset, listMarkerText.characters(), listMarkerText.length()); + AXAttributedStringAppendText(attrString, node, listMarkerText.characters(), listMarkerText.length()); - AXAttributedStringAppendText(attrString, node, offset, it.characters(), it.length()); + AXAttributedStringAppendText(attrString, node, it.characters(), it.length()); } else { Node* replacedNode = node->childNode(offset); NSString *attachmentString = nsStringForReplacedNode(replacedNode); @@ -1515,8 +1509,19 @@ static NSString* roleValueToNSString(AccessibilityRole value) } if (m_object->isProgressIndicator() || m_object->isSlider() || m_object->isScrollbar()) return [NSNumber numberWithFloat:m_object->valueForRange()]; - if (m_object->hasIntValue()) - return [NSNumber numberWithInt:m_object->intValue()]; + if (m_object->isHeading()) + return [NSNumber numberWithInt:m_object->headingLevel()]; + + if (m_object->isCheckboxOrRadio()) { + switch (m_object->checkboxOrRadioValue()) { + case ButtonStateOff: + return [NSNumber numberWithInt:0]; + case ButtonStateOn: + return [NSNumber numberWithInt:1]; + case ButtonStateMixed: + return [NSNumber numberWithInt:2]; + } + } // radio groups return the selected radio button as the AXValue if (m_object->isRadioGroup()) { diff --git a/WebCore/bindings/generic/RuntimeEnabledFeatures.h b/WebCore/bindings/generic/RuntimeEnabledFeatures.h index d8eae23..b059d6e 100644 --- a/WebCore/bindings/generic/RuntimeEnabledFeatures.h +++ b/WebCore/bindings/generic/RuntimeEnabledFeatures.h @@ -56,6 +56,7 @@ public: static void setIndexedDBEnabled(bool isEnabled) { isIndexedDBEnabled = isEnabled; } static bool indexedDBEnabled() { return isIndexedDBEnabled; } + static bool iDBKeyRangeEnabled() { return indexedDBEnabled(); } #if ENABLE(VIDEO) static bool audioEnabled(); diff --git a/WebCore/bindings/js/JSDatabaseCustom.cpp b/WebCore/bindings/js/JSDatabaseCustom.cpp index 26f9db7..6733320 100644 --- a/WebCore/bindings/js/JSDatabaseCustom.cpp +++ b/WebCore/bindings/js/JSDatabaseCustom.cpp @@ -57,17 +57,20 @@ JSValue JSDatabase::changeVersion(ExecState* exec) if (exec->hadException()) return jsUndefined(); - JSObject* object = exec->argument(2).getObject(); - if (!object) { - setDOMException(exec, TYPE_MISMATCH_ERR); - return jsUndefined(); - } + RefPtr<SQLTransactionCallback> callback; + if (exec->argumentCount() > 2 && !exec->argument(2).isNull()) { + JSObject* object = exec->argument(2).getObject(); + if (!object) { + setDOMException(exec, TYPE_MISMATCH_ERR); + return jsUndefined(); + } - RefPtr<SQLTransactionCallback> callback(JSSQLTransactionCallback::create(object, static_cast<JSDOMGlobalObject*>(globalObject()))); + callback = JSSQLTransactionCallback::create(object, static_cast<JSDOMGlobalObject*>(globalObject())); + } RefPtr<SQLTransactionErrorCallback> errorCallback; - if (!exec->argument(3).isNull()) { - object = exec->argument(3).getObject(); + if (exec->argumentCount() > 3 && !exec->argument(3).isNull()) { + JSObject* object = exec->argument(3).getObject(); if (!object) { setDOMException(exec, TYPE_MISMATCH_ERR); return jsUndefined(); @@ -77,8 +80,8 @@ JSValue JSDatabase::changeVersion(ExecState* exec) } RefPtr<VoidCallback> successCallback; - if (!exec->argument(4).isNull()) { - object = exec->argument(4).getObject(); + if (exec->argumentCount() > 4 && !exec->argument(4).isNull()) { + JSObject* object = exec->argument(4).getObject(); if (!object) { setDOMException(exec, TYPE_MISMATCH_ERR); return jsUndefined(); diff --git a/WebCore/bindings/js/JSDatabaseSyncCustom.cpp b/WebCore/bindings/js/JSDatabaseSyncCustom.cpp index 79eb376..f929658 100644 --- a/WebCore/bindings/js/JSDatabaseSyncCustom.cpp +++ b/WebCore/bindings/js/JSDatabaseSyncCustom.cpp @@ -52,14 +52,17 @@ JSValue JSDatabaseSync::changeVersion(ExecState* exec) if (exec->hadException()) return jsUndefined(); - JSObject* object = exec->argument(2).getObject(); - if (!object) { - setDOMException(exec, TYPE_MISMATCH_ERR); - return jsUndefined(); + RefPtr<SQLTransactionSyncCallback> callback; + if (exec->argumentCount() > 2 && !exec->argument(2).isNull()) { + JSObject* object = exec->argument(2).getObject(); + if (!object) { + setDOMException(exec, TYPE_MISMATCH_ERR); + return jsUndefined(); + } + + callback = JSSQLTransactionSyncCallback::create(object, static_cast<JSDOMGlobalObject*>(globalObject())); } - RefPtr<SQLTransactionSyncCallback> callback(JSSQLTransactionSyncCallback::create(object, static_cast<JSDOMGlobalObject*>(globalObject()))); - ExceptionCode ec = 0; m_impl->changeVersion(oldVersion, newVersion, callback.release(), ec); setDOMException(exec, ec); diff --git a/WebCore/bindings/js/JSHTMLAppletElementCustom.cpp b/WebCore/bindings/js/JSHTMLAppletElementCustom.cpp index 40d20cf..2bff01a 100644 --- a/WebCore/bindings/js/JSHTMLAppletElementCustom.cpp +++ b/WebCore/bindings/js/JSHTMLAppletElementCustom.cpp @@ -45,12 +45,12 @@ bool JSHTMLAppletElement::getOwnPropertyDescriptorDelegate(ExecState* exec, cons bool JSHTMLAppletElement::putDelegate(ExecState* exec, const Identifier& propertyName, JSValue value, PutPropertySlot& slot) { - return runtimeObjectCustomPut(exec, propertyName, value, impl(), slot); + return runtimeObjectCustomPut(exec, propertyName, value, this, slot); } CallType JSHTMLAppletElement::getCallData(CallData& callData) { - return runtimeObjectGetCallData(impl(), callData); + return runtimeObjectGetCallData(this, callData); } } // namespace WebCore diff --git a/WebCore/bindings/js/JSHTMLEmbedElementCustom.cpp b/WebCore/bindings/js/JSHTMLEmbedElementCustom.cpp index b9f8c12..72e695b 100644 --- a/WebCore/bindings/js/JSHTMLEmbedElementCustom.cpp +++ b/WebCore/bindings/js/JSHTMLEmbedElementCustom.cpp @@ -45,12 +45,12 @@ bool JSHTMLEmbedElement::getOwnPropertyDescriptorDelegate(ExecState* exec, const bool JSHTMLEmbedElement::putDelegate(ExecState* exec, const Identifier& propertyName, JSValue value, PutPropertySlot& slot) { - return runtimeObjectCustomPut(exec, propertyName, value, impl(), slot); + return runtimeObjectCustomPut(exec, propertyName, value, this, slot); } CallType JSHTMLEmbedElement::getCallData(CallData& callData) { - return runtimeObjectGetCallData(impl(), callData); + return runtimeObjectGetCallData(this, callData); } } // namespace WebCore diff --git a/WebCore/bindings/js/JSHTMLObjectElementCustom.cpp b/WebCore/bindings/js/JSHTMLObjectElementCustom.cpp index 68c9e59..c87b932 100644 --- a/WebCore/bindings/js/JSHTMLObjectElementCustom.cpp +++ b/WebCore/bindings/js/JSHTMLObjectElementCustom.cpp @@ -45,12 +45,12 @@ bool JSHTMLObjectElement::getOwnPropertyDescriptorDelegate(ExecState* exec, cons bool JSHTMLObjectElement::putDelegate(ExecState* exec, const Identifier& propertyName, JSValue value, PutPropertySlot& slot) { - return runtimeObjectCustomPut(exec, propertyName, value, impl(), slot); + return runtimeObjectCustomPut(exec, propertyName, value, this, slot); } CallType JSHTMLObjectElement::getCallData(CallData& callData) { - return runtimeObjectGetCallData(impl(), callData); + return runtimeObjectGetCallData(this, callData); } } // namespace WebCore diff --git a/WebCore/bindings/js/JSInspectorFrontendHostCustom.cpp b/WebCore/bindings/js/JSInspectorFrontendHostCustom.cpp index c119adf..b724f50 100644 --- a/WebCore/bindings/js/JSInspectorFrontendHostCustom.cpp +++ b/WebCore/bindings/js/JSInspectorFrontendHostCustom.cpp @@ -92,7 +92,9 @@ JSValue JSInspectorFrontendHost::showContextMenu(ExecState* exec) JSValue label = item->get(exec, Identifier(exec, "label")); JSValue id = item->get(exec, Identifier(exec, "id")); if (label.isUndefined() || id.isUndefined()) - items.append(new ContextMenuItem(SeparatorType, ContextMenuItemTagNoAction, String())); + items.append(new ContextMenuItem(SeparatorType, + ContextMenuItemCustomTagNoAction, + String())); else { ContextMenuAction typedId = static_cast<ContextMenuAction>(ContextMenuItemBaseCustomTag + id.toInt32(exec)); items.append(new ContextMenuItem(ActionType, typedId, ustringToString(label.toString(exec)))); diff --git a/WebCore/bindings/js/JSPluginElementFunctions.cpp b/WebCore/bindings/js/JSPluginElementFunctions.cpp index 7cc2e65..cf43e91 100644 --- a/WebCore/bindings/js/JSPluginElementFunctions.cpp +++ b/WebCore/bindings/js/JSPluginElementFunctions.cpp @@ -24,7 +24,7 @@ #include "HTMLNames.h" #include "HTMLPlugInElement.h" #include "JSHTMLElement.h" -#include "runtime_object.h" +#include "PluginViewBase.h" using namespace JSC; @@ -49,30 +49,50 @@ Instance* pluginInstance(Node* node) return instance; } -static RuntimeObject* getRuntimeObject(ExecState* exec, Node* node) +JSObject* pluginScriptObject(ExecState* exec, JSHTMLElement* jsHTMLElement) { - Instance* instance = pluginInstance(node); - if (!instance) + HTMLElement* element = jsHTMLElement->impl(); + if (!(element->hasTagName(objectTag) || element->hasTagName(embedTag) || element->hasTagName(appletTag))) return 0; + + HTMLPlugInElement* pluginElement = static_cast<HTMLPlugInElement*>(element); + + // First, see if we can ask the plug-in view for its script object. + if (Widget* pluginWidget = pluginElement->pluginWidget()) { + if (pluginWidget->isPluginViewBase()) { + PluginViewBase* pluginViewBase = static_cast<PluginViewBase*>(pluginWidget); + if (JSObject* scriptObject = pluginViewBase->scriptObject(exec, jsHTMLElement->globalObject())) + return scriptObject; + } + } + + // Otherwise, fall back to getting the object from the instance. + + // The plugin element holds an owning reference, so we don't have to. + Instance* instance = pluginElement->getInstance().get(); + if (!instance || !instance->rootObject()) + return 0; + return instance->createRuntimeObject(exec); } - + JSValue runtimeObjectPropertyGetter(ExecState* exec, JSValue slotBase, const Identifier& propertyName) { - JSHTMLElement* thisObj = static_cast<JSHTMLElement*>(asObject(slotBase)); - HTMLElement* element = static_cast<HTMLElement*>(thisObj->impl()); - RuntimeObject* runtimeObject = getRuntimeObject(exec, element); - if (!runtimeObject) + JSHTMLElement* element = static_cast<JSHTMLElement*>(asObject(slotBase)); + JSObject* scriptObject = pluginScriptObject(exec, element); + if (!scriptObject) return jsUndefined(); - return runtimeObject->get(exec, propertyName); + + return scriptObject->get(exec, propertyName); } bool runtimeObjectCustomGetOwnPropertySlot(ExecState* exec, const Identifier& propertyName, PropertySlot& slot, JSHTMLElement* element) { - RuntimeObject* runtimeObject = getRuntimeObject(exec, element->impl()); - if (!runtimeObject) + JSObject* scriptObject = pluginScriptObject(exec, element); + if (!scriptObject) return false; - if (!runtimeObject->hasProperty(exec, propertyName)) + + if (!scriptObject->hasProperty(exec, propertyName)) return false; slot.setCustom(element, runtimeObjectPropertyGetter); return true; @@ -80,10 +100,10 @@ bool runtimeObjectCustomGetOwnPropertySlot(ExecState* exec, const Identifier& pr bool runtimeObjectCustomGetOwnPropertyDescriptor(ExecState* exec, const Identifier& propertyName, PropertyDescriptor& descriptor, JSHTMLElement* element) { - RuntimeObject* runtimeObject = getRuntimeObject(exec, element->impl()); - if (!runtimeObject) + JSObject* scriptObject = pluginScriptObject(exec, element); + if (!scriptObject) return false; - if (!runtimeObject->hasProperty(exec, propertyName)) + if (!scriptObject->hasProperty(exec, propertyName)) return false; PropertySlot slot; slot.setCustom(element, runtimeObjectPropertyGetter); @@ -94,14 +114,14 @@ bool runtimeObjectCustomGetOwnPropertyDescriptor(ExecState* exec, const Identifi return true; } -bool runtimeObjectCustomPut(ExecState* exec, const Identifier& propertyName, JSValue value, HTMLElement* element, PutPropertySlot& slot) +bool runtimeObjectCustomPut(ExecState* exec, const Identifier& propertyName, JSValue value, JSHTMLElement* element, PutPropertySlot& slot) { - RuntimeObject* runtimeObject = getRuntimeObject(exec, element); - if (!runtimeObject) + JSObject* scriptObject = pluginScriptObject(exec, element); + if (!scriptObject) return 0; - if (!runtimeObject->hasProperty(exec, propertyName)) + if (!scriptObject->hasProperty(exec, propertyName)) return false; - runtimeObject->put(exec, propertyName, value, slot); + scriptObject->put(exec, propertyName, value, slot); return true; } @@ -114,9 +134,9 @@ static EncodedJSValue JSC_HOST_CALL callPlugin(ExecState* exec) return JSValue::encode(result); } -CallType runtimeObjectGetCallData(HTMLElement* element, CallData& callData) +CallType runtimeObjectGetCallData(JSHTMLElement* element, CallData& callData) { - Instance* instance = pluginInstance(element); + Instance* instance = pluginInstance(element->impl()); if (!instance || !instance->supportsInvokeDefaultMethod()) return CallTypeNone; callData.native.function = callPlugin; diff --git a/WebCore/bindings/js/JSPluginElementFunctions.h b/WebCore/bindings/js/JSPluginElementFunctions.h index 736ace9..15af59a 100644 --- a/WebCore/bindings/js/JSPluginElementFunctions.h +++ b/WebCore/bindings/js/JSPluginElementFunctions.h @@ -36,12 +36,13 @@ namespace WebCore { // Runtime object support code for JSHTMLAppletElement, JSHTMLEmbedElement and JSHTMLObjectElement. JSC::Bindings::Instance* pluginInstance(Node*); + JSC::JSObject* pluginScriptObject(JSC::ExecState* exec, JSHTMLElement* jsHTMLElement); JSC::JSValue runtimeObjectPropertyGetter(JSC::ExecState*, JSC::JSValue, const JSC::Identifier&); bool runtimeObjectCustomGetOwnPropertySlot(JSC::ExecState*, const JSC::Identifier&, JSC::PropertySlot&, JSHTMLElement*); bool runtimeObjectCustomGetOwnPropertyDescriptor(JSC::ExecState*, const JSC::Identifier&, JSC::PropertyDescriptor&, JSHTMLElement*); - bool runtimeObjectCustomPut(JSC::ExecState*, const JSC::Identifier&, JSC::JSValue, HTMLElement*, JSC::PutPropertySlot&); - JSC::CallType runtimeObjectGetCallData(HTMLElement*, JSC::CallData&); + bool runtimeObjectCustomPut(JSC::ExecState*, const JSC::Identifier&, JSC::JSValue, JSHTMLElement*, JSC::PutPropertySlot&); + JSC::CallType runtimeObjectGetCallData(JSHTMLElement*, JSC::CallData&); } // namespace WebCore diff --git a/WebCore/bindings/js/ScriptObject.cpp b/WebCore/bindings/js/ScriptObject.cpp index 16b9f01..de397f7 100644 --- a/WebCore/bindings/js/ScriptObject.cpp +++ b/WebCore/bindings/js/ScriptObject.cpp @@ -37,7 +37,6 @@ #if ENABLE(INSPECTOR) #include "JSInjectedScriptHost.h" -#include "JSInspectorBackend.h" #include "JSInspectorFrontendHost.h" #endif @@ -158,14 +157,6 @@ bool ScriptGlobalObject::set(ScriptState* scriptState, const char* name, const S } #if ENABLE(INSPECTOR) -bool ScriptGlobalObject::set(ScriptState* scriptState, const char* name, InspectorBackend* value) -{ - JSLock lock(SilenceAssertionsOnly); - JSDOMGlobalObject* globalObject = static_cast<JSDOMGlobalObject*>(scriptState->lexicalGlobalObject()); - globalObject->putDirect(Identifier(scriptState, name), toJS(scriptState, globalObject, value)); - return handleException(scriptState); -} - bool ScriptGlobalObject::set(ScriptState* scriptState, const char* name, InspectorFrontendHost* value) { JSLock lock(SilenceAssertionsOnly); diff --git a/WebCore/bindings/js/ScriptObject.h b/WebCore/bindings/js/ScriptObject.h index 0c993e1..9880976 100644 --- a/WebCore/bindings/js/ScriptObject.h +++ b/WebCore/bindings/js/ScriptObject.h @@ -39,7 +39,6 @@ namespace WebCore { class InjectedScriptHost; - class InspectorBackend; class InspectorFrontendHost; class ScriptObject : public ScriptValue { @@ -70,7 +69,6 @@ namespace WebCore { public: static bool set(ScriptState*, const char* name, const ScriptObject&); #if ENABLE(INSPECTOR) - static bool set(ScriptState*, const char* name, InspectorBackend*); static bool set(ScriptState*, const char* name, InspectorFrontendHost*); static bool set(ScriptState*, const char* name, InjectedScriptHost*); #endif diff --git a/WebCore/bindings/js/ScriptValue.cpp b/WebCore/bindings/js/ScriptValue.cpp index a52024d..abc31e2 100644 --- a/WebCore/bindings/js/ScriptValue.cpp +++ b/WebCore/bindings/js/ScriptValue.cpp @@ -29,6 +29,7 @@ #include "config.h" #include "ScriptValue.h" +#include "InspectorValues.h" #include "SerializedScriptValue.h" #include <JavaScriptCore/APICast.h> @@ -93,4 +94,62 @@ ScriptValue ScriptValue::deserialize(ScriptState* scriptState, SerializedScriptV return ScriptValue(value->deserialize(scriptState, scriptState->lexicalGlobalObject())); } +#if ENABLE(INSPECTOR) +static PassRefPtr<InspectorValue> jsToInspectorValue(ScriptState* scriptState, JSValue value) +{ + if (!value) { + ASSERT_NOT_REACHED(); + return 0; + } + if (value.isNull() || value.isUndefined()) + return InspectorValue::null(); + if (value.isBoolean()) + return InspectorBasicValue::create(value.getBoolean()); + if (value.isNumber()) + return InspectorBasicValue::create(value.uncheckedGetNumber()); + if (value.isString()) { + UString s = value.getString(scriptState); + return InspectorString::create(String(s.data(), s.size())); + } + if (value.isObject()) { + if (isJSArray(&scriptState->globalData(), value)) { + RefPtr<InspectorArray> inspectorArray = InspectorArray::create(); + JSArray* array = asArray(value); + unsigned length = array->length(); + for (unsigned i = 0; i < length; i++) { + JSValue element = array->getIndex(i); + RefPtr<InspectorValue> elementValue = jsToInspectorValue(scriptState, element); + if (!elementValue) { + ASSERT_NOT_REACHED(); + elementValue = InspectorValue::null(); + } + inspectorArray->push(elementValue); + } + return inspectorArray; + } + RefPtr<InspectorObject> inspectorObject = InspectorObject::create(); + JSObject* object = value.getObject(); + PropertyNameArray propertyNames(scriptState); + object->getOwnPropertyNames(scriptState, propertyNames); + for (size_t i = 0; i < propertyNames.size(); i++) { + const Identifier& name = propertyNames[i]; + JSValue propertyValue = object->get(scriptState, name); + RefPtr<InspectorValue> inspectorValue = jsToInspectorValue(scriptState, propertyValue); + if (!inspectorValue) { + ASSERT_NOT_REACHED(); + inspectorValue = InspectorValue::null(); + } + inspectorObject->set(String(name.data(), name.size()), inspectorValue); + } + return inspectorObject; + } + return 0; +} + +PassRefPtr<InspectorValue> ScriptValue::toInspectorValue(ScriptState* scriptState) const +{ + return jsToInspectorValue(scriptState, m_value.get()); +} +#endif // ENABLE(INSPECTOR) + } // namespace WebCore diff --git a/WebCore/bindings/js/ScriptValue.h b/WebCore/bindings/js/ScriptValue.h index f4f9c68..b170fcf 100644 --- a/WebCore/bindings/js/ScriptValue.h +++ b/WebCore/bindings/js/ScriptValue.h @@ -40,6 +40,7 @@ namespace WebCore { +class InspectorValue; class SerializedScriptValue; class ScriptValue { @@ -61,6 +62,10 @@ public: static ScriptValue undefined() { return ScriptValue(JSC::jsUndefined()); } +#if ENABLE(INSPECTOR) + PassRefPtr<InspectorValue> toInspectorValue(ScriptState*) const; +#endif + private: JSC::ProtectedJSValue m_value; }; diff --git a/WebCore/bindings/js/SerializedScriptValue.cpp b/WebCore/bindings/js/SerializedScriptValue.cpp index 90f8d7c..6d6fa21 100644 --- a/WebCore/bindings/js/SerializedScriptValue.cpp +++ b/WebCore/bindings/js/SerializedScriptValue.cpp @@ -736,18 +736,23 @@ struct DeserializingTreeWalker : public BaseWalker { return jsNumber(m_exec, value.asDouble()); case SerializedScriptValueData::DateType: return new (m_exec) DateInstance(m_exec, m_globalObject->dateStructure(), value.asDouble()); - case SerializedScriptValueData::FileType: + case SerializedScriptValueData::FileType: { if (!m_isDOMGlobalObject) return jsNull(); - return toJS(m_exec, static_cast<JSDOMGlobalObject*>(m_globalObject), File::create(value.asString().crossThreadString())); + ScriptExecutionContext* scriptExecutionContext = static_cast<JSDOMGlobalObject*>(m_exec->lexicalGlobalObject())->scriptExecutionContext(); + ASSERT(scriptExecutionContext); + return toJS(m_exec, static_cast<JSDOMGlobalObject*>(m_globalObject), File::create(scriptExecutionContext, value.asString().crossThreadString())); + } case SerializedScriptValueData::FileListType: { if (!m_isDOMGlobalObject) return jsNull(); RefPtr<FileList> result = FileList::create(); SerializedFileList* serializedFileList = value.asFileList(); unsigned length = serializedFileList->length(); + ScriptExecutionContext* scriptExecutionContext = static_cast<JSDOMGlobalObject*>(m_exec->lexicalGlobalObject())->scriptExecutionContext(); + ASSERT(scriptExecutionContext); for (unsigned i = 0; i < length; i++) - result->append(File::create(serializedFileList->item(i))); + result->append(File::create(scriptExecutionContext, serializedFileList->item(i))); return toJS(m_exec, static_cast<JSDOMGlobalObject*>(m_globalObject), result.get()); } case SerializedScriptValueData::ImageDataType: { diff --git a/WebCore/bindings/scripts/CodeGeneratorCPP.pm b/WebCore/bindings/scripts/CodeGeneratorCPP.pm index 9e254af..27cf854 100644 --- a/WebCore/bindings/scripts/CodeGeneratorCPP.pm +++ b/WebCore/bindings/scripts/CodeGeneratorCPP.pm @@ -281,7 +281,7 @@ sub AddIncludesForType my $type = $codeGenerator->StripModule(shift); return if $codeGenerator->IsNonPointerType($type); - return if $type =~ /cconstructor/; + return if $type =~ /Constructor/; if ($codeGenerator->IsStringType($type)) { $implIncludes{"AtomicString.h"} = 1; diff --git a/WebCore/bindings/scripts/CodeGeneratorJS.pm b/WebCore/bindings/scripts/CodeGeneratorJS.pm index d992d89..05f532c 100644 --- a/WebCore/bindings/scripts/CodeGeneratorJS.pm +++ b/WebCore/bindings/scripts/CodeGeneratorJS.pm @@ -1977,7 +1977,11 @@ sub GenerateImplementation # FIXME: this casts into int to match our previous behavior which turned 0xFFFFFFFF in -1 for NodeFilter.SHOW_ALL push(@implContent, "JSValue ${getter}(ExecState* exec, JSValue, const Identifier&)\n"); push(@implContent, "{\n"); - push(@implContent, " return jsNumber(exec, static_cast<int>(" . $constant->value . "));\n"); + if ($constant->type eq "DOMString") { + push(@implContent, " return jsStringOrNull(exec, String(" . $constant->value . "));\n"); + } else { + push(@implContent, " return jsNumber(exec, static_cast<int>(" . $constant->value . "));\n"); + } push(@implContent, "}\n\n"); } } diff --git a/WebCore/bindings/scripts/IDLStructure.pm b/WebCore/bindings/scripts/IDLStructure.pm index 2eda696..f9dd4ab 100644 --- a/WebCore/bindings/scripts/IDLStructure.pm +++ b/WebCore/bindings/scripts/IDLStructure.pm @@ -78,6 +78,10 @@ our $idlIdNs = '[a-zA-Z0-9:]'; # Generic identifier including namespace our $idlIdNsList = '[a-zA-Z0-9:,\ ]'; # List of Generic identifiers including namespace our $idlType = '[a-zA-Z0-9_]'; # Generic type/"value string" identifier +# Match a string value, a hexadecimal number, or an integral number. +# Note: some of the characters that are allowed in the string value may not be allowed by +# interfaceSelector. +our $constValue = '("[^"\r\n]*")|(0[xX][a-fA-F0-9]+)|(-?[0-9]*)'; our $idlDataType = '[a-zA-Z0-9\ ]'; # Generic data type identifier # Magic IDL parsing regular expressions @@ -89,7 +93,7 @@ our $extendedAttributeSyntax = '\[[^]]*\]'; # Used for extended attributes # Regular expression based IDL 'syntactical tokenizer' used in the IDLParser our $moduleSelector = 'module\s*(' . $idlId . '*)\s*{'; our $moduleNSSelector = 'module\s*(' . $idlId . '*)\s*\[ns\s*(' . $idlIdNs . '*)\s*(' . $idlIdNs . '*)\]\s*;'; -our $constantSelector = 'const\s*' . $supportedTypes . '\s*(' . $idlType . '*)\s*=\s*(' . $idlType . '*)'; +our $constantSelector = 'const\s*' . $supportedTypes . '\s*(' . $idlType . '*)\s*=\s*(' . $constValue . ')'; our $raisesSelector = 'raises\s*\((' . $idlIdNsList . '*)\s*\)'; our $getterRaisesSelector = '\bgetter\s+raises\s*\((' . $idlIdNsList . '*)\s*\)'; our $setterRaisesSelector = '\bsetter\s+raises\s*\((' . $idlIdNsList . '*)\s*\)'; @@ -99,7 +103,7 @@ our $typeNamespaceSelector = '((?:' . $idlId . '*::)*)\s*(' . $idlDataType . '*) our $exceptionSelector = 'exception\s*(' . $idlIdNs . '*)\s*([a-zA-Z\s{;]*};)'; our $exceptionSubSelector = '{\s*' . $supportedTypes . '\s*(' . $idlType . '*)\s*;\s*}'; -our $interfaceSelector = 'interface\s*((?:' . $extendedAttributeSyntax . ' )?)(' . $idlIdNs . '*)\s*(?::(\s*[^{]*))?{([a-zA-Z0-9_=\s(),;:\[\]&\|]*)'; +our $interfaceSelector = 'interface\s*((?:' . $extendedAttributeSyntax . ' )?)(' . $idlIdNs . '*)\s*(?::(\s*[^{]*))?{([-a-zA-Z0-9_"=\s(),;:\[\]&\|]*)'; our $interfaceMethodSelector = '\s*((?:' . $extendedAttributeSyntax . ' )?)' . $supportedTypes . '\s*(' . $idlIdNs . '*)\s*\(\s*([a-zA-Z0-9:\s,=\[\]]*)'; our $interfaceParameterSelector = '(in|out)\s*((?:' . $extendedAttributeSyntax . ' )?)' . $supportedTypes . '\s*(' . $idlIdNs . '*)'; diff --git a/WebCore/bindings/scripts/test/CPP/WebDOMTestObj.h b/WebCore/bindings/scripts/test/CPP/WebDOMTestObj.h index 86c7169..09c77db 100644 --- a/WebCore/bindings/scripts/test/CPP/WebDOMTestObj.h +++ b/WebCore/bindings/scripts/test/CPP/WebDOMTestObj.h @@ -47,7 +47,13 @@ public: WEBDOM_CONST_VALUE_1 = 1, WEBDOM_CONST_VALUE_2 = 2, WEBDOM_CONST_VALUE_4 = 4, - WEBDOM_CONST_VALUE_8 = 8 + WEBDOM_CONST_VALUE_8 = 8, + WEBDOM_CONST_VALUE_9 = -1, + WEBDOM_CONST_VALUE_10 = "my constant string", + WEBDOM_CONST_VALUE_11 = 0xffffffff, + WEBDOM_CONST_VALUE_12 = 0x01, + WEBDOM_CONST_VALUE_13 = 0X20, + WEBDOM_CONST_VALUE_14 = 0x1abc }; int readOnlyIntAttr() const; diff --git a/WebCore/bindings/scripts/test/JS/JSTestObj.cpp b/WebCore/bindings/scripts/test/JS/JSTestObj.cpp index 6e667f7..5aa54da 100644 --- a/WebCore/bindings/scripts/test/JS/JSTestObj.cpp +++ b/WebCore/bindings/scripts/test/JS/JSTestObj.cpp @@ -100,24 +100,36 @@ static JSC_CONST_HASHTABLE HashTable JSTestObjTable = { 68, 63, JSTestObjTableVa #define THUNK_GENERATOR(generator) #endif -static const HashTableValue JSTestObjConstructorTableValues[6] = +static const HashTableValue JSTestObjConstructorTableValues[12] = { { "CONST_VALUE_0", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjCONST_VALUE_0), (intptr_t)0 THUNK_GENERATOR(0) }, { "CONST_VALUE_1", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjCONST_VALUE_1), (intptr_t)0 THUNK_GENERATOR(0) }, { "CONST_VALUE_2", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjCONST_VALUE_2), (intptr_t)0 THUNK_GENERATOR(0) }, { "CONST_VALUE_4", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjCONST_VALUE_4), (intptr_t)0 THUNK_GENERATOR(0) }, { "CONST_VALUE_8", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjCONST_VALUE_8), (intptr_t)0 THUNK_GENERATOR(0) }, + { "CONST_VALUE_9", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjCONST_VALUE_9), (intptr_t)0 THUNK_GENERATOR(0) }, + { "CONST_VALUE_10", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjCONST_VALUE_10), (intptr_t)0 THUNK_GENERATOR(0) }, + { "CONST_VALUE_11", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjCONST_VALUE_11), (intptr_t)0 THUNK_GENERATOR(0) }, + { "CONST_VALUE_12", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjCONST_VALUE_12), (intptr_t)0 THUNK_GENERATOR(0) }, + { "CONST_VALUE_13", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjCONST_VALUE_13), (intptr_t)0 THUNK_GENERATOR(0) }, + { "CONST_VALUE_14", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjCONST_VALUE_14), (intptr_t)0 THUNK_GENERATOR(0) }, { 0, 0, 0, 0 THUNK_GENERATOR(0) } }; #undef THUNK_GENERATOR -static JSC_CONST_HASHTABLE HashTable JSTestObjConstructorTable = { 16, 15, JSTestObjConstructorTableValues, 0 }; +static JSC_CONST_HASHTABLE HashTable JSTestObjConstructorTable = { 33, 31, JSTestObjConstructorTableValues, 0 }; COMPILE_ASSERT(0 == TestObj::CONST_VALUE_0, TestObjEnumCONST_VALUE_0IsWrongUseDontCheckEnums); COMPILE_ASSERT(1 == TestObj::CONST_VALUE_1, TestObjEnumCONST_VALUE_1IsWrongUseDontCheckEnums); COMPILE_ASSERT(2 == TestObj::CONST_VALUE_2, TestObjEnumCONST_VALUE_2IsWrongUseDontCheckEnums); COMPILE_ASSERT(4 == TestObj::CONST_VALUE_4, TestObjEnumCONST_VALUE_4IsWrongUseDontCheckEnums); COMPILE_ASSERT(8 == TestObj::CONST_VALUE_8, TestObjEnumCONST_VALUE_8IsWrongUseDontCheckEnums); +COMPILE_ASSERT(-1 == TestObj::CONST_VALUE_9, TestObjEnumCONST_VALUE_9IsWrongUseDontCheckEnums); +COMPILE_ASSERT("my constant string" == TestObj::CONST_VALUE_10, TestObjEnumCONST_VALUE_10IsWrongUseDontCheckEnums); +COMPILE_ASSERT(0xffffffff == TestObj::CONST_VALUE_11, TestObjEnumCONST_VALUE_11IsWrongUseDontCheckEnums); +COMPILE_ASSERT(0x01 == TestObj::CONST_VALUE_12, TestObjEnumCONST_VALUE_12IsWrongUseDontCheckEnums); +COMPILE_ASSERT(0X20 == TestObj::CONST_VALUE_13, TestObjEnumCONST_VALUE_13IsWrongUseDontCheckEnums); +COMPILE_ASSERT(0x1abc == TestObj::CONST_VALUE_14, TestObjEnumCONST_VALUE_14IsWrongUseDontCheckEnums); class JSTestObjConstructor : public DOMConstructorObject { public: @@ -160,13 +172,19 @@ bool JSTestObjConstructor::getOwnPropertyDescriptor(ExecState* exec, const Ident #define THUNK_GENERATOR(generator) #endif -static const HashTableValue JSTestObjPrototypeTableValues[36] = +static const HashTableValue JSTestObjPrototypeTableValues[42] = { { "CONST_VALUE_0", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjCONST_VALUE_0), (intptr_t)0 THUNK_GENERATOR(0) }, { "CONST_VALUE_1", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjCONST_VALUE_1), (intptr_t)0 THUNK_GENERATOR(0) }, { "CONST_VALUE_2", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjCONST_VALUE_2), (intptr_t)0 THUNK_GENERATOR(0) }, { "CONST_VALUE_4", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjCONST_VALUE_4), (intptr_t)0 THUNK_GENERATOR(0) }, { "CONST_VALUE_8", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjCONST_VALUE_8), (intptr_t)0 THUNK_GENERATOR(0) }, + { "CONST_VALUE_9", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjCONST_VALUE_9), (intptr_t)0 THUNK_GENERATOR(0) }, + { "CONST_VALUE_10", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjCONST_VALUE_10), (intptr_t)0 THUNK_GENERATOR(0) }, + { "CONST_VALUE_11", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjCONST_VALUE_11), (intptr_t)0 THUNK_GENERATOR(0) }, + { "CONST_VALUE_12", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjCONST_VALUE_12), (intptr_t)0 THUNK_GENERATOR(0) }, + { "CONST_VALUE_13", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjCONST_VALUE_13), (intptr_t)0 THUNK_GENERATOR(0) }, + { "CONST_VALUE_14", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjCONST_VALUE_14), (intptr_t)0 THUNK_GENERATOR(0) }, { "voidMethod", DontDelete | Function, (intptr_t)static_cast<NativeFunction>(jsTestObjPrototypeFunctionVoidMethod), (intptr_t)0 THUNK_GENERATOR(0) }, { "voidMethodWithArgs", DontDelete | Function, (intptr_t)static_cast<NativeFunction>(jsTestObjPrototypeFunctionVoidMethodWithArgs), (intptr_t)3 THUNK_GENERATOR(0) }, { "intMethod", DontDelete | Function, (intptr_t)static_cast<NativeFunction>(jsTestObjPrototypeFunctionIntMethod), (intptr_t)0 THUNK_GENERATOR(0) }, @@ -201,7 +219,7 @@ static const HashTableValue JSTestObjPrototypeTableValues[36] = }; #undef THUNK_GENERATOR -static JSC_CONST_HASHTABLE HashTable JSTestObjPrototypeTable = { 132, 127, JSTestObjPrototypeTableValues, 0 }; +static JSC_CONST_HASHTABLE HashTable JSTestObjPrototypeTable = { 134, 127, JSTestObjPrototypeTableValues, 0 }; const ClassInfo JSTestObjPrototype::s_info = { "TestObjPrototype", 0, &JSTestObjPrototypeTable, 0 }; JSObject* JSTestObjPrototype::self(ExecState* exec, JSGlobalObject* globalObject) @@ -1272,6 +1290,36 @@ JSValue jsTestObjCONST_VALUE_8(ExecState* exec, JSValue, const Identifier&) return jsNumber(exec, static_cast<int>(8)); } +JSValue jsTestObjCONST_VALUE_9(ExecState* exec, JSValue, const Identifier&) +{ + return jsNumber(exec, static_cast<int>(-1)); +} + +JSValue jsTestObjCONST_VALUE_10(ExecState* exec, JSValue, const Identifier&) +{ + return jsStringOrNull(exec, String("my constant string")); +} + +JSValue jsTestObjCONST_VALUE_11(ExecState* exec, JSValue, const Identifier&) +{ + return jsNumber(exec, static_cast<int>(0xffffffff)); +} + +JSValue jsTestObjCONST_VALUE_12(ExecState* exec, JSValue, const Identifier&) +{ + return jsNumber(exec, static_cast<int>(0x01)); +} + +JSValue jsTestObjCONST_VALUE_13(ExecState* exec, JSValue, const Identifier&) +{ + return jsNumber(exec, static_cast<int>(0X20)); +} + +JSValue jsTestObjCONST_VALUE_14(ExecState* exec, JSValue, const Identifier&) +{ + return jsNumber(exec, static_cast<int>(0x1abc)); +} + JSC::JSValue toJS(JSC::ExecState* exec, JSDOMGlobalObject* globalObject, TestObj* object) { return getDOMObjectWrapper<JSTestObj>(exec, globalObject, object); diff --git a/WebCore/bindings/scripts/test/JS/JSTestObj.h b/WebCore/bindings/scripts/test/JS/JSTestObj.h index 84122b7..0648526 100644 --- a/WebCore/bindings/scripts/test/JS/JSTestObj.h +++ b/WebCore/bindings/scripts/test/JS/JSTestObj.h @@ -180,6 +180,12 @@ JSC::JSValue jsTestObjCONST_VALUE_1(JSC::ExecState*, JSC::JSValue, const JSC::Id JSC::JSValue jsTestObjCONST_VALUE_2(JSC::ExecState*, JSC::JSValue, const JSC::Identifier&); JSC::JSValue jsTestObjCONST_VALUE_4(JSC::ExecState*, JSC::JSValue, const JSC::Identifier&); JSC::JSValue jsTestObjCONST_VALUE_8(JSC::ExecState*, JSC::JSValue, const JSC::Identifier&); +JSC::JSValue jsTestObjCONST_VALUE_9(JSC::ExecState*, JSC::JSValue, const JSC::Identifier&); +JSC::JSValue jsTestObjCONST_VALUE_10(JSC::ExecState*, JSC::JSValue, const JSC::Identifier&); +JSC::JSValue jsTestObjCONST_VALUE_11(JSC::ExecState*, JSC::JSValue, const JSC::Identifier&); +JSC::JSValue jsTestObjCONST_VALUE_12(JSC::ExecState*, JSC::JSValue, const JSC::Identifier&); +JSC::JSValue jsTestObjCONST_VALUE_13(JSC::ExecState*, JSC::JSValue, const JSC::Identifier&); +JSC::JSValue jsTestObjCONST_VALUE_14(JSC::ExecState*, JSC::JSValue, const JSC::Identifier&); } // namespace WebCore diff --git a/WebCore/bindings/scripts/test/ObjC/DOMTestObj.h b/WebCore/bindings/scripts/test/ObjC/DOMTestObj.h index 33c3a2d..a96b499 100644 --- a/WebCore/bindings/scripts/test/ObjC/DOMTestObj.h +++ b/WebCore/bindings/scripts/test/ObjC/DOMTestObj.h @@ -39,7 +39,13 @@ enum { DOM_CONST_VALUE_1 = 1, DOM_CONST_VALUE_2 = 2, DOM_CONST_VALUE_4 = 4, - DOM_CONST_VALUE_8 = 8 + DOM_CONST_VALUE_8 = 8, + DOM_CONST_VALUE_9 = -1, + DOM_CONST_VALUE_10 = "my constant string", + DOM_CONST_VALUE_11 = 0xffffffff, + DOM_CONST_VALUE_12 = 0x01, + DOM_CONST_VALUE_13 = 0X20, + DOM_CONST_VALUE_14 = 0x1abc }; @interface DOMTestObj : DOMObject diff --git a/WebCore/bindings/scripts/test/TestObj.idl b/WebCore/bindings/scripts/test/TestObj.idl index f9d41d7..a5daa24 100644 --- a/WebCore/bindings/scripts/test/TestObj.idl +++ b/WebCore/bindings/scripts/test/TestObj.idl @@ -136,5 +136,11 @@ module test { const unsigned short CONST_VALUE_2 = 2; const unsigned short CONST_VALUE_4 = 4; const unsigned short CONST_VALUE_8 = 8; + const short CONST_VALUE_9 = -1; + const DOMString CONST_VALUE_10 = "my constant string"; + const unsigned short CONST_VALUE_11 = 0xffffffff; + const unsigned short CONST_VALUE_12 = 0x01; + const unsigned short CONST_VALUE_13 = 0X20; + const unsigned short CONST_VALUE_14 = 0x1abc; }; } diff --git a/WebCore/bindings/scripts/test/V8/V8TestObj.cpp b/WebCore/bindings/scripts/test/V8/V8TestObj.cpp index c348726..09d99f8 100644 --- a/WebCore/bindings/scripts/test/V8/V8TestObj.cpp +++ b/WebCore/bindings/scripts/test/V8/V8TestObj.cpp @@ -1021,6 +1021,12 @@ static const BatchedConstant TestObjConsts[] = { {"CONST_VALUE_2", static_cast<signed int>(2)}, {"CONST_VALUE_4", static_cast<signed int>(4)}, {"CONST_VALUE_8", static_cast<signed int>(8)}, + {"CONST_VALUE_9", static_cast<signed int>(-1)}, + {"CONST_VALUE_10", static_cast<signed int>("my constant string")}, + {"CONST_VALUE_11", static_cast<signed int>(0xffffffff)}, + {"CONST_VALUE_12", static_cast<signed int>(0x01)}, + {"CONST_VALUE_13", static_cast<signed int>(0X20)}, + {"CONST_VALUE_14", static_cast<signed int>(0x1abc)}, }; COMPILE_ASSERT(0 == TestObj::CONST_VALUE_0, TestObjEnumCONST_VALUE_0IsWrongUseDontCheckEnums); @@ -1028,6 +1034,12 @@ COMPILE_ASSERT(1 == TestObj::CONST_VALUE_1, TestObjEnumCONST_VALUE_1IsWrongUseDo COMPILE_ASSERT(2 == TestObj::CONST_VALUE_2, TestObjEnumCONST_VALUE_2IsWrongUseDontCheckEnums); COMPILE_ASSERT(4 == TestObj::CONST_VALUE_4, TestObjEnumCONST_VALUE_4IsWrongUseDontCheckEnums); COMPILE_ASSERT(8 == TestObj::CONST_VALUE_8, TestObjEnumCONST_VALUE_8IsWrongUseDontCheckEnums); +COMPILE_ASSERT(-1 == TestObj::CONST_VALUE_9, TestObjEnumCONST_VALUE_9IsWrongUseDontCheckEnums); +COMPILE_ASSERT("my constant string" == TestObj::CONST_VALUE_10, TestObjEnumCONST_VALUE_10IsWrongUseDontCheckEnums); +COMPILE_ASSERT(0xffffffff == TestObj::CONST_VALUE_11, TestObjEnumCONST_VALUE_11IsWrongUseDontCheckEnums); +COMPILE_ASSERT(0x01 == TestObj::CONST_VALUE_12, TestObjEnumCONST_VALUE_12IsWrongUseDontCheckEnums); +COMPILE_ASSERT(0X20 == TestObj::CONST_VALUE_13, TestObjEnumCONST_VALUE_13IsWrongUseDontCheckEnums); +COMPILE_ASSERT(0x1abc == TestObj::CONST_VALUE_14, TestObjEnumCONST_VALUE_14IsWrongUseDontCheckEnums); static v8::Persistent<v8::FunctionTemplate> ConfigureV8TestObjTemplate(v8::Persistent<v8::FunctionTemplate> desc) { diff --git a/WebCore/bindings/v8/ScriptObject.cpp b/WebCore/bindings/v8/ScriptObject.cpp index 520c57b..8f81537 100644 --- a/WebCore/bindings/v8/ScriptObject.cpp +++ b/WebCore/bindings/v8/ScriptObject.cpp @@ -38,7 +38,6 @@ #include "Frame.h" #include "V8Binding.h" #include "V8InjectedScriptHost.h" -#include "V8InspectorBackend.h" #include "V8InspectorFrontendHost.h" #include "V8Proxy.h" @@ -146,13 +145,6 @@ bool ScriptGlobalObject::set(ScriptState* scriptState, const char* name, const S } #if ENABLE(INSPECTOR) -bool ScriptGlobalObject::set(ScriptState* scriptState, const char* name, InspectorBackend* value) -{ - ScriptScope scope(scriptState); - scope.global()->Set(v8::String::New(name), toV8(value)); - return scope.success(); -} - bool ScriptGlobalObject::set(ScriptState* scriptState, const char* name, InspectorFrontendHost* value) { ScriptScope scope(scriptState); diff --git a/WebCore/bindings/v8/ScriptObject.h b/WebCore/bindings/v8/ScriptObject.h index a60f2a8..bee079c 100644 --- a/WebCore/bindings/v8/ScriptObject.h +++ b/WebCore/bindings/v8/ScriptObject.h @@ -37,7 +37,6 @@ namespace WebCore { class InjectedScriptHost; - class InspectorBackend; class InspectorFrontendHost; class ScriptState; @@ -69,7 +68,6 @@ namespace WebCore { class ScriptGlobalObject { public: static bool set(ScriptState*, const char* name, const ScriptObject&); - static bool set(ScriptState*, const char* name, InspectorBackend*); static bool set(ScriptState*, const char* name, InspectorFrontendHost*); static bool set(ScriptState*, const char* name, InjectedScriptHost*); static bool get(ScriptState*, const char* name, ScriptObject&); diff --git a/WebCore/bindings/v8/ScriptProfile.cpp b/WebCore/bindings/v8/ScriptProfile.cpp index beafea1..3b71d5f 100644 --- a/WebCore/bindings/v8/ScriptProfile.cpp +++ b/WebCore/bindings/v8/ScriptProfile.cpp @@ -40,6 +40,7 @@ namespace WebCore { String ScriptProfile::title() const { + v8::HandleScope scope; return toWebCoreString(m_profile->GetTitle()); } diff --git a/WebCore/bindings/v8/ScriptValue.cpp b/WebCore/bindings/v8/ScriptValue.cpp index 3aca3c1..4ae532d 100755 --- a/WebCore/bindings/v8/ScriptValue.cpp +++ b/WebCore/bindings/v8/ScriptValue.cpp @@ -31,6 +31,7 @@ #include "config.h" #include "ScriptValue.h" +#include "InspectorValues.h" #include "ScriptScope.h" #include "SerializedScriptValue.h" #include "V8Binding.h" @@ -66,4 +67,60 @@ String ScriptValue::toString(ScriptState*) const return toWebCoreString(m_value); } +static PassRefPtr<InspectorValue> v8ToInspectorValue(v8::Handle<v8::Value> value) +{ + if (value.IsEmpty()) { + ASSERT_NOT_REACHED(); + return 0; + } + if (value->IsNull() || value->IsUndefined()) + return InspectorValue::null(); + if (value->IsBoolean()) + return InspectorBasicValue::create(value->BooleanValue()); + if (value->IsNumber()) + return InspectorBasicValue::create(value->NumberValue()); + if (value->IsString()) + return InspectorString::create(toWebCoreString(value)); + if (value->IsArray()) { + v8::Handle<v8::Array> array = v8::Handle<v8::Array>::Cast(value); + RefPtr<InspectorArray> inspectorArray = InspectorArray::create(); + uint32_t length = array->Length(); + for (uint32_t i = 0; i < length; i++) { + v8::Local<v8::Value> value = array->Get(v8::Int32::New(i)); + RefPtr<InspectorValue> element = v8ToInspectorValue(value); + if (!element) { + ASSERT_NOT_REACHED(); + element = InspectorValue::null(); + } + inspectorArray->push(element); + } + return inspectorArray; + } + if (value->IsObject()) { + RefPtr<InspectorObject> inspectorObject = InspectorObject::create(); + v8::Handle<v8::Object> object = v8::Handle<v8::Object>::Cast(value); + v8::Local<v8::Array> propertyNames = object->GetPropertyNames(); + uint32_t length = propertyNames->Length(); + for (uint32_t i = 0; i < length; i++) { + v8::Local<v8::Value> name = propertyNames->Get(v8::Int32::New(i)); + RefPtr<InspectorValue> propertyValue = v8ToInspectorValue(object->Get(name)); + if (!propertyValue) { + ASSERT_NOT_REACHED(); + continue; + } + inspectorObject->set(toWebCoreStringWithNullCheck(name), propertyValue); + } + return inspectorObject; + } + return 0; +} + +PassRefPtr<InspectorValue> ScriptValue::toInspectorValue(ScriptState* scriptState) const +{ + v8::HandleScope handleScope; + // v8::Object::GetPropertyNames() expects current context to be not null. + v8::Context::Scope contextScope(scriptState->context()); + return v8ToInspectorValue(m_value); +} + } // namespace WebCore diff --git a/WebCore/bindings/v8/ScriptValue.h b/WebCore/bindings/v8/ScriptValue.h index 8241205..1743da0 100644 --- a/WebCore/bindings/v8/ScriptValue.h +++ b/WebCore/bindings/v8/ScriptValue.h @@ -43,6 +43,7 @@ namespace WebCore { +class InspectorValue; class SerializedScriptValue; class ScriptValue { @@ -151,6 +152,8 @@ public: bool getString(String& result) const; String toString(ScriptState*) const; + PassRefPtr<InspectorValue> toInspectorValue(ScriptState*) const; + private: mutable v8::Persistent<v8::Value> m_value; }; diff --git a/WebCore/bindings/v8/SerializedScriptValue.cpp b/WebCore/bindings/v8/SerializedScriptValue.cpp index 47c4c2e..9dc4d0f 100644 --- a/WebCore/bindings/v8/SerializedScriptValue.cpp +++ b/WebCore/bindings/v8/SerializedScriptValue.cpp @@ -45,6 +45,7 @@ #include "V8FileList.h" #include "V8ImageData.h" #include "V8Proxy.h" +#include "V8Utilities.h" #include <wtf/Assertions.h> #include <wtf/RefCounted.h> @@ -854,7 +855,7 @@ private: String path; if (!readWebCoreString(&path)) return false; - PassRefPtr<Blob> blob = Blob::create(path); + PassRefPtr<Blob> blob = Blob::create(getScriptExecutionContext(), path); *value = toV8(blob); return true; } @@ -864,7 +865,7 @@ private: String path; if (!readWebCoreString(&path)) return false; - PassRefPtr<File> file = File::create(path); + PassRefPtr<File> file = File::create(getScriptExecutionContext(), path); *value = toV8(file); return true; } @@ -879,7 +880,7 @@ private: String path; if (!readWebCoreString(&path)) return false; - fileList->append(File::create(path)); + fileList->append(File::create(getScriptExecutionContext(), path)); } *value = toV8(fileList); return true; diff --git a/WebCore/bindings/v8/custom/V8DOMWindowCustom.cpp b/WebCore/bindings/v8/custom/V8DOMWindowCustom.cpp index 210e974..d1e0701 100644 --- a/WebCore/bindings/v8/custom/V8DOMWindowCustom.cpp +++ b/WebCore/bindings/v8/custom/V8DOMWindowCustom.cpp @@ -790,6 +790,7 @@ v8::Handle<v8::Value> V8DOMWindow::setIntervalCallback(const v8::Arguments& args return WindowSetTimeoutImpl(args, false); } +#if ENABLE(DATABASE) v8::Handle<v8::Value> V8DOMWindow::openDatabaseCallback(const v8::Arguments& args) { INC_STATS("DOM.DOMWindow.openDatabase"); @@ -819,6 +820,7 @@ v8::Handle<v8::Value> V8DOMWindow::openDatabaseCallback(const v8::Arguments& arg V8Proxy::setDOMException(ec); return result; } +#endif // ENABLE(DATABASE) bool V8DOMWindow::namedSecurityCheck(v8::Local<v8::Object> host, v8::Local<v8::Value> key, v8::AccessType type, v8::Local<v8::Value>) { diff --git a/WebCore/bindings/v8/custom/V8DatabaseCustom.cpp b/WebCore/bindings/v8/custom/V8DatabaseCustom.cpp index 44a6eeb..31406fb 100644 --- a/WebCore/bindings/v8/custom/V8DatabaseCustom.cpp +++ b/WebCore/bindings/v8/custom/V8DatabaseCustom.cpp @@ -61,7 +61,7 @@ v8::Handle<v8::Value> V8Database::changeVersionCallback(const v8::Arguments& arg return v8::Undefined(); RefPtr<V8SQLTransactionCallback> callback; - if (args.Length() > 2) { + if (args.Length() > 2 && !isUndefinedOrNull(args[2])) { if (!args[2]->IsObject()) return throwError(TYPE_MISMATCH_ERR); @@ -69,7 +69,7 @@ v8::Handle<v8::Value> V8Database::changeVersionCallback(const v8::Arguments& arg } RefPtr<V8SQLTransactionErrorCallback> errorCallback; - if (args.Length() > 3) { + if (args.Length() > 3 && !isUndefinedOrNull(args[3])) { if (!args[3]->IsObject()) return throwError(TYPE_MISMATCH_ERR); @@ -77,7 +77,7 @@ v8::Handle<v8::Value> V8Database::changeVersionCallback(const v8::Arguments& arg } RefPtr<V8CustomVoidCallback> successCallback; - if (args.Length() > 4) { + if (args.Length() > 4 && !isUndefinedOrNull(args[4])) { if (!args[4]->IsObject()) return throwError(TYPE_MISMATCH_ERR); diff --git a/WebCore/bindings/v8/custom/V8DatabaseSyncCustom.cpp b/WebCore/bindings/v8/custom/V8DatabaseSyncCustom.cpp index 8a317d7..079f6e9 100644 --- a/WebCore/bindings/v8/custom/V8DatabaseSyncCustom.cpp +++ b/WebCore/bindings/v8/custom/V8DatabaseSyncCustom.cpp @@ -55,7 +55,7 @@ v8::Handle<v8::Value> V8DatabaseSync::changeVersionCallback(const v8::Arguments& DatabaseSync* database = V8DatabaseSync::toNative(args.Holder()); RefPtr<V8SQLTransactionSyncCallback> callback; - if (args.Length() > 2) { + if (args.Length() > 2 && !isUndefinedOrNull(args[2])) { if (!args[2]->IsObject()) return throwError(TYPE_MISMATCH_ERR); diff --git a/WebCore/bindings/v8/custom/V8InspectorFrontendHostCustom.cpp b/WebCore/bindings/v8/custom/V8InspectorFrontendHostCustom.cpp index 7f4ccf7..7733a70 100644 --- a/WebCore/bindings/v8/custom/V8InspectorFrontendHostCustom.cpp +++ b/WebCore/bindings/v8/custom/V8InspectorFrontendHostCustom.cpp @@ -80,7 +80,7 @@ v8::Handle<v8::Value> V8InspectorFrontendHost::showContextMenuCallback(const v8: v8::Local<v8::Value> id = item->Get(v8::String::New("id")); if (label->IsUndefined() || id->IsUndefined()) { items.append(new ContextMenuItem(SeparatorType, - ContextMenuItemTagNoAction, + ContextMenuItemCustomTagNoAction, String())); } else { ContextMenuAction typedId = static_cast<ContextMenuAction>( diff --git a/WebCore/bridge/jsc/BridgeJSC.cpp b/WebCore/bridge/jsc/BridgeJSC.cpp index d44cdb5..9b3af25 100644 --- a/WebCore/bridge/jsc/BridgeJSC.cpp +++ b/WebCore/bridge/jsc/BridgeJSC.cpp @@ -83,7 +83,7 @@ void Instance::end() virtualEnd(); } -RuntimeObject* Instance::createRuntimeObject(ExecState* exec) +JSObject* Instance::createRuntimeObject(ExecState* exec) { ASSERT(m_rootObject); ASSERT(m_rootObject->isValid()); diff --git a/WebCore/bridge/jsc/BridgeJSC.h b/WebCore/bridge/jsc/BridgeJSC.h index ee7deb6..44ce4d1 100644 --- a/WebCore/bridge/jsc/BridgeJSC.h +++ b/WebCore/bridge/jsc/BridgeJSC.h @@ -84,7 +84,7 @@ public: void end(); virtual Class* getClass() const = 0; - RuntimeObject* createRuntimeObject(ExecState*); + JSObject* createRuntimeObject(ExecState*); void willInvalidateRuntimeObject(); void willDestroyRuntimeObject(); diff --git a/WebCore/bridge/qt/qt_runtime.cpp b/WebCore/bridge/qt/qt_runtime.cpp index cfab3a2..b9cf4b0 100644 --- a/WebCore/bridge/qt/qt_runtime.cpp +++ b/WebCore/bridge/qt/qt_runtime.cpp @@ -338,8 +338,7 @@ QVariant convertValueToQVariant(ExecState* exec, JSValue value, QMetaType::Type if (type == Object || type == Array || type == RTArray) { // Enumerate the contents of the object PropertyNameArray properties(exec); - if (properties.size() > 0) - object->getPropertyNames(exec, properties); + object->getPropertyNames(exec, properties); PropertyNameArray::const_iterator it = properties.begin(); QVariantMap result; diff --git a/WebCore/css/CSSParser.cpp b/WebCore/css/CSSParser.cpp index 6bf7751..645e354 100644 --- a/WebCore/css/CSSParser.cpp +++ b/WebCore/css/CSSParser.cpp @@ -5677,27 +5677,31 @@ static int cssPropertyID(const UChar* propertyName, unsigned length) const char* name = buffer; if (buffer[0] == '-') { - if (!strcmp(buffer, "-apple-dashboard-region") || !strcmp(buffer, "-apple-line-clamp")) { - // Support two Apple-specific CSS properties previously used for - // the Dashboard and Safari RSS line clamping. + // If the prefix is -apple- or -khtml-, change it to -webkit-. + // This makes the string one character longer. + if (hasPrefix(buffer, length, "-apple-") || hasPrefix(buffer, length, "-khtml-")) { memmove(buffer + 7, buffer + 6, length + 1 - 6); memcpy(buffer, "-webkit", 7); ++length; - } else if (!strcmp(buffer, "-webkit-opacity")) { - // Honor -webkit-opacity as a synonym for opacity. This was the only - // syntax that worked in Safari 1.1, and may be in use on some websites and widgets. - const char* const opacity = "opacity"; - name = opacity; - length = 7; - } else if (hasPrefix(buffer, length, "-webkit-border-")) { - // -webkit-border-*-*-radius worked in Safari 4 and earlier. -webkit-border-radius syntax - // differs from border-radius, so it remains as a distinct property. - if (!strcmp(buffer + 15, "top-left-radius") - || !strcmp(buffer + 15, "top-right-radius") - || !strcmp(buffer + 15, "bottom-right-radius") - || !strcmp(buffer + 15, "bottom-left-radius")) { - name = buffer + 8; - length -= 8; + } + + if (hasPrefix(buffer, length, "-webkit")) { + if (strcmp(buffer, "-webkit-opacity") == 0) { + // Honor -webkit-opacity as a synonym for opacity. + // This was the only syntax that worked in Safari 1.1, and may be in use on some websites and widgets. + const char* const opacity = "opacity"; + name = opacity; + length = strlen(opacity); + } else if (hasPrefix(buffer + 7, length - 7, "-border-")) { + // -webkit-border-*-*-radius worked in Safari 4 and earlier. -webkit-border-radius syntax + // differs from border-radius, so it is remains as a distinct property. + if (!strcmp(buffer + 15, "top-left-radius") + || !strcmp(buffer + 15, "top-right-radius") + || !strcmp(buffer + 15, "bottom-right-radius") + || !strcmp(buffer + 15, "bottom-left-radius")) { + name = buffer + 8; + length -= 8; + } } } } diff --git a/WebCore/css/CSSPrimitiveValueMappings.h b/WebCore/css/CSSPrimitiveValueMappings.h index 9533f68..b1d2d3d 100644 --- a/WebCore/css/CSSPrimitiveValueMappings.h +++ b/WebCore/css/CSSPrimitiveValueMappings.h @@ -36,6 +36,7 @@ #include "FontSmoothingMode.h" #include "GraphicsTypes.h" #include "Path.h" +#include "RenderStyleConstants.h" #include "SVGRenderStyleDefs.h" #include "TextDirection.h" #include "TextRenderingMode.h" diff --git a/WebCore/css/CSSSelector.cpp b/WebCore/css/CSSSelector.cpp index b1de4ec..facce83 100644 --- a/WebCore/css/CSSSelector.cpp +++ b/WebCore/css/CSSSelector.cpp @@ -37,12 +37,11 @@ namespace WebCore { using namespace HTMLNames; -// A helper class to hold CSSSelectors. class CSSSelectorBag : public Noncopyable { public: ~CSSSelectorBag() { - deleteAllValues(m_stack); + ASSERT(isEmpty()); } bool isEmpty() const @@ -50,7 +49,7 @@ public: return m_stack.isEmpty(); } - void append(PassOwnPtr<CSSSelector> selector) + void add(PassOwnPtr<CSSSelector> selector) { if (selector) m_stack.append(selector.leakPtr()); @@ -68,46 +67,6 @@ private: Vector<CSSSelector*, 16> m_stack; }; -CSSSelector::~CSSSelector() -{ - // We should avoid a recursive destructor call, which causes stack overflow - // if CSS Selectors are deeply nested. - - // Early exit if we have already processed the children of this selector. - if (m_hasRareData) { - if (!m_data.m_rareData) - return; - } else if (!m_data.m_tagHistory) - return; - - CSSSelectorBag selectorsToBeDeleted; - if (m_hasRareData) { - selectorsToBeDeleted.append(m_data.m_rareData->m_tagHistory.release()); - selectorsToBeDeleted.append(m_data.m_rareData->m_simpleSelector.release()); - delete m_data.m_rareData; - } else - selectorsToBeDeleted.append(adoptPtr(m_data.m_tagHistory)); - - // Traverse the tree of CSSSelector and delete each CSSSelector iteratively. - while (!selectorsToBeDeleted.isEmpty()) { - OwnPtr<CSSSelector> selector(selectorsToBeDeleted.takeAny()); - ASSERT(selector); - if (selector->m_hasRareData) { - ASSERT(selector->m_data.m_rareData); - selectorsToBeDeleted.append(selector->m_data.m_rareData->m_tagHistory.release()); - selectorsToBeDeleted.append(selector->m_data.m_rareData->m_simpleSelector.release()); - delete selector->m_data.m_rareData; - // Clear the pointer so that a destructor of the selector, which is - // about to be called, can know the children are already processed. - selector->m_data.m_rareData = 0; - } else { - selectorsToBeDeleted.append(adoptPtr(selector->m_data.m_tagHistory)); - // Clear the pointer for the same reason. - selector->m_data.m_tagHistory = 0; - } - } -} - unsigned int CSSSelector::specificity() { if (m_isForPage) @@ -980,4 +939,33 @@ bool CSSSelector::RareData::matchNth(int count) } } +inline void CSSSelector::releaseOwnedSelectorsToBag(CSSSelectorBag& bag) +{ + if (m_hasRareData) { + ASSERT(m_data.m_rareData); + bag.add(m_data.m_rareData->m_tagHistory.release()); + bag.add(m_data.m_rareData->m_simpleSelector.release()); + delete m_data.m_rareData; + // Clear the pointer so that a destructor of this selector will not + // traverse this chain. + m_data.m_rareData = 0; + } else { + bag.add(adoptPtr(m_data.m_tagHistory)); + // Clear the pointer for the same reason. + m_data.m_tagHistory = 0; + } +} + +void CSSSelector::deleteReachableSelectors() +{ + // Traverse the chain of selectors and delete each iteratively. + CSSSelectorBag selectorsToBeDeleted; + releaseOwnedSelectorsToBag(selectorsToBeDeleted); + while (!selectorsToBeDeleted.isEmpty()) { + OwnPtr<CSSSelector> selector(selectorsToBeDeleted.takeAny()); + ASSERT(selector); + selector->releaseOwnedSelectorsToBag(selectorsToBeDeleted); + } +} + } // namespace WebCore diff --git a/WebCore/css/CSSSelector.h b/WebCore/css/CSSSelector.h index 518ff2c..34e4af0 100644 --- a/WebCore/css/CSSSelector.h +++ b/WebCore/css/CSSSelector.h @@ -30,6 +30,8 @@ namespace WebCore { + class CSSSelectorBag; + // this class represents a selector for a StyleRule class CSSSelector : public Noncopyable { public: @@ -57,7 +59,21 @@ namespace WebCore { { } - ~CSSSelector(); + ~CSSSelector() + { + // Exit if this selector does not own any objects to be deleted. + if (m_hasRareData) { + if (!m_data.m_rareData) + return; + } else if (!m_data.m_tagHistory) + return; + + // We can not delete the owned object(s) by simply calling delete + // directly on them. That would lead to recursive destructor calls + // which might cause stack overflow. We have to delete them + // iteratively. + deleteReachableSelectors(); + } /** * Re-create selector text from selector's data @@ -275,6 +291,9 @@ namespace WebCore { bool m_hasRareData : 1; bool m_isForPage : 1; + void releaseOwnedSelectorsToBag(CSSSelectorBag&); + void deleteReachableSelectors(); + unsigned specificityForPage(); void extractPseudoType() const; diff --git a/WebCore/css/CSSStyleSelector.cpp b/WebCore/css/CSSStyleSelector.cpp index 516e0e2..89d4f3e 100644 --- a/WebCore/css/CSSStyleSelector.cpp +++ b/WebCore/css/CSSStyleSelector.cpp @@ -4304,6 +4304,7 @@ void CSSStyleSelector::applyProperty(int id, CSSValue *value) FontDescription fontDescription = m_style->fontDescription(); fontDescription.setGenericFamily(parentFontDescription.genericFamily()); fontDescription.setFamily(parentFontDescription.firstFamily()); + fontDescription.setIsSpecifiedFont(parentFontDescription.isSpecifiedFont()); if (m_style->setFontDescription(fontDescription)) m_fontDirty = true; return; @@ -4377,6 +4378,7 @@ void CSSStyleSelector::applyProperty(int id, CSSValue *value) firstFamily.setFamily(face); firstFamily.appendFamily(0); // Remove any inherited family-fallback list. currFamily = &firstFamily; + fontDescription.setIsSpecifiedFont(fontDescription.genericFamily() == FontDescription::NoFamily); } else { RefPtr<SharedFontFamily> newFamily = SharedFontFamily::create(); newFamily->setFamily(face); @@ -4621,7 +4623,7 @@ void CSSStyleSelector::applyProperty(int id, CSSValue *value) FontDescription fontDescription; RenderTheme::defaultTheme()->systemFont(primitiveValue->getIdent(), fontDescription); - + // Double-check and see if the theme did anything. If not, don't bother updating the font. if (fontDescription.isAbsoluteSize()) { // Make sure the rendering mode and printer font settings are updated. diff --git a/WebCore/dom/Clipboard.h b/WebCore/dom/Clipboard.h index 4018e4f..0562280 100644 --- a/WebCore/dom/Clipboard.h +++ b/WebCore/dom/Clipboard.h @@ -33,11 +33,15 @@ namespace WebCore { + class DragData; class FileList; + class Frame; // State available during IE's events for drag and drop and copy/paste class Clipboard : public RefCounted<Clipboard> { public: + static PassRefPtr<Clipboard> create(ClipboardAccessPolicy, DragData*, Frame*); + virtual ~Clipboard() { } // Is this operation a drag-drop or a copy-paste? diff --git a/WebCore/dom/ContainerNode.cpp b/WebCore/dom/ContainerNode.cpp index 23b68ba..e559ba7 100644 --- a/WebCore/dom/ContainerNode.cpp +++ b/WebCore/dom/ContainerNode.cpp @@ -694,12 +694,13 @@ void ContainerNode::childrenChanged(bool changedByParser, Node* beforeChange, No void ContainerNode::cloneChildNodes(ContainerNode *clone) { // disable the delete button so it's elements are not serialized into the markup - if (document()->frame()) + bool isEditorEnabled = document()->frame() && document()->frame()->editor()->canEdit(); + if (isEditorEnabled) document()->frame()->editor()->deleteButtonController()->disable(); ExceptionCode ec = 0; for (Node* n = firstChild(); n && !ec; n = n->nextSibling()) clone->appendChild(n->cloneNode(true), ec); - if (document()->frame()) + if (isEditorEnabled && document()->frame()) document()->frame()->editor()->deleteButtonController()->enable(); } diff --git a/WebCore/dom/DeviceOrientationController.cpp b/WebCore/dom/DeviceOrientationController.cpp index f6867ec..a6a33f5 100644 --- a/WebCore/dom/DeviceOrientationController.cpp +++ b/WebCore/dom/DeviceOrientationController.cpp @@ -37,21 +37,38 @@ namespace WebCore { DeviceOrientationController::DeviceOrientationController(Page* page, DeviceOrientationClient* client) : m_page(page) , m_client(client) + , m_timer(this, &DeviceOrientationController::timerFired) { } +void DeviceOrientationController::timerFired(Timer<DeviceOrientationController>* timer) +{ + ASSERT_UNUSED(timer, timer == &m_timer); + ASSERT(!m_client || m_client->lastOrientation()); + + RefPtr<DeviceOrientation> orientation = m_client ? m_client->lastOrientation() : DeviceOrientation::create(); + RefPtr<DeviceOrientationEvent> event = DeviceOrientationEvent::create(eventNames().deviceorientationEvent, orientation.get()); + + Vector<DOMWindow*> listenersVector; + copyToVector(m_newListeners, listenersVector); + m_newListeners.clear(); + for (size_t i = 0; i < listenersVector.size(); ++i) + listenersVector[i]->dispatchEvent(event); +} + void DeviceOrientationController::addListener(DOMWindow* window) { - // If no client is present, signal that no orientation data is available. - // If the client already has an orientation, call back to this new listener - // immediately. - if (!m_client) { - RefPtr<DeviceOrientation> emptyOrientation = DeviceOrientation::create(); - window->dispatchEvent(DeviceOrientationEvent::create(eventNames().deviceorientationEvent, emptyOrientation.get())); - } else if (m_client && m_client->lastOrientation()) - window->dispatchEvent(DeviceOrientationEvent::create(eventNames().deviceorientationEvent, m_client->lastOrientation())); - - // The client may call back synchronously. + // If no client is present, we should fire an event with all parameters null. If + // the client already has an orientation, we should fire an event with that + // orientation. In both cases, the event is fired asynchronously, but without + // waiting for the client to get a new orientation. + if (!m_client || m_client->lastOrientation()) { + m_newListeners.add(window); + if (!m_timer.isActive()) + m_timer.startOneShot(0); + } + + // The client must not call back synchronously. bool wasEmpty = m_listeners.isEmpty(); m_listeners.add(window); if (wasEmpty && m_client) @@ -61,6 +78,7 @@ void DeviceOrientationController::addListener(DOMWindow* window) void DeviceOrientationController::removeListener(DOMWindow* window) { m_listeners.remove(window); + m_newListeners.remove(window); if (m_listeners.isEmpty() && m_client) m_client->stopUpdating(); } @@ -72,6 +90,7 @@ void DeviceOrientationController::removeAllListeners(DOMWindow* window) return; m_listeners.removeAll(window); + m_newListeners.remove(window); if (m_listeners.isEmpty() && m_client) m_client->stopUpdating(); } diff --git a/WebCore/dom/DeviceOrientationController.h b/WebCore/dom/DeviceOrientationController.h index 376e14c..9517791 100644 --- a/WebCore/dom/DeviceOrientationController.h +++ b/WebCore/dom/DeviceOrientationController.h @@ -27,6 +27,8 @@ #define DeviceOrientationController_h #include "DOMWindow.h" +#include "Timer.h" + #include <wtf/HashCountedSet.h> namespace WebCore { @@ -46,10 +48,15 @@ public: void didChangeDeviceOrientation(DeviceOrientation*); private: + void timerFired(Timer<DeviceOrientationController>*); + Page* m_page; DeviceOrientationClient* m_client; - typedef HashCountedSet<DOMWindow*> ListenersSet; - ListenersSet m_listeners; + typedef HashCountedSet<DOMWindow*> ListenersCountedSet; + ListenersCountedSet m_listeners; + typedef HashSet<DOMWindow*> ListenersSet; + ListenersSet m_newListeners; + Timer<DeviceOrientationController> m_timer; }; } // namespace WebCore diff --git a/WebCore/dom/Document.cpp b/WebCore/dom/Document.cpp index 6f91738..f1571cd 100644 --- a/WebCore/dom/Document.cpp +++ b/WebCore/dom/Document.cpp @@ -381,6 +381,7 @@ Document::Document(Frame* frame, const KURL& url, bool isXHTML, bool isHTML) , m_frameElementsShouldIgnoreScrolling(false) , m_containsValidityStyleRules(false) , m_updateFocusAppearanceRestoresSelection(false) + , m_writeDisabled(false) , m_title("") , m_rawTitle("") , m_titleSetExplicitly(false) @@ -2062,7 +2063,13 @@ void Document::write(const SegmentedString& text, Document* ownerDocument) printf("Beginning a document.write at %d\n", elapsedTime()); #endif - if (!m_parser) + // If the insertion point is undefined and the Document has the + // "write-neutralised" flag set, then abort these steps. + bool hasInsertionPoint = m_parser && m_parser->hasInsertionPoint(); + if (!hasInsertionPoint && writeDisabled()) + return; + + if (!hasInsertionPoint) open(ownerDocument); ASSERT(m_parser); diff --git a/WebCore/dom/Document.h b/WebCore/dom/Document.h index 63a8d12..5bc3fa3 100644 --- a/WebCore/dom/Document.h +++ b/WebCore/dom/Document.h @@ -1010,6 +1010,9 @@ public: const QualifiedName& idAttributeName() const { return m_idAttributeName; } + bool writeDisabled() const { return m_writeDisabled; } + void setWriteDisabled(bool flag) { m_writeDisabled = flag; } + protected: Document(Frame*, const KURL&, bool isXHTML, bool isHTML); @@ -1164,6 +1167,9 @@ private: bool m_containsValidityStyleRules; bool m_updateFocusAppearanceRestoresSelection; + // http://www.whatwg.org/specs/web-apps/current-work/#write-neutralised + bool m_writeDisabled; + String m_title; String m_rawTitle; bool m_titleSetExplicitly; diff --git a/WebCore/dom/DocumentParser.h b/WebCore/dom/DocumentParser.h index 7e47a87..a3545b6 100644 --- a/WebCore/dom/DocumentParser.h +++ b/WebCore/dom/DocumentParser.h @@ -40,6 +40,9 @@ public: virtual ScriptableDocumentParser* asScriptableDocumentParser() { return 0; } + // http://www.whatwg.org/specs/web-apps/current-work/#insertion-point + virtual bool hasInsertionPoint() { return true; } + // insert is used by document.write virtual void insert(const SegmentedString&) = 0; diff --git a/WebCore/dom/InputElement.cpp b/WebCore/dom/InputElement.cpp index 079dd56..2a53b77 100644 --- a/WebCore/dom/InputElement.cpp +++ b/WebCore/dom/InputElement.cpp @@ -145,20 +145,7 @@ void InputElement::setValueFromRenderer(InputElementData& data, InputElement* in notifyFormStateChanged(element); } -String InputElement::sanitizeValue(const InputElement* inputElement, const String& proposedValue) -{ -#if ENABLE(WCSS) - InputElementData data = const_cast<InputElement*>(inputElement)->data(); - if (!isConformToInputMask(data, proposedValue)) { - if (isConformToInputMask(data, data.value())) - return data.value(); - return String(); - } -#endif - return InputElement::sanitizeUserInputValue(inputElement, proposedValue, s_maximumLength); -} - -String InputElement::sanitizeUserInputValue(const InputElement* inputElement, const String& proposedValue, int maxLength) +static String replaceEOLAndLimitLength(const InputElement* inputElement, const String& proposedValue, int maxLength) { if (!inputElement->isTextField()) return proposedValue; @@ -179,6 +166,24 @@ String InputElement::sanitizeUserInputValue(const InputElement* inputElement, co return string.left(newLength); } +String InputElement::sanitizeValueForTextField(const InputElement* inputElement, const String& proposedValue) +{ +#if ENABLE(WCSS) + InputElementData data = const_cast<InputElement*>(inputElement)->data(); + if (!isConformToInputMask(data, proposedValue)) { + if (isConformToInputMask(data, data.value())) + return data.value(); + return String(); + } +#endif + return replaceEOLAndLimitLength(inputElement, proposedValue, s_maximumLength); +} + +String InputElement::sanitizeUserInputValue(const InputElement* inputElement, const String& proposedValue, int maxLength) +{ + return replaceEOLAndLimitLength(inputElement, proposedValue, maxLength); +} + void InputElement::handleBeforeTextInsertedEvent(InputElementData& data, InputElement* inputElement, Element* element, Event* event) { ASSERT(event->isBeforeTextInsertedEvent()); @@ -199,7 +204,7 @@ void InputElement::handleBeforeTextInsertedEvent(InputElementData& data, InputEl // Selected characters will be removed by the next text event. unsigned baseLength = oldLength - selectionLength; - unsigned maxLength = static_cast<unsigned>(data.maxLength()); // maxLength() can never be negative. + unsigned maxLength = static_cast<unsigned>(inputElement->supportsMaxLength() ? data.maxLength() : s_maximumLength); // maxLength() can never be negative. unsigned appendableLength = maxLength > baseLength ? maxLength - baseLength : 0; // Truncate the inserted text to avoid violating the maxLength and other constraints. @@ -245,7 +250,7 @@ void InputElement::parseMaxLengthAttribute(InputElementData& data, InputElement* void InputElement::updateValueIfNeeded(InputElementData& data, InputElement* inputElement) { String oldValue = data.value(); - String newValue = sanitizeValue(inputElement, oldValue); + String newValue = inputElement->sanitizeValue(oldValue); if (newValue != oldValue) inputElement->setValue(newValue); } diff --git a/WebCore/dom/InputElement.h b/WebCore/dom/InputElement.h index 1d6c356..dc87b3d 100644 --- a/WebCore/dom/InputElement.h +++ b/WebCore/dom/InputElement.h @@ -43,6 +43,7 @@ public: virtual bool isPasswordField() const = 0; virtual bool isSearchField() const = 0; virtual bool isTextField() const = 0; + virtual bool supportsMaxLength() const = 0; virtual bool hasSpinButton() const { return false; } #if ENABLE(INPUT_SPEECH) virtual bool isSpeechEnabled() const = 0; @@ -78,9 +79,11 @@ protected: static void setValueFromRenderer(InputElementData&, InputElement*, Element*, const String&); // Replaces CRs and LFs, shrinks the value for s_maximumLength. // This should be applied to values from the HTML value attribute and the DOM value property. - static String sanitizeValue(const InputElement*, const String&); + // This function should be called only by sanitizeValue() implementations. + static String sanitizeValueForTextField(const InputElement*, const String&); // Replaces CRs and LFs, shrinks the value for the specified maximum length. // This should be applied to values specified by users. + // The input string may be a fragment of the whole value. static String sanitizeUserInputValue(const InputElement*, const String&, int); static void handleBeforeTextInsertedEvent(InputElementData&, InputElement*, Element*, Event*); static void parseSizeAttribute(InputElementData&, Element*, Attribute*); diff --git a/WebCore/dom/ScriptElement.cpp b/WebCore/dom/ScriptElement.cpp index 518aead..dab8f8c 100644 --- a/WebCore/dom/ScriptElement.cpp +++ b/WebCore/dom/ScriptElement.cpp @@ -27,6 +27,7 @@ #include "CachedScript.h" #include "DocLoader.h" #include "Document.h" +#include "DocumentParser.h" #include "Frame.h" #include "FrameLoader.h" #include "HTMLNames.h" @@ -53,6 +54,16 @@ void ScriptElement::insertedIntoDocument(ScriptElementData& data, const String& if (data.createdByParser()) return; + // http://www.whatwg.org/specs/web-apps/current-work/#script + + // If the element's Document has an active parser, and the parser's script + // nesting level is non-zero, but this script element does not have the + // "parser-inserted" flag set, the user agent must set the element's + // "write-neutralised" flag. + DocumentParser* parser = data.element()->document()->parser(); + if (parser && parser->hasInsertionPoint()) + data.setWriteDisabled(true); + if (!sourceUrl.isEmpty()) { data.requestScript(sourceUrl); return; @@ -84,13 +95,6 @@ void ScriptElement::childrenChanged(ScriptElementData& data) data.evaluateScript(ScriptSourceCode(data.scriptContent(), element->document()->url())); // FIXME: Provide a real starting line number here } -static inline bool useHTML5Parser(Document* document) -{ - ASSERT(document); - Settings* settings = document->page() ? document->page()->settings() : 0; - return settings && settings->html5ParserEnabled(); -} - void ScriptElement::finishParsingChildren(ScriptElementData& data, const String& sourceUrl) { // The parser just reached </script>. If we have no src and no text, @@ -137,6 +141,7 @@ ScriptElementData::ScriptElementData(ScriptElement* scriptElement, Element* elem , m_element(element) , m_cachedScript(0) , m_createdByParser(false) + , m_writeDisabled(false) , m_requested(false) , m_evaluated(false) , m_firedLoad(false) @@ -191,7 +196,29 @@ void ScriptElementData::evaluateScript(const ScriptSourceCode& sourceCode) m_evaluated = true; + // http://www.whatwg.org/specs/web-apps/current-work/#script + + // If the script element's "write-neutralised" flag is set, then flag + // the Document the script element was in when the "write-neutralised" + // flag was set as being itself "write-neutralised". Let neutralised doc + // be that Document. + if (m_writeDisabled) { + ASSERT(!m_element->document()->writeDisabled()); + m_element->document()->setWriteDisabled(true); + } + + // Create a script from the script element node, using the script + // block's source and the script block's type. + // Note: This is where the script is compiled and actually executed. frame->script()->evaluate(sourceCode); + + // Remove the "write-neutralised" flag from neutralised doc, if it was + // set in the earlier step. + if (m_writeDisabled) { + ASSERT(m_element->document()->writeDisabled()); + m_element->document()->setWriteDisabled(false); + } + Document::updateStyleForAllDocuments(); } } diff --git a/WebCore/dom/ScriptElement.h b/WebCore/dom/ScriptElement.h index c663e43..698ffbc 100644 --- a/WebCore/dom/ScriptElement.h +++ b/WebCore/dom/ScriptElement.h @@ -82,6 +82,8 @@ public: Element* element() const { return m_element; } bool createdByParser() const { return m_createdByParser; } void setCreatedByParser(bool value) { m_createdByParser = value; } + bool writeDisabled() const { return m_writeDisabled; } + void setWriteDisabled(bool value) { m_writeDisabled = value; } bool haveFiredLoadEvent() const { return m_firedLoad; } void setHaveFiredLoadEvent(bool firedLoad) { m_firedLoad = firedLoad; } @@ -99,6 +101,7 @@ private: Element* m_element; CachedResourceHandle<CachedScript> m_cachedScript; bool m_createdByParser; // HTML5: "parser-inserted" + bool m_writeDisabled; // http://www.whatwg.org/specs/web-apps/current-work/#write-neutralised bool m_requested; bool m_evaluated; // HTML5: "already started" bool m_firedLoad; diff --git a/WebCore/dom/UserTypingGestureIndicator.cpp b/WebCore/dom/UserTypingGestureIndicator.cpp new file mode 100644 index 0000000..5120843 --- /dev/null +++ b/WebCore/dom/UserTypingGestureIndicator.cpp @@ -0,0 +1,66 @@ +/* + * Copyright (C) 2010 Apple Inc. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, + * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS + * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF + * THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "config.h" +#include "UserTypingGestureIndicator.h" + +#include "Frame.h" +#include "Node.h" +#include <wtf/StdLibExtras.h> + +namespace WebCore { + +static bool s_processingUserTypingGesture; +bool UserTypingGestureIndicator::processingUserTypingGesture() +{ + return s_processingUserTypingGesture; +} + +static RefPtr<Node>& focusedNode() +{ + DEFINE_STATIC_LOCAL(RefPtr<Node>, node, ()); + return node; +} + +Node* UserTypingGestureIndicator::focusedElementAtGestureStart() +{ + return focusedNode().get(); +} + +UserTypingGestureIndicator::UserTypingGestureIndicator(Frame* frame) + : m_previousProcessingUserTypingGesture(s_processingUserTypingGesture) + , m_previousFocusedNode(focusedNode()) +{ + s_processingUserTypingGesture = true; + focusedNode() = frame->document() ? frame->document()->focusedNode() : 0; +} + +UserTypingGestureIndicator::~UserTypingGestureIndicator() +{ + s_processingUserTypingGesture = m_previousProcessingUserTypingGesture; + focusedNode() = m_previousFocusedNode; +} + +} // namespace WebCore diff --git a/WebCore/dom/UserTypingGestureIndicator.h b/WebCore/dom/UserTypingGestureIndicator.h new file mode 100644 index 0000000..6c71079 --- /dev/null +++ b/WebCore/dom/UserTypingGestureIndicator.h @@ -0,0 +1,52 @@ +/* + * Copyright (C) 2010 Apple Inc. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, + * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS + * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF + * THE POSSIBILITY OF SUCH DAMAGE. + */ + +#ifndef UserTypingGestureIndicator_h +#define UserTypingGestureIndicator_h + +#include <wtf/Noncopyable.h> +#include <wtf/RefPtr.h> + +namespace WebCore { + +class Frame; +class Node; + +class UserTypingGestureIndicator : public Noncopyable { +public: + static bool processingUserTypingGesture(); + static Node* focusedElementAtGestureStart(); + + explicit UserTypingGestureIndicator(Frame*); + ~UserTypingGestureIndicator(); + +private: + bool m_previousProcessingUserTypingGesture; + RefPtr<Node> m_previousFocusedNode; +}; + +} // namespace WebCore + +#endif // UserTypingGestureIndicator_h diff --git a/WebCore/editing/ApplyStyleCommand.cpp b/WebCore/editing/ApplyStyleCommand.cpp index c50c988..8847714 100644 --- a/WebCore/editing/ApplyStyleCommand.cpp +++ b/WebCore/editing/ApplyStyleCommand.cpp @@ -684,13 +684,14 @@ void ApplyStyleCommand::applyRelativeFontStyleChange(CSSMutableStyleDeclaration } // Split the start text nodes if needed to apply style. - bool splitStart = splitTextAtStartIfNeeded(start, end); - if (splitStart) { + if (isValidCaretPositionInTextNode(start)) { + splitTextAtStart(start, end); start = startPosition(); end = endPosition(); } - bool splitEnd = splitTextAtEndIfNeeded(start, end); - if (splitEnd) { + + if (isValidCaretPositionInTextNode(end)) { + splitTextAtEnd(start, end); start = startPosition(); end = endPosition(); } @@ -907,16 +908,18 @@ void ApplyStyleCommand::applyInlineStyle(CSSMutableStyleDeclaration *style) } // split the start node and containing element if the selection starts inside of it - bool splitStart = splitTextElementAtStartIfNeeded(start, end); + bool splitStart = isValidCaretPositionInTextNode(start); if (splitStart) { + splitTextElementAtStart(start, end); start = startPosition(); end = endPosition(); startDummySpanAncestor = dummySpanAncestorForNode(start.node()); } // split the end node and containing element if the selection ends inside of it - bool splitEnd = splitTextElementAtEndIfNeeded(start, end); + bool splitEnd = isValidCaretPositionInTextNode(end); if (splitEnd) { + splitTextElementAtEnd(start, end); start = startPosition(); end = endPosition(); endDummySpanAncestor = dummySpanAncestorForNode(end.node()); @@ -1529,62 +1532,61 @@ bool ApplyStyleCommand::nodeFullyUnselected(Node *node, const Position &start, c return isFullyBeforeStart || isFullyAfterEnd; } - -bool ApplyStyleCommand::splitTextAtStartIfNeeded(const Position &start, const Position &end) +void ApplyStyleCommand::splitTextAtStart(const Position& start, const Position& end) { - if (start.node()->isTextNode() && start.deprecatedEditingOffset() > caretMinOffset(start.node()) && start.deprecatedEditingOffset() < caretMaxOffset(start.node())) { - int endOffsetAdjustment = start.node() == end.node() ? start.deprecatedEditingOffset() : 0; - Text *text = static_cast<Text *>(start.node()); - splitTextNode(text, start.deprecatedEditingOffset()); - updateStartEnd(Position(start.node(), 0), Position(end.node(), end.deprecatedEditingOffset() - endOffsetAdjustment)); - return true; - } - return false; + int endOffsetAdjustment = start.node() == end.node() ? start.deprecatedEditingOffset() : 0; + Text* text = static_cast<Text*>(start.node()); + splitTextNode(text, start.deprecatedEditingOffset()); + updateStartEnd(Position(start.node(), 0), Position(end.node(), end.deprecatedEditingOffset() - endOffsetAdjustment)); } -bool ApplyStyleCommand::splitTextAtEndIfNeeded(const Position &start, const Position &end) +void ApplyStyleCommand::splitTextAtEnd(const Position& start, const Position& end) { - if (end.node()->isTextNode() && end.deprecatedEditingOffset() > caretMinOffset(end.node()) && end.deprecatedEditingOffset() < caretMaxOffset(end.node())) { - Text *text = static_cast<Text *>(end.node()); - splitTextNode(text, end.deprecatedEditingOffset()); - - Node *prevNode = text->previousSibling(); - ASSERT(prevNode); - Node *startNode = start.node() == end.node() ? prevNode : start.node(); - ASSERT(startNode); - updateStartEnd(Position(startNode, start.deprecatedEditingOffset()), Position(prevNode, caretMaxOffset(prevNode))); - return true; - } - return false; + Text* text = static_cast<Text *>(end.node()); + splitTextNode(text, end.deprecatedEditingOffset()); + + Node* prevNode = text->previousSibling(); + ASSERT(prevNode); + Node* startNode = start.node() == end.node() ? prevNode : start.node(); + ASSERT(startNode); + updateStartEnd(Position(startNode, start.deprecatedEditingOffset()), Position(prevNode, caretMaxOffset(prevNode))); } -bool ApplyStyleCommand::splitTextElementAtStartIfNeeded(const Position &start, const Position &end) +void ApplyStyleCommand::splitTextElementAtStart(const Position& start, const Position& end) { - if (start.node()->isTextNode() && start.deprecatedEditingOffset() > caretMinOffset(start.node()) && start.deprecatedEditingOffset() < caretMaxOffset(start.node())) { - int endOffsetAdjustment = start.node() == end.node() ? start.deprecatedEditingOffset() : 0; - Text *text = static_cast<Text *>(start.node()); - splitTextNodeContainingElement(text, start.deprecatedEditingOffset()); + Node* parent = start.node()->parentNode(); + if (!parent || !parent->parentElement() || !parent->parentElement()->isContentEditable()) + return splitTextAtStart(start, end); - updateStartEnd(Position(start.node()->parentNode(), start.node()->nodeIndex()), Position(end.node(), end.deprecatedEditingOffset() - endOffsetAdjustment)); - return true; - } - return false; + int endOffsetAdjustment = start.node() == end.node() ? start.deprecatedEditingOffset() : 0; + Text* text = static_cast<Text*>(start.node()); + splitTextNodeContainingElement(text, start.deprecatedEditingOffset()); + updateStartEnd(Position(start.node()->parentNode(), start.node()->nodeIndex()), Position(end.node(), end.deprecatedEditingOffset() - endOffsetAdjustment)); } -bool ApplyStyleCommand::splitTextElementAtEndIfNeeded(const Position &start, const Position &end) +void ApplyStyleCommand::splitTextElementAtEnd(const Position& start, const Position& end) { - if (end.node()->isTextNode() && end.deprecatedEditingOffset() > caretMinOffset(end.node()) && end.deprecatedEditingOffset() < caretMaxOffset(end.node())) { - Text *text = static_cast<Text *>(end.node()); - splitTextNodeContainingElement(text, end.deprecatedEditingOffset()); + Node* parent = end.node()->parentNode(); + if (!parent || !parent->parentElement() || !parent->parentElement()->isContentEditable()) + return splitTextAtEnd(start, end); - Node *prevNode = text->parent()->previousSibling()->lastChild(); - ASSERT(prevNode); - Node *startNode = start.node() == end.node() ? prevNode : start.node(); - ASSERT(startNode); - updateStartEnd(Position(startNode, start.deprecatedEditingOffset()), Position(prevNode->parent(), prevNode->nodeIndex() + 1)); - return true; - } - return false; + Text* text = static_cast<Text*>(end.node()); + splitTextNodeContainingElement(text, end.deprecatedEditingOffset()); + + Node* prevNode = text->parent()->previousSibling()->lastChild(); + ASSERT(prevNode); + Node* startNode = start.node() == end.node() ? prevNode : start.node(); + ASSERT(startNode); + updateStartEnd(Position(startNode, start.deprecatedEditingOffset()), Position(prevNode->parent(), prevNode->nodeIndex() + 1)); +} + +bool ApplyStyleCommand::isValidCaretPositionInTextNode(const Position& position) +{ + Node* node = position.node(); + if (!node->isTextNode()) + return false; + int offsetInText = position.deprecatedEditingOffset(); + return (offsetInText > caretMinOffset(node) && offsetInText < caretMaxOffset(node)); } static bool areIdenticalElements(Node *first, Node *second) diff --git a/WebCore/editing/ApplyStyleCommand.h b/WebCore/editing/ApplyStyleCommand.h index 8326329..199b9db 100644 --- a/WebCore/editing/ApplyStyleCommand.h +++ b/WebCore/editing/ApplyStyleCommand.h @@ -91,10 +91,11 @@ private: void applyInlineStyleToRange(CSSMutableStyleDeclaration*, const Position& start, const Position& end); void addBlockStyle(const StyleChange&, HTMLElement*); void addInlineStyleIfNeeded(CSSMutableStyleDeclaration*, Node* start, Node* end); - bool splitTextAtStartIfNeeded(const Position& start, const Position& end); - bool splitTextAtEndIfNeeded(const Position& start, const Position& end); - bool splitTextElementAtStartIfNeeded(const Position& start, const Position& end); - bool splitTextElementAtEndIfNeeded(const Position& start, const Position& end); + void splitTextAtStart(const Position& start, const Position& end); + void splitTextAtEnd(const Position& start, const Position& end); + void splitTextElementAtStart(const Position& start, const Position& end); + void splitTextElementAtEnd(const Position& start, const Position& end); + bool isValidCaretPositionInTextNode(const Position& position); bool mergeStartWithPreviousIfIdentical(const Position& start, const Position& end); bool mergeEndWithNextIfIdentical(const Position& start, const Position& end); void cleanupUnstyledAppleStyleSpans(Node* dummySpanAncestor); diff --git a/WebCore/editing/CompositeEditCommand.cpp b/WebCore/editing/CompositeEditCommand.cpp index 41d6758..c5a8959 100644 --- a/WebCore/editing/CompositeEditCommand.cpp +++ b/WebCore/editing/CompositeEditCommand.cpp @@ -1009,7 +1009,8 @@ bool CompositeEditCommand::breakOutOfEmptyListItem() // FIXME: Can't we do something better when the immediate parent wasn't a list node? if (!listNode || (!listNode->hasTagName(ulTag) && !listNode->hasTagName(olTag)) - || !listNode->isContentEditable()) + || !listNode->isContentEditable() + || listNode == emptyListItem->rootEditableElement()) return false; RefPtr<Element> newBlock = 0; diff --git a/WebCore/editing/Editor.cpp b/WebCore/editing/Editor.cpp index 773ed90..44d8d5f 100644 --- a/WebCore/editing/Editor.cpp +++ b/WebCore/editing/Editor.cpp @@ -68,6 +68,7 @@ #include "Text.h" #include "TextIterator.h" #include "TypingCommand.h" +#include "UserTypingGestureIndicator.h" #include "htmlediting.h" #include "markup.h" #include "visible_units.h" @@ -712,7 +713,7 @@ bool Editor::dispatchCPPEvent(const AtomicString &eventType, ClipboardAccessPoli return true; target = target->shadowAncestorNode(); - RefPtr<Clipboard> clipboard = newGeneralClipboard(policy); + RefPtr<Clipboard> clipboard = newGeneralClipboard(policy, m_frame); ExceptionCode ec = 0; RefPtr<Event> evt = ClipboardEvent::create(eventType, true, true, clipboard); @@ -1370,6 +1371,8 @@ void Editor::confirmComposition(const String& text) void Editor::confirmComposition(const String& text, bool preserveSelection) { + UserTypingGestureIndicator typingGestureIndicator(m_frame); + setIgnoreCompositionSelectionChange(true); VisibleSelection oldSelection = m_frame->selection()->selection(); @@ -1412,6 +1415,8 @@ void Editor::confirmComposition(const String& text, bool preserveSelection) void Editor::setComposition(const String& text, const Vector<CompositionUnderline>& underlines, unsigned selectionStart, unsigned selectionEnd) { + UserTypingGestureIndicator typingGestureIndicator(m_frame); + setIgnoreCompositionSelectionChange(true); selectComposition(); diff --git a/WebCore/editing/Editor.h b/WebCore/editing/Editor.h index cd1b204..db249e7 100644 --- a/WebCore/editing/Editor.h +++ b/WebCore/editing/Editor.h @@ -42,6 +42,7 @@ class DeleteButtonController; class EditCommand; class EditorClient; class EditorInternalCommand; +class Frame; class HTMLElement; class HitTestResult; class KillRing; @@ -309,7 +310,7 @@ private: bool canDeleteRange(Range*) const; bool canSmartReplaceWithPasteboard(Pasteboard*); - PassRefPtr<Clipboard> newGeneralClipboard(ClipboardAccessPolicy); + PassRefPtr<Clipboard> newGeneralClipboard(ClipboardAccessPolicy, Frame*); void pasteAsPlainTextWithPasteboard(Pasteboard*); void pasteWithPasteboard(Pasteboard*, bool allowPlainText); void replaceSelectionWithFragment(PassRefPtr<DocumentFragment>, bool selectReplacement, bool smartReplace, bool matchStyle); diff --git a/WebCore/editing/InsertListCommand.cpp b/WebCore/editing/InsertListCommand.cpp index 06162c9..8f9c0de 100644 --- a/WebCore/editing/InsertListCommand.cpp +++ b/WebCore/editing/InsertListCommand.cpp @@ -150,6 +150,14 @@ void InsertListCommand::doApplyForSingleParagraph(bool forceCreateList) m_listElement = listifyParagraph(endingSelection().visibleStart(), listTag); } +static Node* enclosingListChild(Node* node, Node* listNode) +{ + Node* listChild = enclosingListChild(node); + if (enclosingList(listChild) != listNode) + return 0; + return listChild; +} + void InsertListCommand::unlistifyParagraph(const VisiblePosition& originalStart, HTMLElement* listNode, Node* listChildNode) { Node* nextListChild; @@ -165,14 +173,10 @@ void InsertListCommand::unlistifyParagraph(const VisiblePosition& originalStart, // A paragraph is visually a list item minus a list marker. The paragraph will be moved. start = startOfParagraph(originalStart); end = endOfParagraph(start); - nextListChild = enclosingListChild(end.next().deepEquivalent().node()); + nextListChild = enclosingListChild(end.next().deepEquivalent().node(), listNode); ASSERT(nextListChild != listChildNode); - if (enclosingList(nextListChild) != listNode) - nextListChild = 0; - previousListChild = enclosingListChild(start.previous().deepEquivalent().node()); + previousListChild = enclosingListChild(start.previous().deepEquivalent().node(), listNode); ASSERT(previousListChild != listChildNode); - if (enclosingList(previousListChild) != listNode) - previousListChild = 0; } // When removing a list, we must always create a placeholder to act as a point of insertion // for the list content being removed. @@ -210,28 +214,37 @@ void InsertListCommand::unlistifyParagraph(const VisiblePosition& originalStart, moveParagraphs(start, end, insertionPoint, true); } +static Element* adjacentEnclosingList(const VisiblePosition& pos, const VisiblePosition& adjacentPos, const QualifiedName& listTag) +{ + Element* listNode = outermostEnclosingList(adjacentPos.deepEquivalent().node()); + + if (!listNode) + return 0; + + Node* previousCell = enclosingTableCell(pos.deepEquivalent()); + Node* currentCell = enclosingTableCell(adjacentPos.deepEquivalent()); + + if (!listNode->hasTagName(listTag) + || listNode->contains(pos.deepEquivalent().node()) + || previousCell != currentCell) + return 0; + + return listNode; +} + PassRefPtr<HTMLElement> InsertListCommand::listifyParagraph(const VisiblePosition& originalStart, const QualifiedName& listTag) { VisiblePosition start = startOfParagraph(originalStart); VisiblePosition end = endOfParagraph(start); // Check for adjoining lists. - VisiblePosition previousPosition = start.previous(true); - VisiblePosition nextPosition = end.next(true); RefPtr<HTMLElement> listItemElement = createListItemElement(document()); RefPtr<HTMLElement> placeholder = createBreakElement(document()); appendNode(placeholder, listItemElement); - Element* previousList = outermostEnclosingList(previousPosition.deepEquivalent().node()); - Element* nextList = outermostEnclosingList(nextPosition.deepEquivalent().node()); - Node* startNode = start.deepEquivalent().node(); - Node* previousCell = enclosingTableCell(previousPosition.deepEquivalent()); - Node* nextCell = enclosingTableCell(nextPosition.deepEquivalent()); - Node* currentCell = enclosingTableCell(start.deepEquivalent()); - if (previousList && (!previousList->hasTagName(listTag) || startNode->isDescendantOf(previousList) || previousCell != currentCell)) - previousList = 0; - if (nextList && (!nextList->hasTagName(listTag) || startNode->isDescendantOf(nextList) || nextCell != currentCell)) - nextList = 0; + // Place list item into adjoining lists. + Element* previousList = adjacentEnclosingList(start.deepEquivalent(), start.previous(true), listTag); + Element* nextList = adjacentEnclosingList(start.deepEquivalent(), end.next(true), listTag); RefPtr<HTMLElement> listElement; if (previousList) appendNode(listItemElement, previousList); @@ -268,8 +281,6 @@ PassRefPtr<HTMLElement> InsertListCommand::listifyParagraph(const VisiblePositio // Update the start of content, so we don't try to move the list into itself. bug 19066 if (insertionPos == start.deepEquivalent()) start = startOfParagraph(originalStart); - previousList = outermostEnclosingList(previousPosition.deepEquivalent().node(), enclosingList(listElement.get())); - nextList = outermostEnclosingList(nextPosition.deepEquivalent().node(), enclosingList(listElement.get())); } moveParagraph(start, end, VisiblePosition(Position(placeholder.get(), 0)), true); @@ -281,6 +292,8 @@ PassRefPtr<HTMLElement> InsertListCommand::listifyParagraph(const VisiblePositio listElement = m_listElement; if (listElement) { + previousList = listElement->previousElementSibling(); + nextList = listElement->nextElementSibling(); if (canMergeLists(previousList, listElement.get())) mergeIdenticalElements(previousList, listElement.get()); if (canMergeLists(listElement.get(), nextList)) diff --git a/WebCore/editing/SplitTextNodeCommand.cpp b/WebCore/editing/SplitTextNodeCommand.cpp index 15daa49..9a7e3b3 100644 --- a/WebCore/editing/SplitTextNodeCommand.cpp +++ b/WebCore/editing/SplitTextNodeCommand.cpp @@ -54,21 +54,15 @@ void SplitTextNodeCommand::doApply() return; ExceptionCode ec = 0; - String prefixText = m_text2->substringData(0, m_offset, ec); if (prefixText.isEmpty()) return; - RefPtr<Text> prefixTextNode = Text::create(document(), prefixText); - ASSERT(prefixTextNode); - document()->copyMarkers(m_text2.get(), 0, m_offset, prefixTextNode.get(), 0); + m_text1 = Text::create(document(), prefixText); + ASSERT(m_text1); + document()->copyMarkers(m_text2.get(), 0, m_offset, m_text1.get(), 0); - parent->insertBefore(prefixTextNode.get(), m_text2.get(), ec); - if (ec) - return; - - m_text2->deleteData(0, m_offset, ec); - m_text1 = prefixTextNode.release(); + insertText1AndTrimText2(); } void SplitTextNodeCommand::doUnapply() @@ -78,16 +72,35 @@ void SplitTextNodeCommand::doUnapply() ASSERT(m_text1->document() == document()); - RefPtr<Text> prefixTextNode = m_text1.release(); - String prefixText = prefixTextNode->data(); + String prefixText = m_text1->data(); ExceptionCode ec = 0; m_text2->insertData(0, prefixText, ec); - if (ec) + ASSERT(!ec); + + document()->copyMarkers(m_text1.get(), 0, prefixText.length(), m_text2.get(), 0); + m_text1->remove(ec); +} + +void SplitTextNodeCommand::doReapply() +{ + if (!m_text1 || !m_text2) return; - document()->copyMarkers(prefixTextNode.get(), 0, prefixText.length(), m_text2.get(), 0); - prefixTextNode->remove(ec); + Node* parent = m_text2->parentNode(); + if (!parent || !parent->isContentEditable()) + return; + + insertText1AndTrimText2(); } +void SplitTextNodeCommand::insertText1AndTrimText2() +{ + ExceptionCode ec = 0; + m_text2->parentNode()->insertBefore(m_text1.get(), m_text2.get(), ec); + if (ec) + return; + m_text2->deleteData(0, m_offset, ec); +} + } // namespace WebCore diff --git a/WebCore/editing/SplitTextNodeCommand.h b/WebCore/editing/SplitTextNodeCommand.h index 48d444c..8d67d82 100644 --- a/WebCore/editing/SplitTextNodeCommand.h +++ b/WebCore/editing/SplitTextNodeCommand.h @@ -44,6 +44,8 @@ private: virtual void doApply(); virtual void doUnapply(); + virtual void doReapply(); + void insertText1AndTrimText2(); RefPtr<Text> m_text1; RefPtr<Text> m_text2; diff --git a/WebCore/editing/SplitTextNodeContainingElementCommand.cpp b/WebCore/editing/SplitTextNodeContainingElementCommand.cpp index e716c72..8c90fb0 100644 --- a/WebCore/editing/SplitTextNodeContainingElementCommand.cpp +++ b/WebCore/editing/SplitTextNodeContainingElementCommand.cpp @@ -48,7 +48,7 @@ void SplitTextNodeContainingElementCommand::doApply() splitTextNode(m_text.get(), m_offset); Element* parent = m_text->parentElement(); - if (!parent) + if (!parent || !parent->parentElement() || !parent->parentElement()->isContentEditable()) return; RenderObject* parentRenderer = parent->renderer(); diff --git a/WebCore/editing/android/EditorAndroid.cpp b/WebCore/editing/android/EditorAndroid.cpp index 8e00326..61cce01 100644 --- a/WebCore/editing/android/EditorAndroid.cpp +++ b/WebCore/editing/android/EditorAndroid.cpp @@ -31,7 +31,7 @@ namespace WebCore { -PassRefPtr<Clipboard> Editor::newGeneralClipboard(ClipboardAccessPolicy policy) +PassRefPtr<Clipboard> Editor::newGeneralClipboard(ClipboardAccessPolicy policy, Frame*) { return new ClipboardAndroid(policy, false); } diff --git a/WebCore/editing/brew/EditorBrew.cpp b/WebCore/editing/brew/EditorBrew.cpp index b610b62..4a1f4d7 100644 --- a/WebCore/editing/brew/EditorBrew.cpp +++ b/WebCore/editing/brew/EditorBrew.cpp @@ -31,7 +31,7 @@ namespace WebCore { -PassRefPtr<Clipboard> Editor::newGeneralClipboard(ClipboardAccessPolicy policy) +PassRefPtr<Clipboard> Editor::newGeneralClipboard(ClipboardAccessPolicy policy, Frame*) { return new ClipboardBrew(policy, false); } diff --git a/WebCore/editing/chromium/EditorChromium.cpp b/WebCore/editing/chromium/EditorChromium.cpp index 1ea085b..7a13b12 100644 --- a/WebCore/editing/chromium/EditorChromium.cpp +++ b/WebCore/editing/chromium/EditorChromium.cpp @@ -33,12 +33,13 @@ #include "ChromiumDataObject.h" #include "ClipboardChromium.h" +#include "Frame.h" namespace WebCore { -PassRefPtr<Clipboard> Editor::newGeneralClipboard(ClipboardAccessPolicy policy) +PassRefPtr<Clipboard> Editor::newGeneralClipboard(ClipboardAccessPolicy policy, Frame* frame) { - return ClipboardChromium::create(false, ChromiumDataObject::create(), policy); + return ClipboardChromium::create(false, ChromiumDataObject::create(), policy, frame); } } // namespace WebCore diff --git a/WebCore/editing/haiku/EditorHaiku.cpp b/WebCore/editing/haiku/EditorHaiku.cpp index 723d4ff..4596c9e 100644 --- a/WebCore/editing/haiku/EditorHaiku.cpp +++ b/WebCore/editing/haiku/EditorHaiku.cpp @@ -35,7 +35,7 @@ namespace WebCore { -PassRefPtr<Clipboard> Editor::newGeneralClipboard(ClipboardAccessPolicy policy) +PassRefPtr<Clipboard> Editor::newGeneralClipboard(ClipboardAccessPolicy policy, Frame*) { return ClipboardHaiku::create(policy, false); } diff --git a/WebCore/editing/mac/EditorMac.mm b/WebCore/editing/mac/EditorMac.mm index ca001a2..2c5a602 100644 --- a/WebCore/editing/mac/EditorMac.mm +++ b/WebCore/editing/mac/EditorMac.mm @@ -33,9 +33,9 @@ namespace WebCore { -PassRefPtr<Clipboard> Editor::newGeneralClipboard(ClipboardAccessPolicy policy) +PassRefPtr<Clipboard> Editor::newGeneralClipboard(ClipboardAccessPolicy policy, Frame* frame) { - return ClipboardMac::create(false, [NSPasteboard generalPasteboard], policy, 0); + return ClipboardMac::create(false, [NSPasteboard generalPasteboard], policy, frame); } void Editor::showFontPanel() diff --git a/WebCore/editing/qt/EditorQt.cpp b/WebCore/editing/qt/EditorQt.cpp index e74e2f3..7fb3634 100644 --- a/WebCore/editing/qt/EditorQt.cpp +++ b/WebCore/editing/qt/EditorQt.cpp @@ -39,7 +39,7 @@ namespace WebCore { -PassRefPtr<Clipboard> Editor::newGeneralClipboard(ClipboardAccessPolicy policy) +PassRefPtr<Clipboard> Editor::newGeneralClipboard(ClipboardAccessPolicy policy, Frame*) { return ClipboardQt::create(policy); } diff --git a/WebCore/editing/visible_units.cpp b/WebCore/editing/visible_units.cpp index c094aac..dd48406 100644 --- a/WebCore/editing/visible_units.cpp +++ b/WebCore/editing/visible_units.cpp @@ -377,9 +377,9 @@ static VisiblePosition positionAvoidingFirstPositionInTable(const VisiblePositio { // return table offset 0 instead of the first VisiblePosition inside the table VisiblePosition previous = c.previous(); - if (isLastPositionBeforeTable(previous)) + if (isLastPositionBeforeTable(previous) && isEditablePosition(previous.deepEquivalent())) return previous; - + return c; } diff --git a/WebCore/editing/wx/EditorWx.cpp b/WebCore/editing/wx/EditorWx.cpp index cb9e836..a2ec654 100644 --- a/WebCore/editing/wx/EditorWx.cpp +++ b/WebCore/editing/wx/EditorWx.cpp @@ -31,7 +31,7 @@ namespace WebCore { -PassRefPtr<Clipboard> Editor::newGeneralClipboard(ClipboardAccessPolicy policy) +PassRefPtr<Clipboard> Editor::newGeneralClipboard(ClipboardAccessPolicy policy, Frame*) { return ClipboardWx::create(policy, true); } diff --git a/WebCore/history/PageCache.cpp b/WebCore/history/PageCache.cpp index 7719187..228f7ea 100644 --- a/WebCore/history/PageCache.cpp +++ b/WebCore/history/PageCache.cpp @@ -269,7 +269,7 @@ bool PageCache::canCachePageContainingThisFrame(Frame* frame) #endif #if ENABLE(WML) && !frame->document()->containsWMLContent() - && !frame->document()->isWMLDocument(); + && !frame->document()->isWMLDocument() #endif && frame->loader()->client()->canCachePage(); } diff --git a/WebCore/html/Blob.cpp b/WebCore/html/Blob.cpp index 0680d82..a41fb2e 100644 --- a/WebCore/html/Blob.cpp +++ b/WebCore/html/Blob.cpp @@ -36,19 +36,19 @@ namespace WebCore { -Blob::Blob(const String& type, const BlobItemList& items) +Blob::Blob(ScriptExecutionContext*, const String& type, const BlobItemList& items) : m_type(type) { for (size_t i = 0; i < items.size(); ++i) m_items.append(items[i]); } -Blob::Blob(const PassRefPtr<BlobItem>& item) +Blob::Blob(ScriptExecutionContext*, const PassRefPtr<BlobItem>& item) { m_items.append(item); } -Blob::Blob(const String& path) +Blob::Blob(ScriptExecutionContext*, const String& path) { // Note: this doesn't initialize the type unlike File(path). m_items.append(FileBlobItem::create(path)); @@ -71,7 +71,7 @@ const String& Blob::path() const } #if ENABLE(BLOB_SLICE) -PassRefPtr<Blob> Blob::slice(long long start, long long length, const String& contentType) const +PassRefPtr<Blob> Blob::slice(ScriptExecutionContext* scriptExecutionContext, long long start, long long length, const String& contentType) const { if (start < 0) start = 0; @@ -95,7 +95,7 @@ PassRefPtr<Blob> Blob::slice(long long start, long long length, const String& co length -= items.last()->size(); start = 0; } - return Blob::create(contentType, items); + return Blob::create(scriptExecutionContext, contentType, items); } #endif // ENABLE(BLOB_SLICE) diff --git a/WebCore/html/Blob.h b/WebCore/html/Blob.h index f5526c7..12ccca7 100644 --- a/WebCore/html/Blob.h +++ b/WebCore/html/Blob.h @@ -39,19 +39,21 @@ namespace WebCore { +class ScriptExecutionContext; + class Blob : public RefCounted<Blob> { public: - static PassRefPtr<Blob> create(const String& type, const BlobItemList& items) + static PassRefPtr<Blob> create(ScriptExecutionContext* scriptExecutionContext, const String& type, const BlobItemList& items) { - return adoptRef(new Blob(type, items)); + return adoptRef(new Blob(scriptExecutionContext, type, items)); } // FIXME: Deprecated method. This is called only from // bindings/v8/SerializedScriptValue.cpp and the usage in it will become invalid once // BlobBuilder is introduced. - static PassRefPtr<Blob> create(const String& path) + static PassRefPtr<Blob> create(ScriptExecutionContext* scriptExecutionContext, const String& path) { - return adoptRef(new Blob(path)); + return adoptRef(new Blob(scriptExecutionContext, path)); } virtual ~Blob() { } @@ -66,15 +68,15 @@ public: const BlobItemList& items() const { return m_items; } #if ENABLE(BLOB_SLICE) - PassRefPtr<Blob> slice(long long start, long long length, const String& contentType = String()) const; + PassRefPtr<Blob> slice(ScriptExecutionContext*, long long start, long long length, const String& contentType = String()) const; #endif protected: - Blob(const String& type, const BlobItemList&); - Blob(const PassRefPtr<BlobItem>&); + Blob(ScriptExecutionContext*, const String& type, const BlobItemList&); + Blob(ScriptExecutionContext*, const PassRefPtr<BlobItem>&); // FIXME: Deprecated constructor. See also the comment for Blob::create(path). - Blob(const String& path); + Blob(ScriptExecutionContext*, const String& path); BlobItemList m_items; String m_type; diff --git a/WebCore/html/Blob.idl b/WebCore/html/Blob.idl index 0ae2759..626bb73 100644 --- a/WebCore/html/Blob.idl +++ b/WebCore/html/Blob.idl @@ -34,8 +34,10 @@ module html { readonly attribute unsigned long long size; readonly attribute DOMString type; +#if !defined(LANGUAGE_OBJECTIVE_C) #if defined(ENABLE_BLOB_SLICE) && ENABLE_BLOB_SLICE - Blob slice(in long long start, in long long length, in [Optional, ConvertUndefinedOrNullToNullString] DOMString contentType); + [CallWith=ScriptExecutionContext] Blob slice(in long long start, in long long length, in [Optional, ConvertUndefinedOrNullToNullString] DOMString contentType); +#endif #endif }; diff --git a/WebCore/html/BlobBuilder.cpp b/WebCore/html/BlobBuilder.cpp index b2684fc..0592ff0 100644 --- a/WebCore/html/BlobBuilder.cpp +++ b/WebCore/html/BlobBuilder.cpp @@ -81,9 +81,9 @@ bool BlobBuilder::append(PassRefPtr<Blob> blob) return false; } -PassRefPtr<Blob> BlobBuilder::getBlob(const String& contentType) const +PassRefPtr<Blob> BlobBuilder::getBlob(ScriptExecutionContext* scriptExecutionContext, const String& contentType) const { - return Blob::create(contentType, m_items); + return Blob::create(scriptExecutionContext, contentType, m_items); } } // namespace WebCore diff --git a/WebCore/html/BlobBuilder.h b/WebCore/html/BlobBuilder.h index 1173c04..5d1700f 100644 --- a/WebCore/html/BlobBuilder.h +++ b/WebCore/html/BlobBuilder.h @@ -38,6 +38,7 @@ namespace WebCore { class Blob; +class ScriptExecutionContext; typedef int ExceptionCode; @@ -49,7 +50,7 @@ public: bool append(const String& text, ExceptionCode&); bool append(const String& text, const String& ending, ExceptionCode&); - PassRefPtr<Blob> getBlob(const String& contentType = String()) const; + PassRefPtr<Blob> getBlob(ScriptExecutionContext*, const String& contentType = String()) const; private: BlobItemList m_items; diff --git a/WebCore/html/BlobBuilder.idl b/WebCore/html/BlobBuilder.idl index 93cb87f..53c7add 100644 --- a/WebCore/html/BlobBuilder.idl +++ b/WebCore/html/BlobBuilder.idl @@ -34,7 +34,9 @@ module html { GenerateNativeConverter, NoStaticTables ] BlobBuilder { - Blob getBlob(in [Optional, ConvertUndefinedOrNullToNullString] DOMString contentType); +#if !defined(LANGUAGE_OBJECTIVE_C) + [CallWith=ScriptExecutionContext] Blob getBlob(in [Optional, ConvertUndefinedOrNullToNullString] DOMString contentType); +#endif void append(in Blob blob); void append(in DOMString value, in [Optional, ConvertUndefinedOrNullToNullString] DOMString endings) raises (DOMException); }; diff --git a/WebCore/html/File.cpp b/WebCore/html/File.cpp index 4000dcb..109e0d3 100644 --- a/WebCore/html/File.cpp +++ b/WebCore/html/File.cpp @@ -31,15 +31,15 @@ namespace WebCore { -File::File(const String& path) - : Blob(path) +File::File(ScriptExecutionContext* scriptExecutionContext, const String& path) + : Blob(scriptExecutionContext, path) { Init(); } #if ENABLE(DIRECTORY_UPLOAD) -File::File(const String& relativePath, const String& filePath) - : Blob(FileBlobItem::create(filePath, relativePath)) +File::File(ScriptExecutionContext* scriptExecutionContext, const String& relativePath, const String& filePath) + : Blob(scriptExecutionContext, FileBlobItem::create(filePath, relativePath)) { Init(); } diff --git a/WebCore/html/File.h b/WebCore/html/File.h index d685472..c0aecc8 100644 --- a/WebCore/html/File.h +++ b/WebCore/html/File.h @@ -34,15 +34,15 @@ namespace WebCore { class File : public Blob { public: - static PassRefPtr<File> create(const String& path) + static PassRefPtr<File> create(ScriptExecutionContext* scriptExecutionContext, const String& path) { - return adoptRef(new File(path)); + return adoptRef(new File(scriptExecutionContext, path)); } #if ENABLE(DIRECTORY_UPLOAD) - static PassRefPtr<File> create(const String& relativePath, const String& path) + static PassRefPtr<File> create(ScriptExecutionContext* scriptExecutionContext, const String& relativePath, const String& path) { - return adoptRef(new File(relativePath, path)); + return adoptRef(new File(scriptExecutionContext, relativePath, path)); } #endif @@ -59,11 +59,11 @@ public: unsigned long long fileSize() const { return size(); } private: - File(const String& path); + File(ScriptExecutionContext*, const String& path); void Init(); #if ENABLE(DIRECTORY_UPLOAD) - File(const String& relativePath, const String& path); + File(ScriptExecutionContext*, const String& relativePath, const String& path); #endif }; diff --git a/WebCore/html/FileThreadTask.h b/WebCore/html/FileThreadTask.h index baf0888..de11798 100644 --- a/WebCore/html/FileThreadTask.h +++ b/WebCore/html/FileThreadTask.h @@ -57,10 +57,11 @@ template<typename T> struct FileThreadTaskTraits<PassOwnPtr<T> > { typedef PassOwnPtr<T> ParamType; }; +template<typename R> class FileThreadTask0 : public FileThread::Task { public: - typedef void (FileStream::*Method)(); - typedef FileThreadTask0 FileThreadTask; + typedef R (FileStream::*Method)(); + typedef FileThreadTask0<R> FileThreadTask; static PassOwnPtr<FileThreadTask> create(FileStream* stream, Method method) { @@ -83,11 +84,11 @@ private: Method m_method; }; -template<typename P1, typename MP1> +template<typename R, typename P1, typename MP1> class FileThreadTask1 : public FileThread::Task { public: - typedef void (FileStream::*Method)(MP1); - typedef FileThreadTask1<P1, MP1> FileThreadTask; + typedef R (FileStream::*Method)(MP1); + typedef FileThreadTask1<R, P1, MP1> FileThreadTask; typedef typename FileThreadTaskTraits<P1>::ParamType Param1; static PassOwnPtr<FileThreadTask> create(FileStream* stream, Method method, Param1 parameter1) @@ -113,11 +114,11 @@ private: P1 m_parameter1; }; -template<typename P1, typename MP1, typename P2, typename MP2> +template<typename R, typename P1, typename MP1, typename P2, typename MP2> class FileThreadTask2 : public FileThread::Task { public: - typedef void (FileStream::*Method)(MP1, MP2); - typedef FileThreadTask2<P1, MP1, P2, MP2> FileThreadTask; + typedef R (FileStream::*Method)(MP1, MP2); + typedef FileThreadTask2<R, P1, MP1, P2, MP2> FileThreadTask; typedef typename FileThreadTaskTraits<P1>::ParamType Param1; typedef typename FileThreadTaskTraits<P2>::ParamType Param2; @@ -146,11 +147,11 @@ private: P2 m_parameter2; }; -template<typename P1, typename MP1, typename P2, typename MP2, typename P3, typename MP3> +template<typename R, typename P1, typename MP1, typename P2, typename MP2, typename P3, typename MP3> class FileThreadTask3 : public FileThread::Task { public: - typedef void (FileStream::*Method)(MP1, MP2, MP3); - typedef FileThreadTask3<P1, MP1, P2, MP2, P3, MP3> FileThreadTask; + typedef R (FileStream::*Method)(MP1, MP2, MP3); + typedef FileThreadTask3<R, P1, MP1, P2, MP2, P3, MP3> FileThreadTask; typedef typename FileThreadTaskTraits<P1>::ParamType Param1; typedef typename FileThreadTaskTraits<P2>::ParamType Param2; typedef typename FileThreadTaskTraits<P3>::ParamType Param3; @@ -182,54 +183,56 @@ private: P3 m_parameter3; }; +template<typename R> PassOwnPtr<FileThread::Task> createFileThreadTask( FileStream* const callee, - void (FileStream::*method)()); + R (FileStream::*method)()); +template<typename R> PassOwnPtr<FileThread::Task> createFileThreadTask( FileStream* const callee, - void (FileStream::*method)()) + R (FileStream::*method)()) { - return FileThreadTask0::create( + return FileThreadTask0<R>::create( callee, method); } -template<typename P1, typename MP1> +template<typename R, typename P1, typename MP1> PassOwnPtr<FileThread::Task> createFileThreadTask( FileStream* const callee, - void (FileStream::*method)(MP1), + R (FileStream::*method)(MP1), const P1& parameter1) { - return FileThreadTask1<typename CrossThreadCopier<P1>::Type, MP1>::create( + return FileThreadTask1<R, typename CrossThreadCopier<P1>::Type, MP1>::create( callee, method, CrossThreadCopier<P1>::copy(parameter1)); } -template<typename P1, typename MP1, typename P2, typename MP2> +template<typename R, typename P1, typename MP1, typename P2, typename MP2> PassOwnPtr<FileThread::Task> createFileThreadTask( FileStream* const callee, - void (FileStream::*method)(MP1, MP2), + R (FileStream::*method)(MP1, MP2), const P1& parameter1, const P2& parameter2) { - return FileThreadTask2<typename CrossThreadCopier<P1>::Type, MP1, typename CrossThreadCopier<P2>::Type, MP2>::create( + return FileThreadTask2<R, typename CrossThreadCopier<P1>::Type, MP1, typename CrossThreadCopier<P2>::Type, MP2>::create( callee, method, CrossThreadCopier<P1>::copy(parameter1), CrossThreadCopier<P2>::copy(parameter2)); } -template<typename P1, typename MP1, typename P2, typename MP2, typename P3, typename MP3> +template<typename R, typename P1, typename MP1, typename P2, typename MP2, typename P3, typename MP3> PassOwnPtr<FileThread::Task> createFileThreadTask( FileStream* const callee, - void (FileStream::*method)(MP1, MP2, MP3), + R (FileStream::*method)(MP1, MP2, MP3), const P1& parameter1, const P2& parameter2, const P3& parameter3) { - return FileThreadTask3<typename CrossThreadCopier<P1>::Type, MP1, typename CrossThreadCopier<P2>::Type, MP2, typename CrossThreadCopier<P3>::Type, MP3>::create( + return FileThreadTask3<R, typename CrossThreadCopier<P1>::Type, MP1, typename CrossThreadCopier<P2>::Type, MP2, typename CrossThreadCopier<P3>::Type, MP3>::create( callee, method, CrossThreadCopier<P1>::copy(parameter1), diff --git a/WebCore/html/HTMLConstructionSite.cpp b/WebCore/html/HTMLConstructionSite.cpp index e9bb762..0b17086 100644 --- a/WebCore/html/HTMLConstructionSite.cpp +++ b/WebCore/html/HTMLConstructionSite.cpp @@ -103,10 +103,8 @@ PassRefPtr<ChildType> HTMLConstructionSite::attach(Node* parent, PassRefPtr<Chil // |parent| to hold a ref at this point. In the common case (at least // for elements), however, we'll get to use this ref in the stack of // open elements. - if (parent->attached()) { - ASSERT(!child->attached()); + if (parent->attached() && !child->attached()) child->attach(); - } return child.release(); } diff --git a/WebCore/html/HTMLDocumentParser.cpp b/WebCore/html/HTMLDocumentParser.cpp index 0c9f676..4c5c273 100644 --- a/WebCore/html/HTMLDocumentParser.cpp +++ b/WebCore/html/HTMLDocumentParser.cpp @@ -217,11 +217,17 @@ void HTMLDocumentParser::didPumpLexer() #endif } +bool HTMLDocumentParser::hasInsertionPoint() +{ + return m_input.hasInsertionPoint(); +} + void HTMLDocumentParser::insert(const SegmentedString& source) { if (m_parserStopped) return; +<<<<<<< HEAD if (m_scriptRunner && !m_scriptRunner->inScriptExecution() && m_input.haveSeenEndOfFile()) { // document.write was called without a current insertion point. // According to the spec, we're supposed to implicitly open the @@ -236,6 +242,8 @@ void HTMLDocumentParser::insert(const SegmentedString& source) android::TimeCounter::start(android::TimeCounter::ParsingTimeCounter); #endif +======= +>>>>>>> webkit.org at r64264 { NestingLevelIncrementer nestingLevelIncrementer(m_writeNestingLevel); @@ -337,7 +345,7 @@ bool HTMLDocumentParser::inScriptExecution() const { if (!m_scriptRunner) return false; - return m_scriptRunner->inScriptExecution(); + return m_scriptRunner->isExecutingScript(); } int HTMLDocumentParser::lineNumber() const @@ -415,7 +423,7 @@ void HTMLDocumentParser::executeScriptsWaitingForStylesheets() // is a re-entrant call from encountering a </ style> tag. if (!m_scriptRunner->hasScriptsWaitingForStylesheets()) return; - ASSERT(!m_scriptRunner->inScriptExecution()); + ASSERT(!m_scriptRunner->isExecutingScript()); ASSERT(m_treeBuilder->isPaused()); // Note: We only ever wait on one script at a time, so we always know this // is the one we were waiting on and can un-pause the tree builder. diff --git a/WebCore/html/HTMLDocumentParser.h b/WebCore/html/HTMLDocumentParser.h index b2a65ca..cc46d31 100644 --- a/WebCore/html/HTMLDocumentParser.h +++ b/WebCore/html/HTMLDocumentParser.h @@ -64,6 +64,7 @@ public: private: // DocumentParser + virtual bool hasInsertionPoint(); virtual void insert(const SegmentedString&); virtual void append(const SegmentedString&); virtual void finish(); diff --git a/WebCore/html/HTMLElement.cpp b/WebCore/html/HTMLElement.cpp index 8985407..fb1bcc2 100644 --- a/WebCore/html/HTMLElement.cpp +++ b/WebCore/html/HTMLElement.cpp @@ -788,8 +788,21 @@ bool HTMLElement::isRecognizedTagName(const QualifiedName& tagName) if (tagList.isEmpty()) { size_t tagCount = 0; WebCore::QualifiedName** tags = HTMLNames::getHTMLTags(&tagCount); - for (size_t i = 0; i < tagCount; i++) + for (size_t i = 0; i < tagCount; i++) { + if (*tags[i] == bgsoundTag + || *tags[i] == commandTag + || *tags[i] == detailsTag + || *tags[i] == figcaptionTag + || *tags[i] == figureTag + || *tags[i] == summaryTag + || *tags[i] == trackTag) { + // Even though we have atoms for these tags, we don't want to + // treat them as "recognized tags" for the purpose of parsing + // because that changes how we parse documents. + continue; + } tagList.add(tags[i]->localName().impl()); + } } return tagList.contains(tagName.localName().impl()); } diff --git a/WebCore/html/HTMLElementStack.cpp b/WebCore/html/HTMLElementStack.cpp index 5c325e5..531a3b4 100644 --- a/WebCore/html/HTMLElementStack.cpp +++ b/WebCore/html/HTMLElementStack.cpp @@ -40,10 +40,19 @@ using namespace HTMLNames; namespace { +inline bool isNumberedHeaderElement(Element* element) +{ + return element->hasTagName(h1Tag) + || element->hasTagName(h2Tag) + || element->hasTagName(h3Tag) + || element->hasTagName(h4Tag) + || element->hasTagName(h5Tag) + || element->hasTagName(h6Tag); +} + inline bool isScopeMarker(Element* element) { return element->hasTagName(appletTag) - || element->hasTagName(buttonTag) || element->hasTagName(captionTag) #if ENABLE(SVG_FOREIGN_OBJECT) || element->hasTagName(SVGNames::foreignObjectTag) @@ -83,6 +92,12 @@ inline bool isTableRowScopeMarker(Element* element) || element->hasTagName(htmlTag); } +inline bool isButtonScopeMarker(Element* element) +{ + return isScopeMarker(element) + || element->hasTagName(buttonTag); +} + } HTMLElementStack::ElementRecord::ElementRecord(PassRefPtr<Element> element, PassOwnPtr<ElementRecord> next) @@ -175,6 +190,13 @@ void HTMLElementStack::popUntilPopped(const AtomicString& tagName) pop(); } +void HTMLElementStack::popUntilNumberedHeaderElementPopped() +{ + while (!isNumberedHeaderElement(top())) + pop(); + pop(); +} + void HTMLElementStack::popUntil(Element* element) { while (top() != element) @@ -273,12 +295,6 @@ HTMLElementStack::ElementRecord* HTMLElementStack::topRecord() const return m_top.get(); } -Element* HTMLElementStack::top() const -{ - ASSERT(m_top->element()); - return m_top->element(); -} - Element* HTMLElementStack::oneBelowTop() const { // We should never be calling this if it could be 0. @@ -368,6 +384,19 @@ bool HTMLElementStack::hasOnlyHTMLElementsInScope() const return true; } +bool HTMLElementStack::hasNumberedHeaderElementInScope() const +{ + for (ElementRecord* record = m_top.get(); record; record = record->next()) { + Element* element = record->element(); + if (isNumberedHeaderElement(element)) + return true; + if (isScopeMarker(element)) + return false; + } + ASSERT_NOT_REACHED(); // <html> is always on the stack and is a scope marker. + return false; +} + bool HTMLElementStack::inScope(Element* targetElement) const { for (ElementRecord* pos = m_top.get(); pos; pos = pos->next()) { @@ -414,6 +443,17 @@ bool HTMLElementStack::inTableScope(const QualifiedName& tagName) const return inTableScope(tagName.localName()); } +bool HTMLElementStack::inButtonScope(const AtomicString& targetTag) const +{ + return inScopeCommon<isButtonScopeMarker>(m_top.get(), targetTag); +} + +bool HTMLElementStack::inButtonScope(const QualifiedName& tagName) const +{ + // FIXME: Is localName() right for non-html elements? + return inButtonScope(tagName.localName()); +} + Element* HTMLElementStack::htmlElement() const { ASSERT(m_htmlElement); diff --git a/WebCore/html/HTMLElementStack.h b/WebCore/html/HTMLElementStack.h index 830faf0..62d031f 100644 --- a/WebCore/html/HTMLElementStack.h +++ b/WebCore/html/HTMLElementStack.h @@ -66,8 +66,15 @@ public: RefPtr<Element> m_element; OwnPtr<ElementRecord> m_next; }; - - Element* top() const; + + // Inlining this function is a (small) performance win on the parsing + // benchmark. + Element* top() const + { + ASSERT(m_top->element()); + return m_top->element(); + } + Element* oneBelowTop() const; ElementRecord* topRecord() const; Element* bottom() const; @@ -87,6 +94,7 @@ public: void popUntil(Element*); void popUntilPopped(const AtomicString& tagName); void popUntilPopped(Element*); + void popUntilNumberedHeaderElementPopped(); void popUntilTableScopeMarker(); // "clear the stack back to a table context" in the spec. void popUntilTableBodyScopeMarker(); // "clear the stack back to a table body context" in the spec. void popUntilTableRowScopeMarker(); // "clear the stack back to a table row context" in the spec. @@ -107,8 +115,11 @@ public: bool inListItemScope(const QualifiedName&) const; bool inTableScope(const AtomicString& tagName) const; bool inTableScope(const QualifiedName&) const; + bool inButtonScope(const AtomicString& tagName) const; + bool inButtonScope(const QualifiedName&) const; bool hasOnlyHTMLElementsInScope() const; + bool hasNumberedHeaderElementInScope() const; Element* htmlElement() const; Element* headElement() const; diff --git a/WebCore/html/HTMLFormElement.cpp b/WebCore/html/HTMLFormElement.cpp index 4d6b603..d75de01 100644 --- a/WebCore/html/HTMLFormElement.cpp +++ b/WebCore/html/HTMLFormElement.cpp @@ -36,7 +36,6 @@ #include "FormData.h" #include "FormDataList.h" #include "FormState.h" -#include "FormSubmission.h" #include "Frame.h" #include "FrameLoader.h" #include "FrameLoaderClient.h" @@ -46,12 +45,12 @@ #include "HTMLInputElement.h" #include "HTMLNames.h" #include "MIMETypeRegistry.h" +#include "Page.h" #include "RenderTextControl.h" #include "ScriptEventListener.h" +#include "Settings.h" #include "ValidityState.h" #include <limits> -#include <wtf/CurrentTime.h> -#include <wtf/RandomNumber.h> #if PLATFORM(WX) #include <wx/defs.h> @@ -64,14 +63,6 @@ namespace WebCore { using namespace HTMLNames; -static int64_t generateFormDataIdentifier() -{ - // Initialize to the current time to reduce the likelihood of generating - // identifiers that overlap with those from past/future browser sessions. - static int64_t nextIdentifier = static_cast<int64_t>(currentTime() * 1000000.0); - return ++nextIdentifier; -} - HTMLFormElement::HTMLFormElement(const QualifiedName& tagName, Document* document) : HTMLElement(tagName, document) , m_submissionTrigger(NotSubmittedByJavaScript) @@ -193,79 +184,6 @@ void HTMLFormElement::submitImplicitly(Event* event, bool fromImplicitSubmission prepareSubmit(event); } -static void appendMailtoPostFormDataToURL(KURL& url, const FormData& data, const String& encodingType) -{ - String body = data.flattenToString(); - - if (equalIgnoringCase(encodingType, "text/plain")) { - // Convention seems to be to decode, and s/&/\r\n/. Also, spaces are encoded as %20. - body = decodeURLEscapeSequences(body.replace('&', "\r\n").replace('+', ' ') + "\r\n"); - } - - Vector<char> bodyData; - bodyData.append("body=", 5); - FormDataBuilder::encodeStringAsFormData(bodyData, body.utf8()); - body = String(bodyData.data(), bodyData.size()).replace('+', "%20"); - - String query = url.query(); - if (!query.isEmpty()) - query.append('&'); - query.append(body); - url.setQuery(query); -} - -PassRefPtr<FormSubmission> HTMLFormElement::prepareFormSubmission(Event* event, bool lockHistory, FormSubmissionTrigger trigger) -{ - KURL actionURL = document()->completeURL(m_formDataBuilder.action().isEmpty() ? document()->url().string() : m_formDataBuilder.action()); - bool isMailtoForm = actionURL.protocolIs("mailto"); - - if (m_formDataBuilder.isPostMethod()) { - if (m_formDataBuilder.isMultiPartForm() && isMailtoForm) { - m_formDataBuilder.parseEncodingType("application/x-www-form-urlencoded"); - ASSERT(!m_formDataBuilder.isMultiPartForm()); - } - } else - m_formDataBuilder.setIsMultiPartForm(false); - - TextEncoding dataEncoding = isMailtoForm ? UTF8Encoding() : m_formDataBuilder.dataEncoding(document()); - RefPtr<DOMFormData> domFormData = DOMFormData::create(dataEncoding.encodingForFormSubmission()); - Vector<pair<String, String> > formValues; - - for (unsigned i = 0; i < m_associatedElements.size(); ++i) { - HTMLFormControlElement* control = m_associatedElements[i]; - if (!control->disabled()) - control->appendFormData(*domFormData, m_formDataBuilder.isMultiPartForm()); - if (control->hasLocalName(inputTag)) { - HTMLInputElement* input = static_cast<HTMLInputElement*>(control); - if (input->isTextField()) { - formValues.append(pair<String, String>(input->name(), input->value())); - if (input->isSearchField()) - input->addSearchResult(); - } - } - } - - RefPtr<FormData> formData; - String boundary; - - if (m_formDataBuilder.isMultiPartForm()) { - formData = FormData::createMultiPart(domFormData->items(), domFormData->encoding(), document()); - boundary = formData->boundary().data(); - } else { - formData = FormData::create(domFormData->items(), domFormData->encoding()); - if (m_formDataBuilder.isPostMethod() && isMailtoForm) { - // Convert the form data into a string that we put into the URL. - appendMailtoPostFormDataToURL(actionURL, *formData, m_formDataBuilder.encodingType()); - formData = FormData::create(); - } - } - - formData->setIdentifier(generateFormDataIdentifier()); - FormSubmission::Method method = m_formDataBuilder.isPostMethod() ? FormSubmission::PostMethod : FormSubmission::GetMethod; - String targetOrBaseTarget = m_formDataBuilder.target().isEmpty() ? document()->baseTarget() : m_formDataBuilder.target(); - return FormSubmission::create(method, actionURL, targetOrBaseTarget, m_formDataBuilder.encodingType(), FormState::create(this, formValues, document()->frame(), trigger), formData.release(), boundary, lockHistory, event); -} - static inline HTMLFormControlElement* submitElementFromEvent(const Event* event) { Node* targetNode = event->target()->toNode(); @@ -280,7 +198,7 @@ static inline HTMLFormControlElement* submitElementFromEvent(const Event* event) bool HTMLFormElement::validateInteractively(Event* event) { ASSERT(event); - if (!document()->inStrictMode() || noValidate()) + if (!document()->page() || !document()->page()->settings()->interactiveFormValidationEnabled() || noValidate()) return true; HTMLFormControlElement* submitElement = submitElementFromEvent(event); @@ -389,7 +307,7 @@ void HTMLFormElement::submit(Event* event, bool activateSubmitButton, bool lockH if (needButtonActivation && firstSuccessfulSubmitButton) firstSuccessfulSubmitButton->setActivatedSubmit(true); - frame->loader()->submitForm(prepareFormSubmission(event, lockHistory, formSubmissionTrigger)); + frame->loader()->submitForm(FormSubmission::create(this, m_attributes, event, lockHistory, formSubmissionTrigger)); if (needButtonActivation && firstSuccessfulSubmitButton) firstSuccessfulSubmitButton->setActivatedSubmit(false); @@ -421,17 +339,17 @@ void HTMLFormElement::reset() void HTMLFormElement::parseMappedAttribute(Attribute* attr) { if (attr->name() == actionAttr) - m_formDataBuilder.parseAction(attr->value()); + m_attributes.parseAction(attr->value()); else if (attr->name() == targetAttr) - m_formDataBuilder.setTarget(attr->value()); + m_attributes.setTarget(attr->value()); else if (attr->name() == methodAttr) - m_formDataBuilder.parseMethodType(attr->value()); + m_attributes.parseMethodType(attr->value()); else if (attr->name() == enctypeAttr) - m_formDataBuilder.parseEncodingType(attr->value()); + m_attributes.parseEncodingType(attr->value()); else if (attr->name() == accept_charsetAttr) // space separated list of charsets the server // accepts - see rfc2045 - m_formDataBuilder.setAcceptCharset(attr->value()); + m_attributes.setAcceptCharset(attr->value()); else if (attr->name() == acceptAttr) { // ignore this one for the moment... } else if (attr->name() == autocompleteAttr) { diff --git a/WebCore/html/HTMLFormElement.h b/WebCore/html/HTMLFormElement.h index 5aa9a5c..c9fb9ac 100644 --- a/WebCore/html/HTMLFormElement.h +++ b/WebCore/html/HTMLFormElement.h @@ -25,8 +25,8 @@ #define HTMLFormElement_h #include "CheckedRadioButtons.h" -#include "FormDataBuilder.h" #include "FormState.h" +#include "FormSubmission.h" #include "HTMLElement.h" #include <wtf/OwnPtr.h> @@ -34,7 +34,6 @@ namespace WebCore { class Event; class FormData; -class FormSubmission; class HTMLFormControlElement; class HTMLImageElement; class HTMLInputElement; @@ -55,10 +54,10 @@ public: unsigned length() const; Node* item(unsigned index); - String enctype() const { return m_formDataBuilder.encodingType(); } + String enctype() const { return m_attributes.encodingType(); } void setEnctype(const String&); - String encoding() const { return m_formDataBuilder.encodingType(); } + String encoding() const { return m_attributes.encodingType(); } void setEncoding(const String& value) { setEnctype(value); } bool autoComplete() const { return m_autocomplete; } @@ -88,7 +87,8 @@ public: bool noValidate() const; - String acceptCharset() const { return m_formDataBuilder.acceptCharset(); } + String acceptCharset() const { return m_attributes.acceptCharset(); } + void setAcceptCharset(const String&); String action() const; void setAction(const String&); @@ -134,7 +134,6 @@ private: void submit(Event*, bool activateSubmitButton, bool lockHistory, FormSubmissionTrigger); - PassRefPtr<FormSubmission> prepareFormSubmission(Event*, bool lockHistory, FormSubmissionTrigger); unsigned formElementIndex(HTMLFormControlElement*); // Returns true if the submission should be proceeded. bool validateInteractively(Event*); @@ -146,7 +145,7 @@ private: typedef HashMap<RefPtr<AtomicStringImpl>, RefPtr<HTMLFormControlElement> > AliasMap; - FormDataBuilder m_formDataBuilder; + FormSubmission::Attributes m_attributes; OwnPtr<AliasMap> m_elementAliases; OwnPtr<CollectionCache> m_collectionCache; diff --git a/WebCore/html/HTMLInputElement.cpp b/WebCore/html/HTMLInputElement.cpp index 49b6f01..f4528c2 100644 --- a/WebCore/html/HTMLInputElement.cpp +++ b/WebCore/html/HTMLInputElement.cpp @@ -113,7 +113,7 @@ static const double msecPerSecond = 1000; static bool isNumberCharacter(UChar ch) { return ch == '+' || ch == '-' || ch == '.' || ch == 'e' || ch == 'E' - || ch >= '0' && ch <= '9'; + || (ch >= '0' && ch <= '9'); } HTMLInputElement::HTMLInputElement(const QualifiedName& tagName, Document* document, HTMLFormElement* form) @@ -250,87 +250,34 @@ bool HTMLInputElement::valueMissing() const bool HTMLInputElement::patternMismatch() const { - switch (inputType()) { - case BUTTON: - case CHECKBOX: - case COLOR: - case DATE: - case DATETIME: - case DATETIMELOCAL: - case FILE: - case HIDDEN: - case IMAGE: - case ISINDEX: - case MONTH: - case NUMBER: - case RADIO: - case RANGE: - case RESET: - case SUBMIT: - case TIME: - case WEEK: + if (!isTextType()) return false; - case EMAIL: - case PASSWORD: - case SEARCH: - case TELEPHONE: - case TEXT: - case URL: - const AtomicString& pattern = getAttribute(patternAttr); - String value = this->value(); - // Empty values can't be mismatched - if (pattern.isEmpty() || value.isEmpty()) - return false; - RegularExpression patternRegExp(pattern, TextCaseSensitive); - int matchLength = 0; - int valueLength = value.length(); - int matchOffset = patternRegExp.match(value, 0, &matchLength); - return matchOffset || matchLength != valueLength; - } - ASSERT_NOT_REACHED(); - return false; + const AtomicString& pattern = getAttribute(patternAttr); + String value = this->value(); + // Empty values can't be mismatched + if (pattern.isEmpty() || value.isEmpty()) + return false; + RegularExpression patternRegExp(pattern, TextCaseSensitive); + int matchLength = 0; + int valueLength = value.length(); + int matchOffset = patternRegExp.match(value, 0, &matchLength); + return matchOffset || matchLength != valueLength; } bool HTMLInputElement::tooLong() const { - switch (inputType()) { - case EMAIL: - case PASSWORD: - case SEARCH: - case TELEPHONE: - case TEXT: - case URL: { - int max = maxLength(); - if (max < 0) - return false; - // Return false for the default value even if it is longer than maxLength. - bool userEdited = !m_data.value().isNull(); - if (!userEdited) - return false; - return numGraphemeClusters(value()) > static_cast<unsigned>(max); - } - case BUTTON: - case CHECKBOX: - case COLOR: - case DATE: - case DATETIME: - case DATETIMELOCAL: - case FILE: - case HIDDEN: - case IMAGE: - case ISINDEX: - case MONTH: - case NUMBER: - case RADIO: - case RANGE: - case RESET: - case SUBMIT: - case TIME: - case WEEK: + // We use isTextType() instead of supportsMaxLength() because of the + // 'virtual' overhead. + if (!isTextType()) return false; - } - ASSERT_NOT_REACHED(); - return false; + int max = maxLength(); + if (max < 0) + return false; + // Return false for the default value even if it is longer than maxLength. + bool userEdited = !m_data.value().isNull(); + if (!userEdited) + return false; + return numGraphemeClusters(value()) > static_cast<unsigned>(max); } bool HTMLInputElement::rangeUnderflow() const @@ -1402,7 +1349,7 @@ bool HTMLInputElement::appendFormData(FormDataList& encoding, bool multipart) // If no filename at all is entered, return successful but empty. // Null would be more logical, but Netscape posts an empty file. Argh. if (!numFiles) { - encoding.appendBlob(name(), File::create("")); + encoding.appendBlob(name(), File::create(document()->scriptExecutionContext(), "")); return true; } @@ -1457,6 +1404,40 @@ bool HTMLInputElement::isTextField() const return false; } +bool HTMLInputElement::isTextType() const +{ + switch (inputType()) { + case EMAIL: + case PASSWORD: + case SEARCH: + case TELEPHONE: + case TEXT: + case URL: + return true; + case BUTTON: + case CHECKBOX: + case COLOR: + case DATE: + case DATETIME: + case DATETIMELOCAL: + case FILE: + case HIDDEN: + case IMAGE: + case ISINDEX: + case MONTH: + case NUMBER: + case RADIO: + case RANGE: + case RESET: + case SUBMIT: + case TIME: + case WEEK: + return false; + } + ASSERT_NOT_REACHED(); + return false; +} + void HTMLInputElement::setChecked(bool nowChecked, bool sendChangeEvent) { if (checked() == nowChecked) @@ -2007,15 +1988,18 @@ void HTMLInputElement::setFileListFromRenderer(const Vector<String>& paths) } rootPath = directoryName(rootPath); ASSERT(rootPath.length()); - for (int i = 0; i < size; i++) - m_fileList->append(File::create(paths[i].substring(1 + rootPath.length()), paths[i])); + for (int i = 0; i < size; i++) { + // Normalize backslashes to slashes before exposing the relative path to script. + String relativePath = paths[i].substring(1 + rootPath.length()).replace('\\','/'); + m_fileList->append(File::create(document()->scriptExecutionContext(), relativePath, paths[i])); + } } else { for (int i = 0; i < size; i++) - m_fileList->append(File::create(paths[i])); + m_fileList->append(File::create(document()->scriptExecutionContext(), paths[i])); } #else for (int i = 0; i < size; i++) - m_fileList->append(File::create(paths[i])); + m_fileList->append(File::create(document()->scriptExecutionContext(), paths[i])); #endif setFormControlValueMatchesRenderer(true); @@ -2574,7 +2558,7 @@ FileList* HTMLInputElement::files() String HTMLInputElement::sanitizeValue(const String& proposedValue) const { if (isTextField()) - return InputElement::sanitizeValue(this, proposedValue); + return InputElement::sanitizeValueForTextField(this, proposedValue); // If the proposedValue is null than this is a reset scenario and we // want the range input's value attribute to take priority over the @@ -2843,13 +2827,20 @@ void HTMLInputElement::stepUpFromRenderer(int n) return; const double nan = numeric_limits<double>::quiet_NaN(); - double current = parseToDouble(value(), nan); - if (!isfinite(current)) { + String currentStringValue = value(); + double current = parseToDouble(currentStringValue, nan); + if (!isfinite(current)) setValue(serialize(n > 0 ? minimum() : maximum())); - return; + else { + ExceptionCode ec; + stepUp(n, ec); + } + + if (currentStringValue != value()) { + if (renderer() && renderer()->isTextField()) + toRenderTextControl(renderer())->setChangedSinceLastChangeEvent(true); + dispatchEvent(Event::create(eventNames().inputEvent, true, false)); } - ExceptionCode ec; - stepUp(n, ec); } #if ENABLE(WCSS) diff --git a/WebCore/html/HTMLInputElement.h b/WebCore/html/HTMLInputElement.h index 3b9ba88..72ac589 100644 --- a/WebCore/html/HTMLInputElement.h +++ b/WebCore/html/HTMLInputElement.h @@ -290,7 +290,10 @@ private: void registerForActivationCallbackIfNeeded(); void unregisterForActivationCallbackIfNeeded(); - virtual bool supportsPlaceholder() const { return isTextField(); } + virtual bool supportsMaxLength() const { return isTextType(); } + bool isTextType() const; + + virtual bool supportsPlaceholder() const { return isTextType() || inputType() == ISINDEX; } virtual bool isEmptyValue() const { return value().isEmpty(); } virtual void handleFocusEvent(); virtual void handleBlurEvent(); diff --git a/WebCore/html/HTMLInputStream.h b/WebCore/html/HTMLInputStream.h index d7c1c9c..a709bd9 100644 --- a/WebCore/html/HTMLInputStream.h +++ b/WebCore/html/HTMLInputStream.h @@ -64,6 +64,21 @@ public: m_first.append(string); } + bool hasInsertionPoint() const + { + if (&m_first != m_last) + return true; + if (!haveSeenEndOfFile()) { + // FIXME: Somehow we need to understand the difference between + // input streams that are coming off the network and streams that + // were created with document.open(). In the later case, we always + // have an isertion point at the end of the stream until someone + // calls document.close(). + return true; + } + return false; + } + void markEndOfFile() { // FIXME: This should use InputStreamPreprocessor::endOfFileMarker @@ -73,7 +88,7 @@ public: m_last->close(); } - bool haveSeenEndOfFile() + bool haveSeenEndOfFile() const { return m_last->isClosed(); } diff --git a/WebCore/html/HTMLLinkElement.cpp b/WebCore/html/HTMLLinkElement.cpp index c1623ec..a638572 100644 --- a/WebCore/html/HTMLLinkElement.cpp +++ b/WebCore/html/HTMLLinkElement.cpp @@ -276,8 +276,13 @@ void HTMLLinkElement::insertedIntoDocument() // to fire, it is possible for JavaScript to remove the element in the midst // of it being inserted into the DOM, which can lead to assertion failures // and crashes. Avoid this by postponing the beforeload/load until after - // attach. - m_shouldProcessAfterAttach = true; + // attach if there are beforeload listeners. + if (document()->hasListenerType(Document::BEFORELOAD_LISTENER)) { + m_shouldProcessAfterAttach = true; + return; + } + + process(); } void HTMLLinkElement::removedFromDocument() diff --git a/WebCore/html/HTMLMediaElement.cpp b/WebCore/html/HTMLMediaElement.cpp index bf24cf9..ad465bb 100644 --- a/WebCore/html/HTMLMediaElement.cpp +++ b/WebCore/html/HTMLMediaElement.cpp @@ -304,7 +304,7 @@ RenderObject* HTMLMediaElement::createRenderer(RenderArena* arena, RenderStyle*) void HTMLMediaElement::insertedIntoDocument() { HTMLElement::insertedIntoDocument(); - if (!src().isEmpty() && m_networkState == NETWORK_EMPTY) + if (!getAttribute(srcAttr).isEmpty() && m_networkState == NETWORK_EMPTY) scheduleLoad(); } @@ -438,11 +438,6 @@ PassRefPtr<MediaError> HTMLMediaElement::error() const return m_error; } -KURL HTMLMediaElement::src() const -{ - return getNonEmptyURLAttribute(srcAttr); -} - void HTMLMediaElement::setSrc(const String& url) { setAttribute(srcAttr, url); @@ -677,9 +672,9 @@ void HTMLMediaElement::loadResource(const KURL& initialURL, ContentType& content m_player->load(m_currentSrc, contentType); if (isVideo() && m_player->canLoadPoster()) { - KURL posterUrl = poster(); - if (!posterUrl.isEmpty()) - m_player->setPoster(posterUrl); + KURL posterURL = getNonEmptyURLAttribute(posterAttr); + if (!posterURL.isEmpty()) + m_player->setPoster(posterURL); } if (renderer()) @@ -1968,13 +1963,10 @@ void HTMLMediaElement::getPluginProxyParams(KURL& url, Vector<String>& names, Ve FrameLoader* loader = frame ? frame->loader() : 0; if (isVideo()) { - String poster = poster(); - if (!poster.isEmpty() && loader) { - KURL posterURL = loader->completeURL(poster); - if (posterURL.isValid() && loader->willLoadMediaElementURL(posterURL)) { - names.append("_media_element_poster_"); - values.append(posterURL.string()); - } + KURL posterURL = getNonEmptyURLAttribute(posterAttr); + if (!posterURL.isEmpty() && loader && loader->willLoadMediaElementURL(posterURL)) { + names.append("_media_element_poster_"); + values.append(posterURL.string()); } } diff --git a/WebCore/html/HTMLMediaElement.h b/WebCore/html/HTMLMediaElement.h index 051629e..eede363 100644 --- a/WebCore/html/HTMLMediaElement.h +++ b/WebCore/html/HTMLMediaElement.h @@ -64,7 +64,6 @@ public: // Eventually overloaded in HTMLVideoElement virtual bool supportsFullscreen() const { return false; }; - virtual const KURL poster() const { return KURL(); } virtual bool supportsSave() const; @@ -84,7 +83,6 @@ public: PassRefPtr<MediaError> error() const; // network state - KURL src() const; void setSrc(const String&); String currentSrc() const; diff --git a/WebCore/html/HTMLMediaElement.idl b/WebCore/html/HTMLMediaElement.idl index 28a0fbe..12a1464 100644 --- a/WebCore/html/HTMLMediaElement.idl +++ b/WebCore/html/HTMLMediaElement.idl @@ -30,7 +30,7 @@ interface [Conditional=VIDEO] HTMLMediaElement : HTMLElement { readonly attribute MediaError error; // network state - attribute [Reflect,NonEmpty,URL] DOMString src; + attribute [Reflect,URL] DOMString src; readonly attribute DOMString currentSrc; const unsigned short NETWORK_EMPTY = 0; diff --git a/WebCore/html/HTMLPlugInElement.cpp b/WebCore/html/HTMLPlugInElement.cpp index 7737dc4..2ce44a6 100644 --- a/WebCore/html/HTMLPlugInElement.cpp +++ b/WebCore/html/HTMLPlugInElement.cpp @@ -92,13 +92,21 @@ PassScriptInstance HTMLPlugInElement::getInstance() const if (m_instance) return m_instance; - RenderWidget* renderWidget = renderWidgetForJSBindings(); - if (renderWidget && renderWidget->widget()) - m_instance = frame->script()->createScriptInstanceForWidget(renderWidget->widget()); + if (Widget* widget = pluginWidget()) + m_instance = frame->script()->createScriptInstanceForWidget(widget); return m_instance; } +Widget* HTMLPlugInElement::pluginWidget() const +{ + RenderWidget* renderWidget = renderWidgetForJSBindings(); + if (!renderWidget) + return 0; + + return renderWidget->widget(); +} + bool HTMLPlugInElement::mapToEntry(const QualifiedName& attrName, MappedAttributeEntry& result) const { if (attrName == widthAttr || diff --git a/WebCore/html/HTMLPlugInElement.h b/WebCore/html/HTMLPlugInElement.h index e4f3474..6288e74 100644 --- a/WebCore/html/HTMLPlugInElement.h +++ b/WebCore/html/HTMLPlugInElement.h @@ -33,6 +33,7 @@ struct NPObject; namespace WebCore { class RenderWidget; +class Widget; class HTMLPlugInElement : public HTMLFrameOwnerElement { public: @@ -40,6 +41,8 @@ public: PassScriptInstance getInstance() const; + Widget* pluginWidget() const; + #if ENABLE(NETSCAPE_PLUGIN_API) NPObject* getNPObject(); #endif diff --git a/WebCore/html/HTMLScriptRunner.cpp b/WebCore/html/HTMLScriptRunner.cpp index 29790c0..f4b7013 100644 --- a/WebCore/html/HTMLScriptRunner.cpp +++ b/WebCore/html/HTMLScriptRunner.cpp @@ -154,7 +154,7 @@ void HTMLScriptRunner::executeScript(Element* element, const ScriptSourceCode& s ASSERT(scriptElement); if (!scriptElement->shouldExecuteAsJavaScript()) return; - ASSERT(inScriptExecution()); + ASSERT(isExecutingScript()); if (!m_document->frame()) return; m_document->frame()->script()->executeScript(sourceCode); diff --git a/WebCore/html/HTMLScriptRunner.h b/WebCore/html/HTMLScriptRunner.h index f93ae10..cc69443 100644 --- a/WebCore/html/HTMLScriptRunner.h +++ b/WebCore/html/HTMLScriptRunner.h @@ -53,7 +53,7 @@ public: bool hasScriptsWaitingForStylesheets() const { return m_hasScriptsWaitingForStylesheets; } bool executeScriptsWaitingForStylesheets(); - bool inScriptExecution() { return !!m_scriptNestingLevel; } + bool isExecutingScript() { return !!m_scriptNestingLevel; } private: // A container for an external script which may be loaded and executed. diff --git a/WebCore/html/HTMLSourceElement.cpp b/WebCore/html/HTMLSourceElement.cpp index 2c83fed..6c26610 100644 --- a/WebCore/html/HTMLSourceElement.cpp +++ b/WebCore/html/HTMLSourceElement.cpp @@ -62,11 +62,6 @@ void HTMLSourceElement::insertedIntoDocument() } } -KURL HTMLSourceElement::src() const -{ - return getNonEmptyURLAttribute(srcAttr); -} - void HTMLSourceElement::setSrc(const String& url) { setAttribute(srcAttr, url); diff --git a/WebCore/html/HTMLSourceElement.h b/WebCore/html/HTMLSourceElement.h index 6cca64e..20049cc 100644 --- a/WebCore/html/HTMLSourceElement.h +++ b/WebCore/html/HTMLSourceElement.h @@ -37,7 +37,6 @@ class HTMLSourceElement : public HTMLElement { public: static PassRefPtr<HTMLSourceElement> create(const QualifiedName&, Document*); - KURL src() const; String media() const; String type() const; void setSrc(const String&); diff --git a/WebCore/html/HTMLSourceElement.idl b/WebCore/html/HTMLSourceElement.idl index f7229f1..61dc4d0 100644 --- a/WebCore/html/HTMLSourceElement.idl +++ b/WebCore/html/HTMLSourceElement.idl @@ -25,7 +25,7 @@ module html { interface [Conditional=VIDEO] HTMLSourceElement : HTMLElement { - attribute [Reflect,NonEmpty,URL] DOMString src; + attribute [Reflect,URL] DOMString src; attribute DOMString type; attribute DOMString media; }; diff --git a/WebCore/html/HTMLTagNames.in b/WebCore/html/HTMLTagNames.in index 9c66a95..f844fa8 100644 --- a/WebCore/html/HTMLTagNames.in +++ b/WebCore/html/HTMLTagNames.in @@ -15,6 +15,7 @@ b interfaceName=HTMLElement base basefont interfaceName=HTMLBaseFontElement bdo interfaceName=HTMLElement +bgsound interfaceName=HTMLElement big interfaceName=HTMLElement blockquote body @@ -27,6 +28,7 @@ cite interfaceName=HTMLElement code interfaceName=HTMLElement col interfaceName=HTMLTableColElement colgroup interfaceName=HTMLTableColElement +command interfaceName=HTMLElement datagrid interfaceName=HTMLDataGridElement, conditional=DATAGRID datalist interfaceName=HTMLDataListElement, conditional=DATALIST dcell interfaceName=HTMLDataGridCellElement, conditional=DATAGRID @@ -34,6 +36,7 @@ dcol interfaceName=HTMLDataGridColElement, conditional=DATAGRID drow interfaceName=HTMLDataGridRowElement, conditional=DATAGRID dd interfaceName=HTMLElement del interfaceName=HTMLModElement +details interfaceName=HTMLElement dfn interfaceName=HTMLElement dir interfaceName=HTMLDirectoryElement div @@ -42,6 +45,8 @@ dt interfaceName=HTMLElement em interfaceName=HTMLElement embed fieldset interfaceName=HTMLFieldSetElement, constructorNeedsFormElement +figcaption interfaceName=HTMLElement +figure interfaceName=HTMLElement font footer interfaceName=HTMLElement form @@ -109,6 +114,7 @@ strike interfaceName=HTMLElement strong interfaceName=HTMLElement style constructorNeedsCreatedByParser sub interfaceName=HTMLElement +summary interfaceName=HTMLElement sup interfaceName=HTMLElement table tbody interfaceName=HTMLTableSectionElement @@ -119,6 +125,7 @@ th interfaceName=HTMLTableCellElement thead interfaceName=HTMLTableSectionElement title tr interfaceName=HTMLTableRowElement +track interfaceName=HTMLElement tt interfaceName=HTMLElement u interfaceName=HTMLElement ul interfaceName=HTMLUListElement diff --git a/WebCore/html/HTMLToken.h b/WebCore/html/HTMLToken.h index d2987f4..8465a35 100644 --- a/WebCore/html/HTMLToken.h +++ b/WebCore/html/HTMLToken.h @@ -59,6 +59,7 @@ public: void clear() { m_type = Uninitialized; + m_data.clear(); } void makeEndOfFile() @@ -72,7 +73,6 @@ public: ASSERT(character); ASSERT(m_type == Uninitialized); m_type = StartTag; - m_data.clear(); m_selfClosing = false; m_currentAttribute = 0; m_attributes.clear(); @@ -85,7 +85,6 @@ public: { ASSERT(m_type == Uninitialized); m_type = EndTag; - m_data.clear(); m_selfClosing = false; m_currentAttribute = 0; m_attributes.clear(); @@ -93,27 +92,24 @@ public: m_data.append(characters); } - void beginCharacter(UChar character) + // Starting a character token works slightly differently than starting + // other types of tokens because we want to save a per-character branch. + void ensureIsCharacterToken() { - ASSERT(character); - ASSERT(m_type == Uninitialized); + ASSERT(m_type == Uninitialized || m_type == Character); m_type = Character; - m_data.clear(); - m_data.append(character); } void beginComment() { ASSERT(m_type == Uninitialized); m_type = Comment; - m_data.clear(); } void beginDOCTYPE() { ASSERT(m_type == Uninitialized); m_type = DOCTYPE; - m_data.clear(); m_doctypeData.set(new DoctypeData()); } @@ -294,7 +290,7 @@ private: // For StartTag and EndTag bool m_selfClosing; - AttributeList m_attributes; // Old tokenizer reserves 10. + AttributeList m_attributes; // A pointer into m_attributes used during lexing. Attribute* m_currentAttribute; @@ -328,8 +324,13 @@ public: String name(iter->m_name.data(), iter->m_name.size()); String value(iter->m_value.data(), iter->m_value.size()); RefPtr<Attribute> mappedAttribute = Attribute::createMapped(name, value); - if (!m_attributes) + if (!m_attributes) { m_attributes = NamedNodeMap::create(); + // Reserving capacity here improves the parser + // benchmark. It might be worth experimenting with + // the constant to see where the optimal point is. + m_attributes->reserveInitialCapacity(10); + } m_attributes->insertAttribute(mappedAttribute.release(), false); } } diff --git a/WebCore/html/HTMLTokenizer.cpp b/WebCore/html/HTMLTokenizer.cpp index 55fd1ca..c8234e4 100644 --- a/WebCore/html/HTMLTokenizer.cpp +++ b/WebCore/html/HTMLTokenizer.cpp @@ -58,7 +58,7 @@ inline UChar toLowerCase(UChar cc) inline bool isTokenizerWhitespace(UChar cc) { - return cc == '\x09' || cc == '\x0A' || cc == '\x0C' || cc == ' '; + return cc == ' ' || cc == '\x0A' || cc == '\x09' || cc == '\x0C'; } inline void advanceStringAndASSERTIgnoringCase(SegmentedString& source, const char* expectedCharacters) @@ -1608,10 +1608,7 @@ inline bool HTMLTokenizer::isAppropriateEndTag() inline void HTMLTokenizer::bufferCharacter(UChar character) { ASSERT(character != InputStreamPreprocessor::endOfFileMarker); - if (m_token->type() != HTMLToken::Character) { - m_token->beginCharacter(character); - return; - } + m_token->ensureIsCharacterToken(); m_token->appendToCharacter(character); } diff --git a/WebCore/html/HTMLTokenizer.h b/WebCore/html/HTMLTokenizer.h index 96c2d7c..7ee9d41 100644 --- a/WebCore/html/HTMLTokenizer.h +++ b/WebCore/html/HTMLTokenizer.h @@ -149,9 +149,20 @@ private: // Returns whether we succeeded in peeking at the next character. // The only way we can fail to peek is if there are no more // characters in |source| (after collapsing \r\n, etc). - bool peek(SegmentedString& source, int& lineNumber) + ALWAYS_INLINE bool peek(SegmentedString& source, int& lineNumber) { m_nextInputCharacter = *source; + + // Every branch in this function is expensive, so we have a + // fast-reject branch for characters that don't require special + // handling. Please run the parser benchmark whenever you touch + // this function. It's very hot. + static const UChar specialCharacterMask = '\n' | '\r' | '\0'; + if (m_nextInputCharacter & ~specialCharacterMask) { + m_skipNextNewLine = false; + return true; + } + if (m_nextInputCharacter == '\n' && m_skipNextNewLine) { m_skipNextNewLine = false; source.advancePastNewline(lineNumber); diff --git a/WebCore/html/HTMLTreeBuilder.cpp b/WebCore/html/HTMLTreeBuilder.cpp index 93da3f7..ec15f9f 100644 --- a/WebCore/html/HTMLTreeBuilder.cpp +++ b/WebCore/html/HTMLTreeBuilder.cpp @@ -119,7 +119,7 @@ bool isSpecialTag(const AtomicString& tagName) || tagName == asideTag || tagName == baseTag || tagName == basefontTag - || tagName == "bgsound" + || tagName == bgsoundTag || tagName == blockquoteTag || tagName == bodyTag || tagName == brTag @@ -127,16 +127,16 @@ bool isSpecialTag(const AtomicString& tagName) || tagName == centerTag || tagName == colTag || tagName == colgroupTag - || tagName == "command" + || tagName == commandTag || tagName == ddTag - || tagName == "details" + || tagName == detailsTag || tagName == dirTag || tagName == divTag || tagName == dlTag || tagName == dtTag || tagName == embedTag || tagName == fieldsetTag - || tagName == "figure" + || tagName == figureTag || tagName == footerTag || tagName == formTag || tagName == frameTag @@ -183,7 +183,6 @@ bool isSpecialTag(const AtomicString& tagName) bool isScopingTag(const AtomicString& tagName) { return tagName == appletTag - || tagName == buttonTag || tagName == captionTag || tagName == SVGNames::foreignObjectTag || tagName == htmlTag @@ -393,27 +392,6 @@ static void convertToOldStyle(AtomicHTMLToken& token, Token& oldStyleToken) } } -void HTMLTreeBuilder::handleScriptStartTag() -{ - notImplemented(); // The HTML frgment case? - m_tokenizer->setState(HTMLTokenizer::ScriptDataState); - notImplemented(); // Save insertion mode. -} - -void HTMLTreeBuilder::handleScriptEndTag(Element* scriptElement, int scriptStartLine) -{ - ASSERT(!m_scriptToProcess); // Caller never called takeScriptToProcess! - ASSERT(m_scriptToProcessStartLine == uninitializedLineNumberValue); // Caller never called takeScriptToProcess! - notImplemented(); // Save insertion mode and insertion point? - - // Pause ourselves so that parsing stops until the script can be processed by the caller. - m_isPaused = true; - m_scriptToProcess = scriptElement; - // Lexer line numbers are 0-based, ScriptSourceCode expects 1-based lines, - // so we convert here before passing the line number off to HTMLScriptRunner. - m_scriptToProcessStartLine = scriptStartLine + 1; -} - PassRefPtr<Element> HTMLTreeBuilder::takeScriptToProcess(int& scriptStartLine) { // Unpause ourselves, callers may pause us again when processing the script. @@ -471,7 +449,7 @@ void HTMLTreeBuilder::passTokenToLegacyParser(HTMLToken& token) // This work is supposed to be done by the parser, but // when using the old parser for we have to do this manually. if (oldStyleToken.tagName == scriptTag) { - handleScriptStartTag(); + m_tokenizer->setState(HTMLTokenizer::ScriptDataState); m_lastScriptElement = static_pointer_cast<Element>(result); m_lastScriptElementStartLine = m_tokenizer->lineNumber(); } else if (oldStyleToken.tagName == preTag || oldStyleToken.tagName == listingTag) @@ -488,8 +466,16 @@ void HTMLTreeBuilder::passTokenToLegacyParser(HTMLToken& token) // a DocumentFragment for pasting so that javascript content // does not show up in pasted HTML. m_lastScriptElement->removeChildren(); - } else if (insertionMode() != AfterFramesetMode) - handleScriptEndTag(m_lastScriptElement.get(), m_lastScriptElementStartLine); + } else if (insertionMode() != AfterFramesetMode) { + ASSERT(!m_scriptToProcess); // Caller never called takeScriptToProcess! + ASSERT(m_scriptToProcessStartLine == uninitializedLineNumberValue); // Caller never called takeScriptToProcess! + // Pause ourselves so that parsing stops until the script can be processed by the caller. + m_isPaused = true; + m_scriptToProcess = m_lastScriptElement.get(); + // Lexer line numbers are 0-based, ScriptSourceCode expects 1-based lines, + // so we convert here before passing the line number off to HTMLScriptRunner. + m_scriptToProcessStartLine = m_lastScriptElementStartLine + 1; + } m_lastScriptElement = 0; m_lastScriptElementStartLine = uninitializedLineNumberValue; } @@ -572,9 +558,9 @@ void HTMLTreeBuilder::processFakeCharacters(const String& characters) processCharacterBuffer(buffer); } -void HTMLTreeBuilder::processFakePEndTagIfPInScope() +void HTMLTreeBuilder::processFakePEndTagIfPInButtonScope() { - if (!m_tree.openElements()->inScope(pTag.localName())) + if (!m_tree.openElements()->inButtonScope(pTag.localName())) return; AtomicHTMLToken endP(HTMLToken::EndTag, pTag.localName()); processEndTag(endP); @@ -654,7 +640,7 @@ void HTMLTreeBuilder::processCloseWhenNestedTag(AtomicHTMLToken& token) break; nodeRecord = nodeRecord->next(); } - processFakePEndTagIfPInScope(); + processFakePEndTagIfPInButtonScope(); m_tree.insertHTMLElement(token); } @@ -694,14 +680,15 @@ void adjustSVGTagNameCase(AtomicHTMLToken& token) token.setName(casedName.localName()); } -void adjustSVGAttributes(AtomicHTMLToken& token) +template<QualifiedName** getAttrs(size_t* length)> +void adjustAttributes(AtomicHTMLToken& token) { static PrefixedNameToQualifiedNameMap* caseMap = 0; if (!caseMap) { caseMap = new PrefixedNameToQualifiedNameMap; size_t length = 0; - QualifiedName** svgAttrs = SVGNames::getSVGAttrs(&length); - mapLoweredLocalNameToName(caseMap, svgAttrs, length); + QualifiedName** attrs = getAttrs(&length); + mapLoweredLocalNameToName(caseMap, attrs, length); } NamedNodeMap* attributes = token.attributes(); @@ -716,9 +703,14 @@ void adjustSVGAttributes(AtomicHTMLToken& token) } } -void adjustMathMLAttributes(AtomicHTMLToken&) +void adjustSVGAttributes(AtomicHTMLToken& token) { - notImplemented(); + adjustAttributes<SVGNames::getSVGAttrs>(token); +} + +void adjustMathMLAttributes(AtomicHTMLToken& token) +{ + adjustAttributes<MathMLNames::getMathMLAttrs>(token); } void addNamesWithPrefix(PrefixedNameToQualifiedNameMap* map, const AtomicString& prefix, QualifiedName** names, size_t length) @@ -770,7 +762,9 @@ void HTMLTreeBuilder::processStartTagForInBody(AtomicHTMLToken& token) return; } if (token.name() == baseTag - || token.name() == "command" + || token.name() == basefontTag + || token.name() == bgsoundTag + || token.name() == commandTag || token.name() == linkTag || token.name() == metaTag || token.name() == noframesTag @@ -805,12 +799,13 @@ void HTMLTreeBuilder::processStartTagForInBody(AtomicHTMLToken& token) || token.name() == asideTag || token.name() == blockquoteTag || token.name() == centerTag - || token.name() == "details" + || token.name() == detailsTag || token.name() == dirTag || token.name() == divTag || token.name() == dlTag || token.name() == fieldsetTag - || token.name() == "figure" + || token.name() == figcaptionTag + || token.name() == figureTag || token.name() == footerTag || token.name() == headerTag || token.name() == hgroupTag @@ -819,13 +814,14 @@ void HTMLTreeBuilder::processStartTagForInBody(AtomicHTMLToken& token) || token.name() == olTag || token.name() == pTag || token.name() == sectionTag + || token.name() == summaryTag || token.name() == ulTag) { - processFakePEndTagIfPInScope(); + processFakePEndTagIfPInButtonScope(); m_tree.insertHTMLElement(token); return; } if (isNumberedHeaderTag(token.name())) { - processFakePEndTagIfPInScope(); + processFakePEndTagIfPInButtonScope(); if (isNumberedHeaderTag(m_tree.currentElement()->localName())) { parseError(token); m_tree.openElements()->pop(); @@ -834,7 +830,7 @@ void HTMLTreeBuilder::processStartTagForInBody(AtomicHTMLToken& token) return; } if (token.name() == preTag || token.name() == listingTag) { - processFakePEndTagIfPInScope(); + processFakePEndTagIfPInButtonScope(); m_tree.insertHTMLElement(token); m_tokenizer->skipLeadingNewLineForListing(); m_framesetOk = false; @@ -845,7 +841,7 @@ void HTMLTreeBuilder::processStartTagForInBody(AtomicHTMLToken& token) parseError(token); return; } - processFakePEndTagIfPInScope(); + processFakePEndTagIfPInButtonScope(); m_tree.insertHTMLFormElement(token); return; } @@ -858,7 +854,7 @@ void HTMLTreeBuilder::processStartTagForInBody(AtomicHTMLToken& token) return; } if (token.name() == plaintextTag) { - processFakePEndTagIfPInScope(); + processFakePEndTagIfPInButtonScope(); m_tree.insertHTMLElement(token); m_tokenizer->setState(HTMLTokenizer::PLAINTEXTState); return; @@ -927,8 +923,6 @@ void HTMLTreeBuilder::processStartTagForInBody(AtomicHTMLToken& token) // Note the fall through to the imgTag handling below! } if (token.name() == areaTag - || token.name() == basefontTag - || token.name() == "bgsound" || token.name() == brTag || token.name() == embedTag || token.name() == imgTag @@ -942,12 +936,12 @@ void HTMLTreeBuilder::processStartTagForInBody(AtomicHTMLToken& token) } if (token.name() == paramTag || token.name() == sourceTag - || token.name() == "track") { + || token.name() == trackTag) { m_tree.insertSelfClosingHTMLElement(token); return; } if (token.name() == hrTag) { - processFakePEndTagIfPInScope(); + processFakePEndTagIfPInButtonScope(); m_tree.insertSelfClosingHTMLElement(token); m_framesetOk = false; return; @@ -966,7 +960,7 @@ void HTMLTreeBuilder::processStartTagForInBody(AtomicHTMLToken& token) return; } if (token.name() == xmpTag) { - processFakePEndTagIfPInScope(); + processFakePEndTagIfPInButtonScope(); m_tree.reconstructTheActiveFormattingElements(); m_framesetOk = false; processGenericRawTextStartTag(token); @@ -1231,6 +1225,8 @@ void HTMLTreeBuilder::processStartTag(AtomicHTMLToken& token) return; } if (token.name() == baseTag + || token.name() == basefontTag + || token.name() == bgsoundTag || token.name() == linkTag || token.name() == metaTag || token.name() == noframesTag @@ -1376,7 +1372,9 @@ void HTMLTreeBuilder::processStartTag(AtomicHTMLToken& token) m_tree.insertHTMLHtmlStartTagInBody(token); return; } - if (token.name() == linkTag + if (token.name() == basefontTag + || token.name() == bgsoundTag + || token.name() == linkTag || token.name() == metaTag || token.name() == noframesTag || token.name() == styleTag) { @@ -1935,12 +1933,12 @@ void HTMLTreeBuilder::processEndTagForInBody(AtomicHTMLToken& token) || token.name() == blockquoteTag || token.name() == buttonTag || token.name() == centerTag - || token.name() == "details" + || token.name() == detailsTag || token.name() == dirTag || token.name() == divTag || token.name() == dlTag || token.name() == fieldsetTag - || token.name() == "figure" + || token.name() == figureTag || token.name() == footerTag || token.name() == headerTag || token.name() == hgroupTag @@ -1973,7 +1971,7 @@ void HTMLTreeBuilder::processEndTagForInBody(AtomicHTMLToken& token) m_tree.openElements()->remove(node.get()); } if (token.name() == pTag) { - if (!m_tree.openElements()->inScope(token.name())) { + if (!m_tree.openElements()->inButtonScope(token.name())) { parseError(token); processFakeStartTag(pTag); ASSERT(m_tree.openElements()->inScope(token.name())); @@ -2010,14 +2008,14 @@ void HTMLTreeBuilder::processEndTagForInBody(AtomicHTMLToken& token) return; } if (isNumberedHeaderTag(token.name())) { - if (!m_tree.openElements()->inScope(token.name())) { + if (!m_tree.openElements()->hasNumberedHeaderElementInScope()) { parseError(token); return; } m_tree.generateImpliedEndTags(); if (!m_tree.currentElement()->hasLocalName(token.name())) parseError(token); - m_tree.openElements()->popUntilPopped(token.name()); + m_tree.openElements()->popUntilNumberedHeaderElementPopped(); return; } if (token.name() == "sarcasm") { @@ -2434,10 +2432,6 @@ void HTMLTreeBuilder::processComment(AtomicHTMLToken& token) void HTMLTreeBuilder::processCharacter(AtomicHTMLToken& token) { ASSERT(token.type() == HTMLToken::Character); - // FIXME: Currently this design has an extra memcpy because we copy the - // characters out of the HTMLTokenizer's buffer into the AtomicHTMLToken - // and then into the text node. What we'd really like is to copy directly - // from the HTMLTokenizer's buffer into the text node. ExternalCharacterTokenBuffer buffer(token); processCharacterBuffer(buffer); } @@ -2735,9 +2729,10 @@ bool HTMLTreeBuilder::processStartTagForInHead(AtomicHTMLToken& token) m_tree.insertHTMLHtmlStartTagInBody(token); return true; } - // FIXME: Atomize "command". if (token.name() == baseTag - || token.name() == "command" + || token.name() == basefontTag + || token.name() == bgsoundTag + || token.name() == commandTag || token.name() == linkTag || token.name() == metaTag) { m_tree.insertSelfClosingHTMLElement(token); diff --git a/WebCore/html/HTMLTreeBuilder.h b/WebCore/html/HTMLTreeBuilder.h index 0f87cb0..d723384 100644 --- a/WebCore/html/HTMLTreeBuilder.h +++ b/WebCore/html/HTMLTreeBuilder.h @@ -140,7 +140,7 @@ private: void processFakeStartTag(const QualifiedName&, PassRefPtr<NamedNodeMap> attributes = 0); void processFakeEndTag(const QualifiedName&); void processFakeCharacters(const String&); - void processFakePEndTagIfPInScope(); + void processFakePEndTagIfPInButtonScope(); void processGenericRCDATAStartTag(AtomicHTMLToken&); void processGenericRawTextStartTag(AtomicHTMLToken&); @@ -173,9 +173,6 @@ private: // FIXME: Implement error reporting. void parseError(AtomicHTMLToken&) { } - void handleScriptStartTag(); - void handleScriptEndTag(Element*, int scriptStartLine); - InsertionMode insertionMode() const { return m_insertionMode; } void setInsertionMode(InsertionMode mode) { diff --git a/WebCore/html/HTMLVideoElement.cpp b/WebCore/html/HTMLVideoElement.cpp index a6fdb5f..bfdf241 100644 --- a/WebCore/html/HTMLVideoElement.cpp +++ b/WebCore/html/HTMLVideoElement.cpp @@ -101,7 +101,6 @@ void HTMLVideoElement::parseMappedAttribute(Attribute* attr) const QualifiedName& attrName = attr->name(); if (attrName == posterAttr) { - m_posterURL = getNonEmptyURLAttribute(posterAttr); updatePosterImage(); if (m_shouldDisplayPosterImage) { #if !ENABLE(PLUGIN_PROXY_FOR_VIDEO) @@ -110,7 +109,7 @@ void HTMLVideoElement::parseMappedAttribute(Attribute* attr) m_imageLoader->updateFromElementIgnoringPreviousError(); #else if (player()) - player()->setPoster(poster()); + player()->setPoster(getNonEmptyURLAttribute(posterAttr)); #endif } } else if (attrName == widthAttr) @@ -179,7 +178,7 @@ void HTMLVideoElement::updatePosterImage() bool oldShouldShowPosterImage = m_shouldDisplayPosterImage; #endif - m_shouldDisplayPosterImage = !poster().isEmpty() && !hasAvailableVideoFrame(); + m_shouldDisplayPosterImage = !getAttribute(posterAttr).isEmpty() && !hasAvailableVideoFrame(); #if !ENABLE(PLUGIN_PROXY_FOR_VIDEO) if (renderer() && oldShouldShowPosterImage != m_shouldDisplayPosterImage) diff --git a/WebCore/html/HTMLVideoElement.h b/WebCore/html/HTMLVideoElement.h index c27962f..e7c3f34 100644 --- a/WebCore/html/HTMLVideoElement.h +++ b/WebCore/html/HTMLVideoElement.h @@ -44,8 +44,6 @@ public: unsigned videoWidth() const; unsigned videoHeight() const; - virtual const KURL poster() const { return m_posterURL; } - // Fullscreen void webkitEnterFullscreen(bool isUserGesture, ExceptionCode&); void webkitExitFullscreen(); @@ -84,7 +82,6 @@ private: virtual void willMoveToNewOwnerDocument(); OwnPtr<HTMLImageLoader> m_imageLoader; - KURL m_posterURL; bool m_shouldDisplayPosterImage; }; diff --git a/WebCore/html/HTMLVideoElement.idl b/WebCore/html/HTMLVideoElement.idl index 248d0f4..ca5db5e 100644 --- a/WebCore/html/HTMLVideoElement.idl +++ b/WebCore/html/HTMLVideoElement.idl @@ -32,7 +32,7 @@ module html { attribute [Reflect] unsigned long height; readonly attribute unsigned long videoWidth; readonly attribute unsigned long videoHeight; - attribute [Reflect,NonEmpty,URL] DOMString poster; + attribute [Reflect,URL] DOMString poster; readonly attribute boolean webkitSupportsFullscreen; readonly attribute boolean webkitDisplayingFullscreen; diff --git a/WebCore/html/canvas/CanvasRenderingContext2D.cpp b/WebCore/html/canvas/CanvasRenderingContext2D.cpp index acd15d2..6c3d372 100644 --- a/WebCore/html/canvas/CanvasRenderingContext2D.cpp +++ b/WebCore/html/canvas/CanvasRenderingContext2D.cpp @@ -32,14 +32,14 @@ #include "CanvasRenderingContext2D.h" #include "AffineTransform.h" +#include "CSSMutableStyleDeclaration.h" #include "CSSParser.h" +#include "CSSPropertyNames.h" +#include "CSSStyleSelector.h" #include "CachedImage.h" #include "CanvasGradient.h" #include "CanvasPattern.h" #include "CanvasStyle.h" -#include "CSSMutableStyleDeclaration.h" -#include "CSSPropertyNames.h" -#include "CSSStyleSelector.h" #include "ExceptionCode.h" #include "FloatConversion.h" #include "GraphicsContext.h" @@ -47,6 +47,7 @@ #include "HTMLImageElement.h" #include "HTMLMediaElement.h" #include "HTMLNames.h" +#include "HTMLVideoElement.h" #include "ImageBuffer.h" #include "ImageData.h" #include "KURL.h" @@ -56,8 +57,9 @@ #include "Settings.h" #include "StrokeStyleApplier.h" #include "TextMetrics.h" -#include "HTMLVideoElement.h" + #include <stdio.h> + #include <wtf/ByteArray.h> #include <wtf/MathExtras.h> #include <wtf/OwnPtr.h> @@ -78,7 +80,7 @@ public: : m_canvasContext(canvasContext) { } - + virtual void strokeStyle(GraphicsContext* c) { c->setStrokeThickness(m_canvasContext->lineWidth()); @@ -100,7 +102,7 @@ CanvasRenderingContext2D::CanvasRenderingContext2D(HTMLCanvasElement* canvas, bo #endif { #if !ENABLE(DASHBOARD_SUPPORT) - ASSERT_UNUSED(usesDashboardCompatibilityMode, !usesDashboardCompatibilityMode); + ASSERT_UNUSED(usesDashboardCompatibilityMode, !usesDashboardCompatibilityMode); #endif // Make sure that even if the drawingContext() has a different default @@ -202,7 +204,7 @@ void CanvasRenderingContext2D::setFillStyle(PassRefPtr<CanvasStyle> style) if (state().m_fillStyle && state().m_fillStyle->isEquivalentColor(*style)) return; - + if (canvas()->originClean()) { if (CanvasPattern* pattern = style->canvasPattern()) { if (!pattern->originClean()) @@ -446,8 +448,7 @@ void CanvasRenderingContext2D::transform(float m11, float m12, float m21, float if (!state().m_invertibleCTM) return; - if (!isfinite(m11) | !isfinite(m21) | !isfinite(dx) | - !isfinite(m12) | !isfinite(m22) | !isfinite(dy)) + if (!isfinite(m11) | !isfinite(m21) | !isfinite(dx) | !isfinite(m12) | !isfinite(m22) | !isfinite(dy)) return; AffineTransform transform(m11, m12, m21, m22, dx, dy); @@ -467,9 +468,8 @@ void CanvasRenderingContext2D::setTransform(float m11, float m12, float m21, flo GraphicsContext* c = drawingContext(); if (!c) return; - - if (!isfinite(m11) | !isfinite(m21) | !isfinite(dx) | - !isfinite(m12) | !isfinite(m22) | !isfinite(dy)) + + if (!isfinite(m11) | !isfinite(m21) | !isfinite(dx) | !isfinite(m12) | !isfinite(m22) | !isfinite(dy)) return; AffineTransform ctm = state().m_transform; @@ -621,15 +621,15 @@ void CanvasRenderingContext2D::arcTo(float x1, float y1, float x2, float y2, flo ec = 0; if (!isfinite(x1) | !isfinite(y1) | !isfinite(x2) | !isfinite(y2) | !isfinite(r)) return; - + if (r < 0) { ec = INDEX_SIZE_ERR; return; } - + if (!state().m_invertibleCTM) return; - + FloatPoint p1 = FloatPoint(x1, y1); FloatPoint p2 = FloatPoint(x2, y2); @@ -646,7 +646,7 @@ void CanvasRenderingContext2D::arc(float x, float y, float r, float sa, float ea ec = 0; if (!isfinite(x) | !isfinite(y) | !isfinite(r) | !isfinite(sa) | !isfinite(ea)) return; - + if (r < 0) { ec = INDEX_SIZE_ERR; return; @@ -659,7 +659,7 @@ void CanvasRenderingContext2D::arc(float x, float y, float r, float sa, float ea return; m_path.addArc(FloatPoint(x, y), r, sa, ea, anticlockwise); } - + static bool validateRectForCanvas(float& x, float& y, float& width, float& height) { if (!isfinite(x) | !isfinite(y) | !isfinite(width) | !isfinite(height)) @@ -672,12 +672,12 @@ static bool validateRectForCanvas(float& x, float& y, float& width, float& heigh width = -width; x -= width; } - + if (height < 0) { height = -height; y -= height; } - + return true; } @@ -835,7 +835,7 @@ void CanvasRenderingContext2D::strokeRect(float x, float y, float width, float h { if (!validateRectForCanvas(x, y, width, height)) return; - + if (!(lineWidth >= 0)) return; @@ -1082,7 +1082,7 @@ void CanvasRenderingContext2D::drawImage(HTMLImageElement* image, const FloatRec return; FloatRect imageRect = FloatRect(FloatPoint(), size(image)); - if (!imageRect.contains(normalizeRect(srcRect)) || srcRect.width() == 0 || srcRect.height() == 0) { + if (!imageRect.contains(normalizeRect(srcRect)) || !srcRect.width() || !srcRect.height()) { ec = INDEX_SIZE_ERR; return; } @@ -1153,7 +1153,7 @@ void CanvasRenderingContext2D::drawImage(HTMLCanvasElement* sourceCanvas, const return; } - if (!srcCanvasRect.contains(normalizeRect(srcRect)) || srcRect.width() == 0 || srcRect.height() == 0) { + if (!srcCanvasRect.contains(normalizeRect(srcRect)) || !srcRect.width() || !srcRect.height()) { ec = INDEX_SIZE_ERR; return; } @@ -1168,10 +1168,10 @@ void CanvasRenderingContext2D::drawImage(HTMLCanvasElement* sourceCanvas, const return; if (!state().m_invertibleCTM) return; - + FloatRect sourceRect = c->roundToDevicePixels(srcRect); FloatRect destRect = c->roundToDevicePixels(dstRect); - + // FIXME: Do this through platform-independent GraphicsContext API. ImageBuffer* buffer = sourceCanvas->buffer(); if (!buffer) @@ -1223,21 +1223,21 @@ void CanvasRenderingContext2D::drawImage(HTMLVideoElement* video, const FloatRec ec = TYPE_MISMATCH_ERR; return; } - + ec = 0; if (video->readyState() == HTMLMediaElement::HAVE_NOTHING || video->readyState() == HTMLMediaElement::HAVE_METADATA) return; FloatRect videoRect = FloatRect(FloatPoint(), size(video)); - if (!videoRect.contains(normalizeRect(srcRect)) || srcRect.width() == 0 || srcRect.height() == 0) { + if (!videoRect.contains(normalizeRect(srcRect)) || !srcRect.width() || !srcRect.height()) { ec = INDEX_SIZE_ERR; return; } - + if (!dstRect.width() || !dstRect.height()) return; - + GraphicsContext* c = drawingContext(); if (!c) return; @@ -1257,7 +1257,7 @@ void CanvasRenderingContext2D::drawImage(HTMLVideoElement* video, const FloatRec c->save(); c->clip(destRect); c->translate(destRect.x(), destRect.y()); - c->scale(FloatSize(destRect.width()/sourceRect.width(), destRect.height()/sourceRect.height())); + c->scale(FloatSize(destRect.width() / sourceRect.width(), destRect.height() / sourceRect.height())); c->translate(-sourceRect.x(), -sourceRect.y()); video->paintCurrentFrameInContext(c, IntRect(IntPoint(), size(video))); c->restore(); @@ -1332,8 +1332,7 @@ PassRefPtr<CanvasGradient> CanvasRenderingContext2D::createLinearGradient(float PassRefPtr<CanvasGradient> CanvasRenderingContext2D::createRadialGradient(float x0, float y0, float r0, float x1, float y1, float r1, ExceptionCode& ec) { - if (!isfinite(x0) || !isfinite(y0) || !isfinite(r0) || - !isfinite(x1) || !isfinite(y1) || !isfinite(r1)) { + if (!isfinite(x0) || !isfinite(y0) || !isfinite(r0) || !isfinite(x1) || !isfinite(y1) || !isfinite(r1)) { ec = NOT_SUPPORTED_ERR; return 0; } @@ -1377,7 +1376,7 @@ PassRefPtr<CanvasPattern> CanvasRenderingContext2D::createPattern(HTMLCanvasElem ec = INVALID_STATE_ERR; return 0; } - + bool repeatX, repeatY; ec = 0; CanvasPattern::parseRepetitionType(repetitionType, repeatX, repeatY, ec); @@ -1399,7 +1398,7 @@ void CanvasRenderingContext2D::willDraw(const FloatRect& r, unsigned options) AffineTransform ctm = state().m_transform; dirtyRect = ctm.mapRect(r); } - + if (options & CanvasWillDrawApplyShadow && alphaChannel(state().m_shadowColor)) { // The shadow gets applied after transformation FloatRect shadowRect(dirtyRect); @@ -1407,13 +1406,13 @@ void CanvasRenderingContext2D::willDraw(const FloatRect& r, unsigned options) shadowRect.inflate(state().m_shadowBlur); dirtyRect.unite(shadowRect); } - + if (options & CanvasWillDrawApplyClip) { // FIXME: apply the current clip to the rectangle. Unfortunately we can't get the clip // back out of the GraphicsContext, so to take clip into account for incremental painting, // we'd have to keep the clip path around. } - + canvas()->willDraw(dirtyRect); } @@ -1458,7 +1457,7 @@ PassRefPtr<ImageData> CanvasRenderingContext2D::createImageData(float sw, float scaledSize.setWidth(1); if (scaledSize.height() < 1) scaledSize.setHeight(1); - + return createEmptyImageData(scaledSize); } @@ -1498,15 +1497,14 @@ void CanvasRenderingContext2D::putImageData(ImageData* data, float dx, float dy, putImageData(data, dx, dy, 0, 0, data->width(), data->height(), ec); } -void CanvasRenderingContext2D::putImageData(ImageData* data, float dx, float dy, float dirtyX, float dirtyY, +void CanvasRenderingContext2D::putImageData(ImageData* data, float dx, float dy, float dirtyX, float dirtyY, float dirtyWidth, float dirtyHeight, ExceptionCode& ec) { if (!data) { ec = TYPE_MISMATCH_ERR; return; } - if (!isfinite(dx) || !isfinite(dy) || !isfinite(dirtyX) || - !isfinite(dirtyY) || !isfinite(dirtyWidth) || !isfinite(dirtyHeight)) { + if (!isfinite(dx) || !isfinite(dy) || !isfinite(dirtyX) || !isfinite(dirtyY) || !isfinite(dirtyWidth) || !isfinite(dirtyHeight)) { ec = NOT_SUPPORTED_ERR; return; } @@ -1533,10 +1531,10 @@ void CanvasRenderingContext2D::putImageData(ImageData* data, float dx, float dy, sourceRect.intersect(IntRect(IntPoint(), buffer->size())); if (sourceRect.isEmpty()) return; - willDraw(sourceRect, 0); // ignore transform, shadow and clip + willDraw(sourceRect, 0); // ignore transform, shadow and clip sourceRect.move(-destOffset); IntPoint destPoint(destOffset.width(), destOffset.height()); - + buffer->putUnmultipliedImageData(data, sourceRect, destPoint); } @@ -1549,16 +1547,16 @@ void CanvasRenderingContext2D::setFont(const String& newFont) { RefPtr<CSSMutableStyleDeclaration> tempDecl = CSSMutableStyleDeclaration::create(); CSSParser parser(!m_usesCSSCompatibilityParseMode); - + String declarationText("font: "); declarationText += newFont; parser.parseDeclaration(tempDecl.get(), declarationText); if (!tempDecl->length()) return; - + // The parse succeeded. state().m_unparsedFont = newFont; - + // Map the <canvas> font into the text style. If the font uses keywords like larger/smaller, these will work // relative to the canvas. RefPtr<RenderStyle> newStyle = RenderStyle::create(); @@ -1568,7 +1566,7 @@ void CanvasRenderingContext2D::setFont(const String& newFont) // Now map the font property into the style. CSSStyleSelector* styleSelector = canvas()->styleSelector(); styleSelector->applyPropertyToStyle(CSSPropertyFont, tempDecl->getPropertyCSSValue(CSSPropertyFont).get(), newStyle.get()); - + state().m_font = newStyle->font(); state().m_font.update(styleSelector->fontSelector()); state().m_realizedFont = true; @@ -1595,7 +1593,7 @@ void CanvasRenderingContext2D::setTextAlign(const String& s) return; state().m_textAlign = align; } - + String CanvasRenderingContext2D::textBaseline() const { return textBaselineName(state().m_textBaseline); @@ -1643,7 +1641,7 @@ void CanvasRenderingContext2D::drawTextInternal(const String& text, float x, flo return; if (!state().m_invertibleCTM) return; - + const Font& font = accessFont(); // FIXME: Handle maxWidth. @@ -1660,23 +1658,23 @@ void CanvasRenderingContext2D::drawTextInternal(const String& text, float x, flo // Draw the item text at the correct point. FloatPoint location(x, y); switch (state().m_textBaseline) { - case TopTextBaseline: - case HangingTextBaseline: - location.setY(y + font.ascent()); - break; - case BottomTextBaseline: - case IdeographicTextBaseline: - location.setY(y - font.descent()); - break; - case MiddleTextBaseline: - location.setY(y - font.descent() + font.height() / 2); - break; - case AlphabeticTextBaseline: - default: - // Do nothing. - break; + case TopTextBaseline: + case HangingTextBaseline: + location.setY(y + font.ascent()); + break; + case BottomTextBaseline: + case IdeographicTextBaseline: + location.setY(y - font.descent()); + break; + case MiddleTextBaseline: + location.setY(y - font.descent() + font.height() / 2); + break; + case AlphabeticTextBaseline: + default: + // Do nothing. + break; } - + float width = font.width(TextRun(text, false, 0, 0, rtl, override)); TextAlign align = state().m_textAlign; @@ -1684,18 +1682,18 @@ void CanvasRenderingContext2D::drawTextInternal(const String& text, float x, flo align = rtl ? RightTextAlign : LeftTextAlign; else if (align == EndTextAlign) align = rtl ? LeftTextAlign : RightTextAlign; - + switch (align) { - case CenterTextAlign: - location.setX(location.x() - width / 2); - break; - case RightTextAlign: - location.setX(location.x() - width); - break; - default: - break; + case CenterTextAlign: + location.setX(location.x() - width / 2); + break; + case RightTextAlign: + location.setX(location.x() - width); + break; + default: + break; } - + // The slop built in to this mask rect matches the heuristic used in FontCGWin.cpp for GDI text. FloatRect textRect = FloatRect(location.x() - font.height() / 2, location.y() - font.ascent() - font.lineGap(), width + font.height(), font.lineSpacing()); @@ -1709,7 +1707,7 @@ void CanvasRenderingContext2D::drawTextInternal(const String& text, float x, flo // punt and dirty the whole canvas. canvas()->willDraw(FloatRect(0, 0, canvas()->width(), canvas()->height())); } - + #if PLATFORM(CG) CanvasStyle* drawStyle = fill ? state().m_fillStyle.get() : state().m_strokeStyle.get(); if (drawStyle->canvasGradient() || drawStyle->canvasPattern()) { @@ -1729,9 +1727,9 @@ void CanvasRenderingContext2D::drawTextInternal(const String& text, float x, flo maskImageContext->setTextDrawingMode(fill ? cTextFill : cTextStroke); maskImageContext->translate(-maskRect.x(), -maskRect.y()); - + maskImageContext->drawBidiText(font, textRun, location); - + c->save(); c->clipToImageBuffer(maskRect, maskImage.get()); drawStyle->applyFillColor(c); diff --git a/WebCore/html/canvas/CanvasRenderingContext2D.h b/WebCore/html/canvas/CanvasRenderingContext2D.h index 2eac88d..fb5f27a 100644 --- a/WebCore/html/canvas/CanvasRenderingContext2D.h +++ b/WebCore/html/canvas/CanvasRenderingContext2D.h @@ -34,8 +34,9 @@ #include "GraphicsTypes.h" #include "Path.h" #include "PlatformString.h" -#include <wtf/text/StringHash.h> + #include <wtf/Vector.h> +#include <wtf/text/StringHash.h> #if PLATFORM(CG) #include <ApplicationServices/ApplicationServices.h> @@ -43,243 +44,243 @@ namespace WebCore { - class CanvasGradient; - class CanvasPattern; - class CanvasStyle; - class FloatRect; - class GraphicsContext; - class HTMLCanvasElement; - class HTMLImageElement; - class HTMLVideoElement; - class ImageData; - class KURL; - class TextMetrics; - - typedef int ExceptionCode; +class CanvasGradient; +class CanvasPattern; +class CanvasStyle; +class FloatRect; +class GraphicsContext; +class HTMLCanvasElement; +class HTMLImageElement; +class HTMLVideoElement; +class ImageData; +class KURL; +class TextMetrics; + +typedef int ExceptionCode; + +class CanvasRenderingContext2D : public CanvasRenderingContext { +public: + CanvasRenderingContext2D(HTMLCanvasElement*, bool usesCSSCompatibilityParseMode, bool usesDashboardCompatibilityMode); - class CanvasRenderingContext2D : public CanvasRenderingContext { - public: - CanvasRenderingContext2D(HTMLCanvasElement*, bool usesCSSCompatibilityParseMode, bool usesDashboardCompatibilityMode); - - virtual ~CanvasRenderingContext2D(); - - virtual bool is2d() const { return true; } - - CanvasStyle* strokeStyle() const; - void setStrokeStyle(PassRefPtr<CanvasStyle>); - - CanvasStyle* fillStyle() const; - void setFillStyle(PassRefPtr<CanvasStyle>); - - float lineWidth() const; - void setLineWidth(float); - - String lineCap() const; - void setLineCap(const String&); - - String lineJoin() const; - void setLineJoin(const String&); - - float miterLimit() const; - void setMiterLimit(float); - - float shadowOffsetX() const; - void setShadowOffsetX(float); - - float shadowOffsetY() const; - void setShadowOffsetY(float); - - float shadowBlur() const; - void setShadowBlur(float); - - String shadowColor() const; - void setShadowColor(const String&); - - float globalAlpha() const; - void setGlobalAlpha(float); - - String globalCompositeOperation() const; - void setGlobalCompositeOperation(const String&); - - void save(); - void restore(); - - void scale(float sx, float sy); - void rotate(float angleInRadians); - void translate(float tx, float ty); - void transform(float m11, float m12, float m21, float m22, float dx, float dy); - void setTransform(float m11, float m12, float m21, float m22, float dx, float dy); - - void setStrokeColor(const String& color); - void setStrokeColor(float grayLevel); - void setStrokeColor(const String& color, float alpha); - void setStrokeColor(float grayLevel, float alpha); - void setStrokeColor(float r, float g, float b, float a); - void setStrokeColor(float c, float m, float y, float k, float a); - - void setFillColor(const String& color); - void setFillColor(float grayLevel); - void setFillColor(const String& color, float alpha); - void setFillColor(float grayLevel, float alpha); - void setFillColor(float r, float g, float b, float a); - void setFillColor(float c, float m, float y, float k, float a); - - void beginPath(); - void closePath(); - - void moveTo(float x, float y); - void lineTo(float x, float y); - void quadraticCurveTo(float cpx, float cpy, float x, float y); - void bezierCurveTo(float cp1x, float cp1y, float cp2x, float cp2y, float x, float y); - void arcTo(float x0, float y0, float x1, float y1, float radius, ExceptionCode&); - void arc(float x, float y, float r, float sa, float ea, bool clockwise, ExceptionCode&); - void rect(float x, float y, float width, float height); - - void fill(); - void stroke(); - void clip(); - - bool isPointInPath(const float x, const float y); - - void clearRect(float x, float y, float width, float height); - void fillRect(float x, float y, float width, float height); - void strokeRect(float x, float y, float width, float height); - void strokeRect(float x, float y, float width, float height, float lineWidth); - - void setShadow(float width, float height, float blur); - void setShadow(float width, float height, float blur, const String& color); - void setShadow(float width, float height, float blur, float grayLevel); - void setShadow(float width, float height, float blur, const String& color, float alpha); - void setShadow(float width, float height, float blur, float grayLevel, float alpha); - void setShadow(float width, float height, float blur, float r, float g, float b, float a); - void setShadow(float width, float height, float blur, float c, float m, float y, float k, float a); + virtual ~CanvasRenderingContext2D(); + + virtual bool is2d() const { return true; } + + CanvasStyle* strokeStyle() const; + void setStrokeStyle(PassRefPtr<CanvasStyle>); + + CanvasStyle* fillStyle() const; + void setFillStyle(PassRefPtr<CanvasStyle>); + + float lineWidth() const; + void setLineWidth(float); + + String lineCap() const; + void setLineCap(const String&); + + String lineJoin() const; + void setLineJoin(const String&); + + float miterLimit() const; + void setMiterLimit(float); + + float shadowOffsetX() const; + void setShadowOffsetX(float); + + float shadowOffsetY() const; + void setShadowOffsetY(float); + + float shadowBlur() const; + void setShadowBlur(float); + + String shadowColor() const; + void setShadowColor(const String&); + + float globalAlpha() const; + void setGlobalAlpha(float); + + String globalCompositeOperation() const; + void setGlobalCompositeOperation(const String&); + + void save(); + void restore(); + + void scale(float sx, float sy); + void rotate(float angleInRadians); + void translate(float tx, float ty); + void transform(float m11, float m12, float m21, float m22, float dx, float dy); + void setTransform(float m11, float m12, float m21, float m22, float dx, float dy); + + void setStrokeColor(const String& color); + void setStrokeColor(float grayLevel); + void setStrokeColor(const String& color, float alpha); + void setStrokeColor(float grayLevel, float alpha); + void setStrokeColor(float r, float g, float b, float a); + void setStrokeColor(float c, float m, float y, float k, float a); + + void setFillColor(const String& color); + void setFillColor(float grayLevel); + void setFillColor(const String& color, float alpha); + void setFillColor(float grayLevel, float alpha); + void setFillColor(float r, float g, float b, float a); + void setFillColor(float c, float m, float y, float k, float a); + + void beginPath(); + void closePath(); + + void moveTo(float x, float y); + void lineTo(float x, float y); + void quadraticCurveTo(float cpx, float cpy, float x, float y); + void bezierCurveTo(float cp1x, float cp1y, float cp2x, float cp2y, float x, float y); + void arcTo(float x0, float y0, float x1, float y1, float radius, ExceptionCode&); + void arc(float x, float y, float r, float sa, float ea, bool clockwise, ExceptionCode&); + void rect(float x, float y, float width, float height); + + void fill(); + void stroke(); + void clip(); + + bool isPointInPath(const float x, const float y); + + void clearRect(float x, float y, float width, float height); + void fillRect(float x, float y, float width, float height); + void strokeRect(float x, float y, float width, float height); + void strokeRect(float x, float y, float width, float height, float lineWidth); + + void setShadow(float width, float height, float blur); + void setShadow(float width, float height, float blur, const String& color); + void setShadow(float width, float height, float blur, float grayLevel); + void setShadow(float width, float height, float blur, const String& color, float alpha); + void setShadow(float width, float height, float blur, float grayLevel, float alpha); + void setShadow(float width, float height, float blur, float r, float g, float b, float a); + void setShadow(float width, float height, float blur, float c, float m, float y, float k, float a); - void clearShadow(); - - void drawImage(HTMLImageElement*, float x, float y, ExceptionCode&); - void drawImage(HTMLImageElement*, float x, float y, float width, float height, ExceptionCode&); - void drawImage(HTMLImageElement*, float sx, float sy, float sw, float sh, float dx, float dy, float dw, float dh, ExceptionCode&); - void drawImage(HTMLImageElement*, const FloatRect& srcRect, const FloatRect& dstRect, ExceptionCode&); - void drawImage(HTMLCanvasElement*, float x, float y, ExceptionCode&); - void drawImage(HTMLCanvasElement*, float x, float y, float width, float height, ExceptionCode&); - void drawImage(HTMLCanvasElement*, float sx, float sy, float sw, float sh, float dx, float dy, float dw, float dh, ExceptionCode&); - void drawImage(HTMLCanvasElement*, const FloatRect& srcRect, const FloatRect& dstRect, ExceptionCode&); + void clearShadow(); + + void drawImage(HTMLImageElement*, float x, float y, ExceptionCode&); + void drawImage(HTMLImageElement*, float x, float y, float width, float height, ExceptionCode&); + void drawImage(HTMLImageElement*, float sx, float sy, float sw, float sh, float dx, float dy, float dw, float dh, ExceptionCode&); + void drawImage(HTMLImageElement*, const FloatRect& srcRect, const FloatRect& dstRect, ExceptionCode&); + void drawImage(HTMLCanvasElement*, float x, float y, ExceptionCode&); + void drawImage(HTMLCanvasElement*, float x, float y, float width, float height, ExceptionCode&); + void drawImage(HTMLCanvasElement*, float sx, float sy, float sw, float sh, float dx, float dy, float dw, float dh, ExceptionCode&); + void drawImage(HTMLCanvasElement*, const FloatRect& srcRect, const FloatRect& dstRect, ExceptionCode&); #if ENABLE(VIDEO) - void drawImage(HTMLVideoElement*, float x, float y, ExceptionCode&); - void drawImage(HTMLVideoElement*, float x, float y, float width, float height, ExceptionCode&); - void drawImage(HTMLVideoElement*, float sx, float sy, float sw, float sh, float dx, float dy, float dw, float dh, ExceptionCode&); - void drawImage(HTMLVideoElement*, const FloatRect& srcRect, const FloatRect& dstRect, ExceptionCode&); + void drawImage(HTMLVideoElement*, float x, float y, ExceptionCode&); + void drawImage(HTMLVideoElement*, float x, float y, float width, float height, ExceptionCode&); + void drawImage(HTMLVideoElement*, float sx, float sy, float sw, float sh, float dx, float dy, float dw, float dh, ExceptionCode&); + void drawImage(HTMLVideoElement*, const FloatRect& srcRect, const FloatRect& dstRect, ExceptionCode&); #endif - void drawImageFromRect(HTMLImageElement*, float sx, float sy, float sw, float sh, - float dx, float dy, float dw, float dh, const String& compositeOperation); - - void setAlpha(float); - - void setCompositeOperation(const String&); - - PassRefPtr<CanvasGradient> createLinearGradient(float x0, float y0, float x1, float y1, ExceptionCode&); - PassRefPtr<CanvasGradient> createRadialGradient(float x0, float y0, float r0, float x1, float y1, float r1, ExceptionCode&); - PassRefPtr<CanvasPattern> createPattern(HTMLImageElement*, const String& repetitionType, ExceptionCode&); - PassRefPtr<CanvasPattern> createPattern(HTMLCanvasElement*, const String& repetitionType, ExceptionCode&); - - PassRefPtr<ImageData> createImageData(PassRefPtr<ImageData> imageData, ExceptionCode&) const; - PassRefPtr<ImageData> createImageData(float width, float height, ExceptionCode&) const; - PassRefPtr<ImageData> getImageData(float sx, float sy, float sw, float sh, ExceptionCode&) const; - void putImageData(ImageData*, float dx, float dy, ExceptionCode&); - void putImageData(ImageData*, float dx, float dy, float dirtyX, float dirtyY, float dirtyWidth, float dirtyHeight, ExceptionCode&); - - void reset(); - - String font() const; - void setFont(const String&); - void updateFont(); - - String textAlign() const; - void setTextAlign(const String&); - - String textBaseline() const; - void setTextBaseline(const String&); - - void fillText(const String& text, float x, float y); - void fillText(const String& text, float x, float y, float maxWidth); - void strokeText(const String& text, float x, float y); - void strokeText(const String& text, float x, float y, float maxWidth); - PassRefPtr<TextMetrics> measureText(const String& text); - - LineCap getLineCap() const { return state().m_lineCap; } - LineJoin getLineJoin() const { return state().m_lineJoin; } - - private: - struct State { - State(); - - String m_unparsedStrokeColor; - String m_unparsedFillColor; - RefPtr<CanvasStyle> m_strokeStyle; - RefPtr<CanvasStyle> m_fillStyle; - float m_lineWidth; - LineCap m_lineCap; - LineJoin m_lineJoin; - float m_miterLimit; - FloatSize m_shadowOffset; - float m_shadowBlur; - RGBA32 m_shadowColor; - float m_globalAlpha; - CompositeOperator m_globalComposite; - AffineTransform m_transform; - bool m_invertibleCTM; - - // Text state. - TextAlign m_textAlign; - TextBaseline m_textBaseline; - - String m_unparsedFont; - Font m_font; - bool m_realizedFont; - }; - Path m_path; - - State& state() { return m_stateStack.last(); } - const State& state() const { return m_stateStack.last(); } - - void applyShadow(); - - enum CanvasWillDrawOption { - CanvasWillDrawApplyTransform = 1, - CanvasWillDrawApplyShadow = 1 << 1, - CanvasWillDrawApplyClip = 1 << 2, - CanvasWillDrawApplyAll = 0xffffffff - }; - - void willDraw(const FloatRect&, unsigned options = CanvasWillDrawApplyAll); - - GraphicsContext* drawingContext() const; - - void applyStrokePattern(); - void applyFillPattern(); - - void drawTextInternal(const String& text, float x, float y, bool fill, float maxWidth = 0, bool useMaxWidth = false); - - const Font& accessFont(); + void drawImageFromRect(HTMLImageElement*, float sx, float sy, float sw, float sh, + float dx, float dy, float dw, float dh, const String& compositeOperation); + + void setAlpha(float); + + void setCompositeOperation(const String&); + + PassRefPtr<CanvasGradient> createLinearGradient(float x0, float y0, float x1, float y1, ExceptionCode&); + PassRefPtr<CanvasGradient> createRadialGradient(float x0, float y0, float r0, float x1, float y1, float r1, ExceptionCode&); + PassRefPtr<CanvasPattern> createPattern(HTMLImageElement*, const String& repetitionType, ExceptionCode&); + PassRefPtr<CanvasPattern> createPattern(HTMLCanvasElement*, const String& repetitionType, ExceptionCode&); + + PassRefPtr<ImageData> createImageData(PassRefPtr<ImageData> imageData, ExceptionCode&) const; + PassRefPtr<ImageData> createImageData(float width, float height, ExceptionCode&) const; + PassRefPtr<ImageData> getImageData(float sx, float sy, float sw, float sh, ExceptionCode&) const; + void putImageData(ImageData*, float dx, float dy, ExceptionCode&); + void putImageData(ImageData*, float dx, float dy, float dirtyX, float dirtyY, float dirtyWidth, float dirtyHeight, ExceptionCode&); + + void reset(); + + String font() const; + void setFont(const String&); + void updateFont(); + + String textAlign() const; + void setTextAlign(const String&); + + String textBaseline() const; + void setTextBaseline(const String&); + + void fillText(const String& text, float x, float y); + void fillText(const String& text, float x, float y, float maxWidth); + void strokeText(const String& text, float x, float y); + void strokeText(const String& text, float x, float y, float maxWidth); + PassRefPtr<TextMetrics> measureText(const String& text); + + LineCap getLineCap() const { return state().m_lineCap; } + LineJoin getLineJoin() const { return state().m_lineJoin; } + +private: + struct State { + State(); + + String m_unparsedStrokeColor; + String m_unparsedFillColor; + RefPtr<CanvasStyle> m_strokeStyle; + RefPtr<CanvasStyle> m_fillStyle; + float m_lineWidth; + LineCap m_lineCap; + LineJoin m_lineJoin; + float m_miterLimit; + FloatSize m_shadowOffset; + float m_shadowBlur; + RGBA32 m_shadowColor; + float m_globalAlpha; + CompositeOperator m_globalComposite; + AffineTransform m_transform; + bool m_invertibleCTM; + + // Text state. + TextAlign m_textAlign; + TextBaseline m_textBaseline; + + String m_unparsedFont; + Font m_font; + bool m_realizedFont; + }; + Path m_path; + + State& state() { return m_stateStack.last(); } + const State& state() const { return m_stateStack.last(); } + + void applyShadow(); + + enum CanvasWillDrawOption { + CanvasWillDrawApplyTransform = 1, + CanvasWillDrawApplyShadow = 1 << 1, + CanvasWillDrawApplyClip = 1 << 2, + CanvasWillDrawApplyAll = 0xffffffff + }; + + void willDraw(const FloatRect&, unsigned options = CanvasWillDrawApplyAll); + + GraphicsContext* drawingContext() const; + + void applyStrokePattern(); + void applyFillPattern(); + + void drawTextInternal(const String& text, float x, float y, bool fill, float maxWidth = 0, bool useMaxWidth = false); + + const Font& accessFont(); #if ENABLE(DASHBOARD_SUPPORT) - void clearPathForDashboardBackwardCompatibilityMode(); + void clearPathForDashboardBackwardCompatibilityMode(); #endif - - void prepareGradientForDashboard(CanvasGradient* gradient) const; - HashSet<String> m_cleanOrigins; + void prepareGradientForDashboard(CanvasGradient* gradient) const; - void checkOrigin(const KURL&); - void checkOrigin(const String&); + HashSet<String> m_cleanOrigins; - Vector<State, 1> m_stateStack; - bool m_usesCSSCompatibilityParseMode; + void checkOrigin(const KURL&); + void checkOrigin(const String&); + + Vector<State, 1> m_stateStack; + bool m_usesCSSCompatibilityParseMode; #if ENABLE(DASHBOARD_SUPPORT) - bool m_usesDashboardCompatibilityMode; + bool m_usesDashboardCompatibilityMode; #endif - }; +}; } // namespace WebCore diff --git a/WebCore/html/canvas/WebGLRenderingContext.cpp b/WebCore/html/canvas/WebGLRenderingContext.cpp index f567ac8..fb17db9 100644 --- a/WebCore/html/canvas/WebGLRenderingContext.cpp +++ b/WebCore/html/canvas/WebGLRenderingContext.cpp @@ -141,18 +141,22 @@ void WebGLRenderingContext::markContextChanged() RenderBox* renderBox = canvas()->renderBox(); if (renderBox && renderBox->hasLayer() && renderBox->layer()->hasAcceleratedCompositing()) renderBox->layer()->rendererContentChanged(); + else { #endif - if (!m_markedCanvasDirty) { - // Make sure the canvas's image buffer is allocated. - canvas()->buffer(); - canvas()->willDraw(FloatRect(0, 0, canvas()->width(), canvas()->height())); - m_markedCanvasDirty = true; + if (!m_markedCanvasDirty) + canvas()->willDraw(FloatRect(0, 0, canvas()->width(), canvas()->height())); +#if USE(ACCELERATED_COMPOSITING) } +#endif + m_markedCanvasDirty = true; } bool WebGLRenderingContext::paintRenderingResultsToCanvas() { if (m_markedCanvasDirty) { + // FIXME: It should not be necessary to clear the image before doing a readback. + // Investigate why this is needed and remove if possible. + canvas()->buffer()->clearImage(); m_markedCanvasDirty = false; m_context->paintRenderingResultsToCanvas(this); return true; diff --git a/WebCore/inspector/CodeGeneratorInspector.pm b/WebCore/inspector/CodeGeneratorInspector.pm index afaddec..5488dbd 100644 --- a/WebCore/inspector/CodeGeneratorInspector.pm +++ b/WebCore/inspector/CodeGeneratorInspector.pm @@ -14,6 +14,10 @@ $typeTransform{"InspectorClient"} = { "forward" => "InspectorClient", "header" => "InspectorClient.h", }; +$typeTransform{"InspectorBackend"} = { + "forward" => "InspectorBackend", + "header" => "InspectorBackend.h", +}; $typeTransform{"PassRefPtr"} = { "forwardHeader" => "wtf/PassRefPtr.h", }; @@ -95,6 +99,13 @@ my $verbose; my $namespace; +my $backendClassName; +my %backendTypes; +my %backendMethods; +my @backendMethodsImpl; +my $backendConstructor; +my $backendFooter; + my $frontendClassName; my %frontendTypes; my %frontendMethods; @@ -150,6 +161,18 @@ sub GenerateInterface $frontendTypes{"InspectorClient"} = 1; $frontendTypes{"PassRefPtr"} = 1; + $backendClassName = $className . "BackendDispatcher"; + my @backendHead; + push(@backendHead, " ${backendClassName}(InspectorBackend* inspectorBackend) : m_inspectorBackend(inspectorBackend) { }"); + push(@backendHead, " void dispatch(const String& message);"); + push(@backendHead, "private:"); + $backendConstructor = join("\n", @backendHead); + $backendFooter = " InspectorBackend* m_inspectorBackend;"; + $backendTypes{"InspectorBackend"} = 1; + $backendTypes{"PassRefPtr"} = 1; + $backendTypes{"Array"} = 1; + + generateBackendPrivateFunctions(); generateFunctions($interface); } @@ -159,7 +182,9 @@ sub generateFunctions foreach my $function (@{$interface->functions}) { generateFrontendFunction($function); + generateBackendFunction($function); } + push(@backendMethodsImpl, generateBackendDispatcher()); } sub generateFrontendFunction @@ -198,6 +223,120 @@ sub generateFrontendFunction } } +sub generateBackendPrivateFunctions +{ + my $privateFunctions = << "EOF"; +static String formatWrongArgumentsCountMessage(unsigned expected, unsigned actual) +{ + return String::format(\"Wrong number of parameters: %d (expected: %d)\", actual, expected); +} + +static String formatWrongArgumentTypeMessage(unsigned position, const char* name, const char* expectedType) +{ + return String::format(\"Failed to convert parameter %d (%s) to %s\", position, name, expectedType); +} +EOF + push(@backendMethodsImpl, $privateFunctions); +} + +sub generateBackendFunction +{ + my $function = shift; + return if $function->signature->extendedAttributes->{"notify"}; + + my $functionName = $function->signature->name; + + my @argsFiltered = grep($_->direction eq "in", @{$function->parameters}); + map($backendTypes{$_->type} = 1, @argsFiltered); # register required types + my $arguments = join(", ", map($typeTransform{$_->type}->{"param"} . " " . $_->name, @argsFiltered)); + + my $signature = " void ${functionName}(PassRefPtr<InspectorArray> args, String* exception);"; + !$backendMethods{${signature}} || die "Duplicate function was detected for signature '$signature'."; + $backendMethods{${signature}} = $functionName; + + my @function; + push(@function, "void ${backendClassName}::${functionName}(PassRefPtr<InspectorArray> args, String* exception)"); + push(@function, "{"); + my $i = 1; # zero element is the method name. + my $expectedParametersCount = scalar(@argsFiltered); + my $expectedParametersCountWithMethodName = scalar(@argsFiltered) + 1; + push(@function, " if (args->length() != $expectedParametersCountWithMethodName) {"); + push(@function, " *exception = formatWrongArgumentsCountMessage(args->length() - 1, $expectedParametersCount);"); + push(@function, " ASSERT_NOT_REACHED();"); + push(@function, " return;"); + push(@function, " }"); + + foreach my $parameter (@argsFiltered) { + my $parameterType = $parameter->type; + push(@function, " " . $typeTransform{$parameterType}->{"retVal"} . " " . $parameter->name . ";"); + push(@function, " if (!args->get(" . $i . ")->as" . $typeTransform{$parameterType}->{"accessorSuffix"} . "(&" . $parameter->name . ")) {"); + push(@function, " *exception = formatWrongArgumentTypeMessage($i, \"" . $parameter->name . "\", \"$parameterType\");"); + push(@function, " ASSERT_NOT_REACHED();"); + push(@function, " return;"); + push(@function, " }"); + ++$i; + } + push(@function, " m_inspectorBackend->$functionName(" . join(", ", map($_->name, @argsFiltered)) . ");"); + push(@function, "}"); + push(@function, ""); + push(@backendMethodsImpl, @function); +} + +sub generateBackendDispatcher +{ + my @body; + my @methods = map($backendMethods{$_}, keys %backendMethods); + my @mapEntries = map("dispatchMap.add(\"$_\", &${backendClassName}::$_);", @methods); + + push(@body, "void ${backendClassName}::dispatch(const String& message)"); + push(@body, "{"); + push(@body, " String exception;"); + push(@body, " typedef void (${backendClassName}::*CallHandler)(PassRefPtr<InspectorArray> args, String* exception);"); + push(@body, " typedef HashMap<String, CallHandler> DispatchMap;"); + push(@body, " DEFINE_STATIC_LOCAL(DispatchMap, dispatchMap, );"); + push(@body, " if (dispatchMap.isEmpty()) {"); + push(@body, map(" $_", @mapEntries)); + push(@body, " }"); + push(@body, ""); + push(@body, " RefPtr<InspectorValue> parsedMessage = InspectorValue::parseJSON(message);"); + push(@body, " if (!parsedMessage) {"); + push(@body, " ASSERT_NOT_REACHED();"); + push(@body, " exception = \"Error: Invalid message format. Message should be in JSON format.\";"); + push(@body, " return;"); + push(@body, " }"); + push(@body, ""); + push(@body, " RefPtr<InspectorArray> messageArray = parsedMessage->asArray();"); + push(@body, " if (!messageArray) {"); + push(@body, " ASSERT_NOT_REACHED();"); + push(@body, " exception = \"Error: Invalid message format. The message should be a JSONified array of arguments.\";"); + push(@body, " return;"); + push(@body, " }"); + push(@body, ""); + push(@body, " if (!messageArray->length()) {"); + push(@body, " ASSERT_NOT_REACHED();"); + push(@body, " exception = \"Error: Invalid message format. Empty message was received.\";"); + push(@body, " return;"); + push(@body, " }"); + push(@body, ""); + push(@body, " String methodName;"); + push(@body, " if (!messageArray->get(0)->asString(&methodName)) {"); + push(@body, " ASSERT_NOT_REACHED();"); + push(@body, " exception = \"Error: Invalid message format. The first element of the message should be method name.\";"); + push(@body, " return;"); + push(@body, " }"); + push(@body, ""); + push(@body, " HashMap<String, CallHandler>::iterator it = dispatchMap.find(methodName);"); + push(@body, " if (it == dispatchMap.end()) {"); + push(@body, " ASSERT_NOT_REACHED();"); + push(@body, " exception = String::format(\"Error: Invalid method name. '%s' wasn't found.\", methodName.utf8().data());"); + push(@body, " return;"); + push(@body, " }"); + push(@body, ""); + push(@body, " ((*this).*it->second)(messageArray, &exception);"); + push(@body, "}"); + return @body; +} + sub generateHeader { my $className = shift; @@ -284,6 +423,15 @@ sub finish close($HEADER); undef($HEADER); + open($SOURCE, ">$outputDir/$backendClassName.cpp") || die "Couldn't open file $outputDir/$backendClassName.cpp"; + print $SOURCE join("\n", generateSource($backendClassName, \%backendTypes, \@backendMethodsImpl)); + close($SOURCE); + undef($SOURCE); + + open($HEADER, ">$outputHeadersDir/$backendClassName.h") || die "Couldn't open file $outputHeadersDir/$backendClassName.h"; + print $HEADER join("\n", generateHeader($backendClassName, \%backendTypes, $backendConstructor, \%backendMethods, $backendFooter)); + close($HEADER); + undef($HEADER); } 1; diff --git a/WebCore/inspector/ConsoleMessage.cpp b/WebCore/inspector/ConsoleMessage.cpp index 79b5115..9c0b783 100644 --- a/WebCore/inspector/ConsoleMessage.cpp +++ b/WebCore/inspector/ConsoleMessage.cpp @@ -34,9 +34,13 @@ #include "InjectedScript.h" #include "InjectedScriptHost.h" #include "InspectorFrontend.h" +#include "InspectorValues.h" #include "ScriptCallStack.h" #include "ScriptObject.h" -#include "SerializedScriptValue.h" + +#if ENABLE(INSPECTOR) +#include "RemoteInspectorFrontend.h" +#endif namespace WebCore { @@ -59,14 +63,16 @@ bool ConsoleMessage::CallFrame::isEqual(const ConsoleMessage::CallFrame& o) cons && m_lineNumber == o.m_lineNumber; } -ScriptObject ConsoleMessage::CallFrame::buildObject(InspectorFrontend* frontend) const +#if ENABLE(INSPECTOR) +PassRefPtr<InspectorObject> ConsoleMessage::CallFrame::buildInspectorObject() const { - ScriptObject frame = frontend->newScriptObject(); - frame.set("functionName", m_functionName); - frame.set("sourceURL", m_sourceURL.string()); - frame.set("lineNumber", m_lineNumber); + RefPtr<InspectorObject> frame = InspectorObject::create(); + frame->setString("functionName", m_functionName); + frame->setString("sourceURL", m_sourceURL.string()); + frame->setNumber("lineNumber", m_lineNumber); return frame; } +#endif ConsoleMessage::ConsoleMessage(MessageSource s, MessageType t, MessageLevel l, const String& m, unsigned li, const String& u, unsigned g) : m_source(s) @@ -109,39 +115,40 @@ ConsoleMessage::ConsoleMessage(MessageSource s, MessageType t, MessageLevel l, c } #if ENABLE(INSPECTOR) -void ConsoleMessage::addToFrontend(InspectorFrontend* frontend, InjectedScriptHost* injectedScriptHost) +void ConsoleMessage::addToFrontend(RemoteInspectorFrontend* frontend, InjectedScriptHost* injectedScriptHost) { - ScriptObject jsonObj = frontend->newScriptObject(); - jsonObj.set("source", static_cast<int>(m_source)); - jsonObj.set("type", static_cast<int>(m_type)); - jsonObj.set("level", static_cast<int>(m_level)); - jsonObj.set("line", static_cast<int>(m_line)); - jsonObj.set("url", m_url); - jsonObj.set("groupLevel", static_cast<int>(m_groupLevel)); - jsonObj.set("repeatCount", static_cast<int>(m_repeatCount)); - jsonObj.set("message", m_message); + RefPtr<InspectorObject> jsonObj = InspectorObject::create(); + jsonObj->setNumber("source", static_cast<int>(m_source)); + jsonObj->setNumber("type", static_cast<int>(m_type)); + jsonObj->setNumber("level", static_cast<int>(m_level)); + jsonObj->setNumber("line", static_cast<int>(m_line)); + jsonObj->setString("url", m_url); + jsonObj->setNumber("groupLevel", static_cast<int>(m_groupLevel)); + jsonObj->setNumber("repeatCount", static_cast<int>(m_repeatCount)); + jsonObj->setString("message", m_message); if (!m_arguments.isEmpty()) { - ScriptArray jsonArgs = frontend->newScriptArray(); + RefPtr<InspectorArray> jsonArgs = InspectorArray::create(); InjectedScript injectedScript = injectedScriptHost->injectedScriptFor(m_scriptState.get()); for (unsigned i = 0; i < m_arguments.size(); ++i) { - RefPtr<SerializedScriptValue> serializedValue = injectedScript.wrapForConsole(m_arguments[i]); - if (!jsonArgs.set(i, serializedValue.get())) { + RefPtr<InspectorValue> inspectorValue = injectedScript.wrapForConsole(m_arguments[i]); + if (!inspectorValue) { ASSERT_NOT_REACHED(); return; } + jsonArgs->push(inspectorValue); } - jsonObj.set("parameters", jsonArgs); + jsonObj->set("parameters", jsonArgs); } if (!m_frames.isEmpty()) { - ScriptArray frames = frontend->newScriptArray(); + RefPtr<InspectorArray> frames = InspectorArray::create(); for (unsigned i = 0; i < m_frames.size(); i++) - frames.set(i, m_frames.at(i).buildObject(frontend)); - jsonObj.set("stackTrace", frames); + frames->push(m_frames.at(i).buildInspectorObject()); + jsonObj->set("stackTrace", frames); } frontend->addConsoleMessage(jsonObj); } -void ConsoleMessage::updateRepeatCountInConsole(InspectorFrontend* frontend) +void ConsoleMessage::updateRepeatCountInConsole(RemoteInspectorFrontend* frontend) { frontend->updateConsoleMessageRepeatCount(m_repeatCount); } diff --git a/WebCore/inspector/ConsoleMessage.h b/WebCore/inspector/ConsoleMessage.h index 3848dbf..cb5e6f0 100644 --- a/WebCore/inspector/ConsoleMessage.h +++ b/WebCore/inspector/ConsoleMessage.h @@ -40,7 +40,8 @@ namespace WebCore { class InjectedScriptHost; -class InspectorFrontend; +class InspectorObject; +class RemoteInspectorFrontend; class ScriptCallFrame; class ScriptCallStack; class ScriptString; @@ -51,8 +52,8 @@ public: ConsoleMessage(MessageSource, MessageType, MessageLevel, const String& m, ScriptCallStack*, unsigned g, bool storeTrace = false); #if ENABLE(INSPECTOR) - void addToFrontend(InspectorFrontend*, InjectedScriptHost*); - void updateRepeatCountInConsole(InspectorFrontend* frontend); + void addToFrontend(RemoteInspectorFrontend*, InjectedScriptHost*); + void updateRepeatCountInConsole(RemoteInspectorFrontend* frontend); #endif void incrementCount() { ++m_repeatCount; } bool isEqual(ScriptState*, ConsoleMessage* msg) const; @@ -66,7 +67,9 @@ private: explicit CallFrame(const ScriptCallFrame& frame); CallFrame(); bool isEqual(const CallFrame& o) const; - ScriptObject buildObject(InspectorFrontend* frontend) const; +#if ENABLE(INSPECTOR) + PassRefPtr<InspectorObject> buildInspectorObject() const; +#endif private: String m_functionName; diff --git a/WebCore/inspector/InjectedScript.cpp b/WebCore/inspector/InjectedScript.cpp index 2e35e4b..5f2fb74 100644 --- a/WebCore/inspector/InjectedScript.cpp +++ b/WebCore/inspector/InjectedScript.cpp @@ -33,6 +33,7 @@ #if ENABLE(INSPECTOR) +#include "InspectorValues.h" #include "PlatformString.h" #include "SerializedScriptValue.h" #include "ScriptFunctionCall.h" @@ -73,7 +74,7 @@ PassRefPtr<SerializedScriptValue> InjectedScript::callFrames() } #endif -PassRefPtr<SerializedScriptValue> InjectedScript::wrapForConsole(ScriptValue value) +PassRefPtr<InspectorValue> InjectedScript::wrapForConsole(ScriptValue value) { ASSERT(!hasNoValue()); ScriptFunctionCall wrapFunction(m_injectedScriptObject, "wrapObjectForConsole"); @@ -82,8 +83,8 @@ PassRefPtr<SerializedScriptValue> InjectedScript::wrapForConsole(ScriptValue val bool hadException = false; ScriptValue r = wrapFunction.call(hadException); if (hadException) - return SerializedScriptValue::create("<exception>"); - return r.serialize(m_injectedScriptObject.scriptState()); + return InspectorString::create("<exception>"); + return r.toInspectorValue(m_injectedScriptObject.scriptState()); } void InjectedScript::releaseWrapperObjectGroup(const String& objectGroup) diff --git a/WebCore/inspector/InjectedScript.h b/WebCore/inspector/InjectedScript.h index 1e9b787..f6b6e19 100644 --- a/WebCore/inspector/InjectedScript.h +++ b/WebCore/inspector/InjectedScript.h @@ -38,6 +38,7 @@ namespace WebCore { +class InspectorValue; class SerializedScriptValue; class String; @@ -52,7 +53,7 @@ public: #if ENABLE(JAVASCRIPT_DEBUGGER) PassRefPtr<SerializedScriptValue> callFrames(); #endif - PassRefPtr<SerializedScriptValue> wrapForConsole(ScriptValue); + PassRefPtr<InspectorValue> wrapForConsole(ScriptValue); void releaseWrapperObjectGroup(const String&); private: diff --git a/WebCore/inspector/Inspector.idl b/WebCore/inspector/Inspector.idl index 3c96db1..155bfcd 100644 --- a/WebCore/inspector/Inspector.idl +++ b/WebCore/inspector/Inspector.idl @@ -32,6 +32,7 @@ module core { interface [Conditional=INSPECTOR] Inspector { + [notify] void addConsoleMessage(out Object messageObj); [notify] void addRecordToTimeline(out Object record); [notify] void addNodesToSearchResult(out Array nodeIds); [notify] void attributesUpdated(out long id, out Array attributes); @@ -41,6 +42,8 @@ module core { [notify] void setChildNodes(out long parentId, out Array nodes); [notify] void setDetachedRoot(out Object root); [notify] void setDocument(out Value root); + [notify] void updateConsoleMessageExpiredCount(out unsigned long count); + [notify] void updateConsoleMessageRepeatCount(out unsigned long count); void storeLastActivePanel(in String panelName); @@ -117,7 +120,7 @@ module core { void searchCanceled(); void pushNodeByPathToFrontend(in long callId, in String path, out long nodeId); - void clearConsoleMessages(); + void clearConsoleMessages(in long callId); void highlightDOMNode(in long nodeId); void hideDOMNodeHighlight(); @@ -127,7 +130,7 @@ module core { void getInlineStyle(in long callId, in long nodeId, out Value style); void getComputedStyle(in long callId, in long nodeId, out Value style); void getStyleSheet(in long callId, in long styleSheetId, out Value styleSheet); - void getRuleRangesForStyleSheetId(in long callId, in long styleSheetId); + void getRuleRanges(in long callId, in long styleSheetId, out Value ranges); void applyStyleText(in long callId, in long styleId, in String styleText, in String propertyName, out boolean success, out Value style, out Array changedProperties); void setStyleText(in long callId, in long styleId, in String styleText, out boolean success); void setStyleProperty(in long callId, in long styleId, in String name, in String value, out boolean success); diff --git a/WebCore/inspector/InspectorApplicationCacheAgent.cpp b/WebCore/inspector/InspectorApplicationCacheAgent.cpp index 88238be..1ea7556 100644 --- a/WebCore/inspector/InspectorApplicationCacheAgent.cpp +++ b/WebCore/inspector/InspectorApplicationCacheAgent.cpp @@ -28,8 +28,7 @@ #if ENABLE(INSPECTOR) && ENABLE(OFFLINE_WEB_APPLICATIONS) -#include "ApplicationCache.h" -#include "ApplicationCacheResource.h" +#include "ApplicationCacheHost.h" #include "DocumentLoader.h" #include "Frame.h" #include "FrameLoader.h" @@ -63,29 +62,6 @@ void InspectorApplicationCacheAgent::updateNetworkState(bool isNowOnline) m_frontend->updateNetworkState(isNowOnline); } -void InspectorApplicationCacheAgent::fillResourceList(ApplicationCache* cache, ResourceInfoList* resources) -{ -#if !PLATFORM(CHROMIUM) - ASSERT(cache && cache->isComplete()); -#endif - ApplicationCache::ResourceMap::const_iterator end = cache->end(); - for (ApplicationCache::ResourceMap::const_iterator it = cache->begin(); it != end; ++it) { - RefPtr<ApplicationCacheResource> resource = it->second; - unsigned type = resource->type(); - bool isMaster = type & ApplicationCacheResource::Master; - bool isManifest = type & ApplicationCacheResource::Manifest; - bool isExplicit = type & ApplicationCacheResource::Explicit; - bool isForeign = type & ApplicationCacheResource::Foreign; - bool isFallback = type & ApplicationCacheResource::Fallback; -#if PLATFORM(CHROMIUM) - int64_t estimatedSizeInStorage = 0; -#else - int64_t estimatedSizeInStorage = resource->estimatedSizeInStorage(); -#endif - resources->append(InspectorApplicationCacheAgent::ResourceInfo(resource->url(), isMaster, isManifest, isFallback, isForeign, isExplicit, estimatedSizeInStorage)); - } -} - void InspectorApplicationCacheAgent::getApplicationCaches(long callId) { DocumentLoader* documentLoader = m_inspectorController->inspectedPage()->mainFrame()->loader()->documentLoader(); @@ -95,25 +71,15 @@ void InspectorApplicationCacheAgent::getApplicationCaches(long callId) } ApplicationCacheHost* host = documentLoader->applicationCacheHost(); - ApplicationCache* cache = host->applicationCacheForInspector(); - if (!cache -#if !PLATFORM(CHROMIUM) - || !cache->isComplete() -#endif - ) { - m_frontend->didGetApplicationCaches(callId, ScriptValue::undefined()); - return; - } - - // FIXME: Add "Creation Time" and "Update Time" to Application Caches. - ApplicationCacheInfo info(cache->manifestResource()->url(), String(), String(), cache->estimatedSizeInStorage()); - ResourceInfoList resources; - fillResourceList(cache, &resources); + ApplicationCacheHost::CacheInfo info = host->applicationCacheInfo(); + + ApplicationCacheHost::ResourceInfoList resources; + host->fillResourceList(&resources); m_frontend->didGetApplicationCaches(callId, buildObjectForApplicationCache(resources, info)); } -ScriptObject InspectorApplicationCacheAgent::buildObjectForApplicationCache(const ResourceInfoList& applicationCacheResources, const ApplicationCacheInfo& applicationCacheInfo) +ScriptObject InspectorApplicationCacheAgent::buildObjectForApplicationCache(const ApplicationCacheHost::ResourceInfoList& applicationCacheResources, const ApplicationCacheHost::CacheInfo& applicationCacheInfo) { ScriptObject value = m_frontend->newScriptObject(); value.set("size", applicationCacheInfo.m_size); @@ -125,19 +91,19 @@ ScriptObject InspectorApplicationCacheAgent::buildObjectForApplicationCache(cons return value; } -ScriptArray InspectorApplicationCacheAgent::buildArrayForApplicationCacheResources(const ResourceInfoList& applicationCacheResources) +ScriptArray InspectorApplicationCacheAgent::buildArrayForApplicationCacheResources(const ApplicationCacheHost::ResourceInfoList& applicationCacheResources) { ScriptArray resources = m_frontend->newScriptArray(); - ResourceInfoList::const_iterator end = applicationCacheResources.end(); - ResourceInfoList::const_iterator it = applicationCacheResources.begin(); + ApplicationCacheHost::ResourceInfoList::const_iterator end = applicationCacheResources.end(); + ApplicationCacheHost::ResourceInfoList::const_iterator it = applicationCacheResources.begin(); for (int i = 0; it != end; ++it, i++) resources.set(i, buildObjectForApplicationCacheResource(*it)); return resources; } -ScriptObject InspectorApplicationCacheAgent::buildObjectForApplicationCacheResource(const ResourceInfo& resourceInfo) +ScriptObject InspectorApplicationCacheAgent::buildObjectForApplicationCacheResource(const ApplicationCacheHost::ResourceInfo& resourceInfo) { ScriptObject value = m_frontend->newScriptObject(); value.set("name", resourceInfo.m_resource.string()); diff --git a/WebCore/inspector/InspectorApplicationCacheAgent.h b/WebCore/inspector/InspectorApplicationCacheAgent.h index 79763f4..33cc2ed 100644 --- a/WebCore/inspector/InspectorApplicationCacheAgent.h +++ b/WebCore/inspector/InspectorApplicationCacheAgent.h @@ -28,13 +28,10 @@ #if ENABLE(INSPECTOR) && ENABLE(OFFLINE_WEB_APPLICATIONS) #include "ApplicationCacheHost.h" -#include "KURL.h" -#include "PlatformString.h" #include <wtf/Noncopyable.h> namespace WebCore { -class ApplicationCache; class InspectorController; class InspectorFrontend; class ResourceResponse; @@ -43,44 +40,6 @@ class ScriptObject; class InspectorApplicationCacheAgent : public Noncopyable { public: - struct ApplicationCacheInfo { - ApplicationCacheInfo(const KURL& manifest, const String& creationTime, const String& updateTime, long long size) - : m_manifest(manifest) - , m_creationTime(creationTime) - , m_updateTime(updateTime) - , m_size(size) - { - } - - KURL m_manifest; - String m_creationTime; - String m_updateTime; - long long m_size; - }; - - struct ResourceInfo { - ResourceInfo(const KURL& resource, bool isMaster, bool isManifest, bool isFallback, bool isForeign, bool isExplicit, long long size) - : m_resource(resource) - , m_isMaster(isMaster) - , m_isManifest(isManifest) - , m_isFallback(isFallback) - , m_isForeign(isForeign) - , m_isExplicit(isExplicit) - , m_size(size) - { - } - - KURL m_resource; - bool m_isMaster; - bool m_isManifest; - bool m_isFallback; - bool m_isForeign; - bool m_isExplicit; - long long m_size; - }; - - typedef Vector<ResourceInfo> ResourceInfoList; - InspectorApplicationCacheAgent(InspectorController* inspectorController, InspectorFrontend* frontend); ~InspectorApplicationCacheAgent() { } @@ -93,11 +52,9 @@ public: void getApplicationCaches(long callId); private: - ScriptObject buildObjectForApplicationCache(const ResourceInfoList&, const ApplicationCacheInfo&); - ScriptArray buildArrayForApplicationCacheResources(const ResourceInfoList&); - ScriptObject buildObjectForApplicationCacheResource(const ResourceInfo&); - - void fillResourceList(ApplicationCache*, ResourceInfoList*); + ScriptObject buildObjectForApplicationCache(const ApplicationCacheHost::ResourceInfoList&, const ApplicationCacheHost::CacheInfo&); + ScriptArray buildArrayForApplicationCacheResources(const ApplicationCacheHost::ResourceInfoList&); + ScriptObject buildObjectForApplicationCacheResource(const ApplicationCacheHost::ResourceInfo&); InspectorController* m_inspectorController; InspectorFrontend* m_frontend; diff --git a/WebCore/inspector/InspectorBackend.cpp b/WebCore/inspector/InspectorBackend.cpp index 9f71307..f27b812 100644 --- a/WebCore/inspector/InspectorBackend.cpp +++ b/WebCore/inspector/InspectorBackend.cpp @@ -49,6 +49,7 @@ #include "InspectorResource.h" #include "Page.h" #include "Pasteboard.h" +#include "RemoteInspectorFrontend.h" #include "ScriptArray.h" #include "ScriptBreakpoint.h" #include "SerializedScriptValue.h" @@ -412,10 +413,13 @@ void InspectorBackend::pushNodeByPathToFrontend(long callId, const String& path) domAgent->pushNodeByPathToFrontend(callId, path); } -void InspectorBackend::clearConsoleMessages() +void InspectorBackend::clearConsoleMessages(long callId) { - if (m_inspectorController) + if (m_inspectorController) { m_inspectorController->clearConsoleMessages(); + if (RemoteInspectorFrontend* frontend = remoteFrontend()) + frontend->didClearConsoleMessages(callId); + } } void InspectorBackend::getStyles(long callId, long nodeId, bool authorOnly) @@ -448,10 +452,10 @@ void InspectorBackend::getStyleSheet(long callId, long styleSheetId) domAgent->getStyleSheet(callId, styleSheetId); } -void InspectorBackend::getRuleRangesForStyleSheetId(long callId, long styleSheetId) +void InspectorBackend::getRuleRanges(long callId, long styleSheetId) { if (InspectorDOMAgent* domAgent = inspectorDOMAgent()) - domAgent->getRuleRangesForStyleSheetId(callId, styleSheetId); + domAgent->getRuleRanges(callId, styleSheetId); } void InspectorBackend::applyStyleText(long callId, long styleId, const String& styleText, const String& propertyName) @@ -597,6 +601,13 @@ InspectorFrontend* InspectorBackend::inspectorFrontend() return m_inspectorController->m_frontend.get(); } +RemoteInspectorFrontend* InspectorBackend::remoteFrontend() +{ + if (!m_inspectorController) + return 0; + return m_inspectorController->m_remoteFrontend.get(); +} + void InspectorBackend::addScriptToEvaluateOnLoad(const String& source) { if (m_inspectorController) diff --git a/WebCore/inspector/InspectorBackend.h b/WebCore/inspector/InspectorBackend.h index 78d34b6..16d53c0 100644 --- a/WebCore/inspector/InspectorBackend.h +++ b/WebCore/inspector/InspectorBackend.h @@ -43,6 +43,7 @@ class InspectorApplicationCacheAgent; class InspectorDOMAgent; class InspectorFrontend; class Node; +class RemoteInspectorFrontend; class Storage; class InspectorBackend : public RefCounted<InspectorBackend> @@ -133,14 +134,14 @@ public: void searchCanceled(); void pushNodeByPathToFrontend(long callId, const String& path); - void clearConsoleMessages(); + void clearConsoleMessages(long callId); void getStyles(long callId, long nodeId, bool authOnly); void getAllStyles(long callId); void getInlineStyle(long callId, long nodeId); void getComputedStyle(long callId, long nodeId); void getStyleSheet(long callId, long styleSheetId); - void getRuleRangesForStyleSheetId(long callId, long styleSheetId); + void getRuleRanges(long callId, long styleSheetId); void applyStyleText(long callId, long styleId, const String& styleText, const String& propertyName); void setStyleText(long callId, long styleId, const String& cssText); void setStyleProperty(long callId, long styleId, const String& name, const String& value); @@ -179,6 +180,7 @@ private: InspectorApplicationCacheAgent* inspectorApplicationCacheAgent(); #endif InspectorFrontend* inspectorFrontend(); + RemoteInspectorFrontend* remoteFrontend(); Node* nodeForId(long nodeId); InspectorController* m_inspectorController; diff --git a/WebCore/inspector/InspectorBackend.idl b/WebCore/inspector/InspectorBackend.idl deleted file mode 100644 index 3c460a1..0000000 --- a/WebCore/inspector/InspectorBackend.idl +++ /dev/null @@ -1,148 +0,0 @@ -/* - * Copyright (C) 2007, 2008 Apple Inc. All rights reserved. - * Copyright (C) 2008 Matt Lilek <webkit@mattlilek.com> - * Copyright (C) 2009 Google Inc. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above - * copyright notice, this list of conditions and the following disclaimer - * in the documentation and/or other materials provided with the - * distribution. - * * Neither the name of Google Inc. nor the names of its - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -module core { - interface [Conditional=INSPECTOR] InspectorBackend { - void storeLastActivePanel(in DOMString panelName); - - void saveApplicationSettings(in DOMString settings); - void saveSessionSettings(in DOMString settings); - - void enableSearchingForNode(); - void disableSearchingForNode(); - - void enableMonitoringXHR(); - void disableMonitoringXHR(); - - void enableResourceTracking(in boolean always); - void disableResourceTracking(in boolean always); - void getResourceContent(in long callId, in unsigned long identifier); - void reloadPage(); - - void startTimelineProfiler(); - void stopTimelineProfiler(); - -#if defined(ENABLE_JAVASCRIPT_DEBUGGER) && ENABLE_JAVASCRIPT_DEBUGGER - void enableDebugger(in boolean always); - void disableDebugger(in boolean always); - - void setBreakpoint(in long callId, in DOMString sourceID, in unsigned long lineNumber, in boolean enabled, in DOMString condition); - void removeBreakpoint(in DOMString sourceID, in unsigned long lineNumber); - void activateBreakpoints(); - void deactivateBreakpoints(); - - void pause(); - void resume(); - - void stepOverStatement(); - void stepIntoStatement(); - void stepOutOfFunction(); - - void setPauseOnExceptionsState(in long pauseOnExceptionsState); - - void editScriptSource(in long callId, in DOMString sourceID, in DOMString newContent); - void getScriptSource(in long callId, in DOMString sourceID); - - void enableProfiler(in boolean always); - void disableProfiler(in boolean always); - - void startProfiling(); - void stopProfiling(); - - void getProfileHeaders(in long callId); - void getProfile(in long callId, in unsigned long uid); - - void removeProfile(in unsigned long uid); - void clearProfiles(); - - void takeHeapSnapshot(); -#endif - void setInjectedScriptSource(in DOMString scriptSource); - void dispatchOnInjectedScript(in long callId, in long injectedScriptId, in DOMString methodName, in DOMString arguments, in boolean async); - - void addScriptToEvaluateOnLoad(in DOMString scriptSource); - void removeAllScriptsToEvaluateOnLoad(); - - void getChildNodes(in long callId, in long nodeId); - void setAttribute(in long callId, in long elementId, in DOMString name, in DOMString value); - void removeAttribute(in long callId, in long elementId, in DOMString name); - void setTextNodeValue(in long callId, in long nodeId, in DOMString value); - void getEventListenersForNode(in long callId, in long nodeId); - void copyNode(in long nodeId); - void removeNode(in long callId, in long nodeId); - void changeTagName(in long callId, in long nodeId, in DOMString newTagName); - void getOuterHTML(in long callId, in long nodeId); - void setOuterHTML(in long callId, in long nodeId, in DOMString outerHTML); - void addInspectedNode(in long nodeId); - void performSearch(in DOMString query, in boolean runSynchronously); - void searchCanceled(); - void pushNodeByPathToFrontend(in long callId, in DOMString path); - - void clearConsoleMessages(); - - void highlightDOMNode(in long nodeId); - void hideDOMNodeHighlight(); - - void getStyles(in long callId, in long nodeId, in boolean authOnly); - void getAllStyles(in long callId); - void getInlineStyle(in long callId, in long nodeId); - void getComputedStyle(in long callId, in long nodeId); - void getStyleSheet(in long callId, in long styleSheetId); - void getRuleRangesForStyleSheetId(in long callId, in long styleSheetId); - void applyStyleText(in long callId, in long styleId, in DOMString styleText, in DOMString propertyName); - void setStyleText(in long callId, in long styleId, in DOMString styleText); - void setStyleProperty(in long callId, in long styleId, in DOMString name, in DOMString value); - void toggleStyleEnabled(in long callId, in long styleId, in DOMString propertyName, in boolean disabled); - void setRuleSelector(in long callId, in long ruleId, in DOMString selector, in long selectedNodeId); - void addRule(in long callId, in DOMString selector, in long selectedNodeId); - - void getCookies(in long callId); - void deleteCookie(in DOMString cookieName, in DOMString domain); - -#if defined(ENABLE_OFFLINE_WEB_APPLICATIONS) - void getApplicationCaches(in long callId); -#endif - - void releaseWrapperObjectGroup(in long injectedScriptId, in DOMString objectGroup); - void didEvaluateForTestInFrontend(in long callId, in DOMString jsonResult); - -#if defined(ENABLE_DATABASE) && ENABLE_DATABASE - void getDatabaseTableNames(in long callId, in long databaseId); -#endif - -#if defined(ENABLE_DOM_STORAGE) && ENABLE_DOM_STORAGE - void getDOMStorageEntries(in long callId, in long storageId); - void setDOMStorageItem(in long callId, in long storageId, in DOMString key, in DOMString value); - void removeDOMStorageItem(in long callId, in long storageId, in DOMString key); -#endif - }; -} diff --git a/WebCore/inspector/InspectorCSSStore.cpp b/WebCore/inspector/InspectorCSSStore.cpp index 9dffef9..d098230 100644 --- a/WebCore/inspector/InspectorCSSStore.cpp +++ b/WebCore/inspector/InspectorCSSStore.cpp @@ -109,13 +109,12 @@ CSSStyleSheet* InspectorCSSStore::inspectorStyleSheet(Document* ownerDocument, b return inspectorStyleSheet; } -HashMap<long, SourceRange> InspectorCSSStore::getRuleRangesForStyleSheet(CSSStyleSheet* styleSheet) +HashMap<long, SourceRange> InspectorCSSStore::getRuleRanges(CSSStyleSheet* styleSheet) { if (!styleSheet) return HashMap<long, SourceRange>(); RefPtr<CSSRuleList> originalRuleList = CSSRuleList::create(styleSheet, false); StyleSheetToOffsetsMap::iterator it = m_styleSheetToOffsets.find(styleSheet); - HashMap<long, SourceRange> result; Vector<SourceRange>* offsetVector = 0; if (it == m_styleSheetToOffsets.end()) { InspectorResource* resource = m_inspectorController->resourceForURL(styleSheet->finalURL().string()); @@ -139,13 +138,16 @@ HashMap<long, SourceRange> InspectorCSSStore::getRuleRangesForStyleSheet(CSSStyl offsetVector = it->second; if (!offsetVector) return HashMap<long, SourceRange>(); + unsigned ruleIndex = 0; + HashMap<long, SourceRange> result; for (unsigned i = 0, length = styleSheet->length(); i < length; ++i) { ASSERT(ruleIndex < offsetVector->size()); CSSStyleRule* rule = asCSSStyleRule(styleSheet->item(i)); if (!rule) continue; - result.set(bindRule(rule), offsetVector->at(ruleIndex)); + // This maps the style id to the rule body range. + result.set(bindStyle(rule->style()), offsetVector->at(ruleIndex)); ruleIndex++; } return result; diff --git a/WebCore/inspector/InspectorCSSStore.h b/WebCore/inspector/InspectorCSSStore.h index 4b7ef51..4f7df00 100644 --- a/WebCore/inspector/InspectorCSSStore.h +++ b/WebCore/inspector/InspectorCSSStore.h @@ -66,7 +66,7 @@ public: InspectorCSSStore(InspectorController* inspectorController); ~InspectorCSSStore(); void reset(); - HashMap<long, SourceRange> getRuleRangesForStyleSheet(CSSStyleSheet*); + HashMap<long, SourceRange> getRuleRanges(CSSStyleSheet*); CSSStyleDeclaration* styleForId(long styleId); CSSStyleSheet* styleSheetForId(long styleSheetId); CSSStyleRule* ruleForId(long styleRuleId); diff --git a/WebCore/inspector/InspectorController.cpp b/WebCore/inspector/InspectorController.cpp index 8879b8e..e29c7ae 100644 --- a/WebCore/inspector/InspectorController.cpp +++ b/WebCore/inspector/InspectorController.cpp @@ -55,6 +55,7 @@ #include "InjectedScript.h" #include "InjectedScriptHost.h" #include "InspectorBackend.h" +#include "InspectorBackendDispatcher.h" #include "InspectorCSSStore.h" #include "InspectorClient.h" #include "InspectorFrontendClient.h" @@ -112,6 +113,7 @@ #include <runtime/UString.h> #include "JSScriptProfile.h" #else +#include "ScriptScope.h" #include "V8ScriptProfile.h" #endif #endif @@ -192,6 +194,7 @@ InspectorController::InspectorController(Page* page, InspectorClient* client) , m_resourceTrackingEnabled(false) , m_settingsLoaded(false) , m_inspectorBackend(InspectorBackend::create(this)) + , m_inspectorBackendDispatcher(new InspectorBackendDispatcher(m_inspectorBackend.get())) , m_injectedScriptHost(InjectedScriptHost::create(this)) #if ENABLE(JAVASCRIPT_DEBUGGER) , m_debuggerEnabled(false) @@ -363,12 +366,12 @@ void InspectorController::addConsoleMessage(ScriptState* scriptState, PassOwnPtr if (m_previousMessage && m_previousMessage->isEqual(scriptState, consoleMessage.get())) { m_previousMessage->incrementCount(); if (m_frontend) - m_previousMessage->updateRepeatCountInConsole(m_frontend.get()); + m_previousMessage->updateRepeatCountInConsole(m_remoteFrontend.get()); } else { m_previousMessage = consoleMessage.get(); m_consoleMessages.append(consoleMessage); if (m_frontend) - m_previousMessage->addToFrontend(m_frontend.get(), m_injectedScriptHost.get()); + m_previousMessage->addToFrontend(m_remoteFrontend.get(), m_injectedScriptHost.get()); } if (!m_frontend && m_consoleMessages.size() >= maximumConsoleMessages) { @@ -386,8 +389,6 @@ void InspectorController::clearConsoleMessages() m_injectedScriptHost->releaseWrapperObjectGroup(0 /* release the group in all scripts */, "console"); if (m_domAgent) m_domAgent->releaseDanglingNodes(); - if (m_frontend) - m_frontend->clearConsoleMessages(); } void InspectorController::startGroup(MessageSource source, ScriptCallStack* callStack, bool collapsed) @@ -656,10 +657,10 @@ void InspectorController::populateScriptObjects() m_domAgent->setDocument(m_inspectedPage->mainFrame()->document()); if (m_expiredConsoleMessageCount) - m_frontend->updateConsoleMessageExpiredCount(m_expiredConsoleMessageCount); + m_remoteFrontend->updateConsoleMessageExpiredCount(m_expiredConsoleMessageCount); unsigned messageCount = m_consoleMessages.size(); for (unsigned i = 0; i < messageCount; ++i) - m_consoleMessages[i]->addToFrontend(m_frontend.get(), m_injectedScriptHost.get()); + m_consoleMessages[i]->addToFrontend(m_remoteFrontend.get(), m_injectedScriptHost.get()); #if ENABLE(JAVASCRIPT_DEBUGGER) if (m_debuggerEnabled) @@ -1560,12 +1561,14 @@ void InspectorController::getProfile(long callId, unsigned uid) if (!m_frontend) return; ProfilesMap::iterator it = m_profiles.find(uid); - if (it != m_profiles.end()) + if (it != m_profiles.end()) { #if USE(JSC) m_frontend->didGetProfile(callId, toJS(m_frontend->scriptState(), it->second.get())); #else + ScriptScope scope(m_frontend->scriptState()); m_frontend->didGetProfile(callId, toV8(it->second.get())); #endif + } } ScriptObject InspectorController::createProfileHeader(const ScriptProfile& profile) diff --git a/WebCore/inspector/InspectorController.h b/WebCore/inspector/InspectorController.h index 76b88f1..176dd11 100644 --- a/WebCore/inspector/InspectorController.h +++ b/WebCore/inspector/InspectorController.h @@ -64,6 +64,7 @@ class HitTestResult; class InjectedScript; class InjectedScriptHost; class InspectorBackend; +class InspectorBackendDispatcher; class InspectorClient; class InspectorCSSStore; class InspectorDOMStorageResource; @@ -120,6 +121,7 @@ public: ~InspectorController(); InspectorBackend* inspectorBackend() { return m_inspectorBackend.get(); } + InspectorBackendDispatcher* inspectorBackendDispatcher() { return m_inspectorBackendDispatcher.get(); } InjectedScriptHost* injectedScriptHost() { return m_injectedScriptHost.get(); } void inspectedPageDestroyed(); @@ -395,6 +397,7 @@ private: bool m_resourceTrackingEnabled; bool m_settingsLoaded; RefPtr<InspectorBackend> m_inspectorBackend; + OwnPtr<InspectorBackendDispatcher> m_inspectorBackendDispatcher; RefPtr<InjectedScriptHost> m_injectedScriptHost; typedef HashMap<String, String> Settings; diff --git a/WebCore/inspector/InspectorDOMAgent.cpp b/WebCore/inspector/InspectorDOMAgent.cpp index e3d1bf5..3a14830 100644 --- a/WebCore/inspector/InspectorDOMAgent.cpp +++ b/WebCore/inspector/InspectorDOMAgent.cpp @@ -1075,11 +1075,11 @@ void InspectorDOMAgent::getStyleSheet(long callId, long styleSheetId) m_frontend->didGetStyleSheet(callId, InspectorObject::create()); } -void InspectorDOMAgent::getRuleRangesForStyleSheetId(long callId, long styleSheetId) +void InspectorDOMAgent::getRuleRanges(long callId, long styleSheetId) { CSSStyleSheet* styleSheet = cssStore()->styleSheetForId(styleSheetId); if (styleSheet && styleSheet->doc()) { - HashMap<long, SourceRange> ruleRanges = cssStore()->getRuleRangesForStyleSheet(styleSheet); + HashMap<long, SourceRange> ruleRanges = cssStore()->getRuleRanges(styleSheet); if (!ruleRanges.size()) { m_frontend->didGetStyleSheet(callId, InspectorObject::create()); return; @@ -1095,9 +1095,9 @@ void InspectorDOMAgent::getRuleRangesForStyleSheetId(long callId, long styleShee bodyRange->setNumber("end", it->second.second); } } - m_frontend->didGetStyleSheet(callId, result); + m_frontend->didGetRuleRanges(callId, result); } else - m_frontend->didGetStyleSheet(callId, InspectorValue::null()); + m_frontend->didGetRuleRanges(callId, InspectorValue::null()); } void InspectorDOMAgent::getInlineStyle(long callId, long nodeId) diff --git a/WebCore/inspector/InspectorDOMAgent.h b/WebCore/inspector/InspectorDOMAgent.h index 5db837b..38b7034 100644 --- a/WebCore/inspector/InspectorDOMAgent.h +++ b/WebCore/inspector/InspectorDOMAgent.h @@ -119,7 +119,7 @@ namespace WebCore { void getInlineStyle(long callId, long nodeId); void getComputedStyle(long callId, long nodeId); void getStyleSheet(long callId, long styleSheetId); - void getRuleRangesForStyleSheetId(long callId, long styleSheetId); + void getRuleRanges(long callId, long styleSheetId); void applyStyleText(long callId, long styleId, const String& styleText, const String& propertyName); void setStyleText(long callId, long styleId, const String& cssText); void setStyleProperty(long callId, long styleId, const String& name, const String& value); diff --git a/WebCore/inspector/InspectorFrontendClient.h b/WebCore/inspector/InspectorFrontendClient.h index 515388c..c20eb10 100644 --- a/WebCore/inspector/InspectorFrontendClient.h +++ b/WebCore/inspector/InspectorFrontendClient.h @@ -59,6 +59,8 @@ public: virtual void changeAttachedWindowHeight(unsigned) = 0; virtual void inspectedURLChanged(const String&) = 0; + + virtual void sendMessageToBackend(const String&) = 0; }; } // namespace WebCore diff --git a/WebCore/inspector/InspectorFrontendClientLocal.cpp b/WebCore/inspector/InspectorFrontendClientLocal.cpp index 16a6a8b..f6f7811 100644 --- a/WebCore/inspector/InspectorFrontendClientLocal.cpp +++ b/WebCore/inspector/InspectorFrontendClientLocal.cpp @@ -37,6 +37,7 @@ #include "FloatRect.h" #include "Frame.h" #include "FrameView.h" +#include "InspectorBackendDispatcher.h" #include "InspectorController.h" #include "InspectorFrontend.h" #include "InspectorFrontendHost.h" @@ -70,11 +71,8 @@ InspectorFrontendClientLocal::~InspectorFrontendClientLocal() void InspectorFrontendClientLocal::windowObjectCleared() { - // Grant the inspector the ability to script the inspected page. - m_frontendPage->mainFrame()->document()->securityOrigin()->grantUniversalAccess(); // FIXME: don't keep reference to the script state m_frontendScriptState = scriptStateFromPage(debuggerWorld(), m_frontendPage); - ScriptGlobalObject::set(m_frontendScriptState, "InspectorBackend", m_inspectorController->inspectorBackend()); m_frontendHost = InspectorFrontendHost::create(this, m_frontendPage); ScriptGlobalObject::set(m_frontendScriptState, "InspectorFrontendHost", m_frontendHost.get()); } @@ -161,7 +159,12 @@ unsigned InspectorFrontendClientLocal::constrainedAttachedWindowHeight(unsigned using namespace std; return roundf(max(minimumAttachedHeight, min<float>(preferredHeight, totalWindowHeight * maximumAttachedHeightRatio))); } - + +void InspectorFrontendClientLocal::sendMessageToBackend(const String& message) +{ + m_inspectorController->inspectorBackendDispatcher()->dispatch(message); +} + } // namespace WebCore #endif diff --git a/WebCore/inspector/InspectorFrontendClientLocal.h b/WebCore/inspector/InspectorFrontendClientLocal.h index ce661fe..9dcaa5a 100644 --- a/WebCore/inspector/InspectorFrontendClientLocal.h +++ b/WebCore/inspector/InspectorFrontendClientLocal.h @@ -59,6 +59,8 @@ public: virtual void detachWindow() = 0; bool canAttachWindow(); + virtual void sendMessageToBackend(const String& message); + protected: virtual void setAttachedWindowHeight(unsigned) = 0; void setAttachedWindow(bool); diff --git a/WebCore/inspector/InspectorFrontendHost.cpp b/WebCore/inspector/InspectorFrontendHost.cpp index 70fc3ad..6957dd1 100644 --- a/WebCore/inspector/InspectorFrontendHost.cpp +++ b/WebCore/inspector/InspectorFrontendHost.cpp @@ -207,6 +207,11 @@ void InspectorFrontendHost::copyText(const String& text) Pasteboard::generalPasteboard()->writePlainText(text); } +void InspectorFrontendHost::sendMessageToBackend(const String& message) +{ + m_client->sendMessageToBackend(message); +} + #if ENABLE(CONTEXT_MENUS) void InspectorFrontendHost::showContextMenu(Event* event, const Vector<ContextMenuItem*>& items) { diff --git a/WebCore/inspector/InspectorFrontendHost.h b/WebCore/inspector/InspectorFrontendHost.h index 4d3e0d1..7fb4a1e 100644 --- a/WebCore/inspector/InspectorFrontendHost.h +++ b/WebCore/inspector/InspectorFrontendHost.h @@ -75,6 +75,7 @@ public: // Called from [Custom] implementations. void showContextMenu(Event*, const Vector<ContextMenuItem*>& items); + void sendMessageToBackend(const String& message); private: #if ENABLE(CONTEXT_MENUS) diff --git a/WebCore/inspector/InspectorFrontendHost.idl b/WebCore/inspector/InspectorFrontendHost.idl index 1139a1c..d1b3604 100644 --- a/WebCore/inspector/InspectorFrontendHost.idl +++ b/WebCore/inspector/InspectorFrontendHost.idl @@ -50,5 +50,6 @@ module core { [Custom] DOMString platform(); [Custom] DOMString port(); [Custom] void showContextMenu(in MouseEvent event, in DOMObject items); + void sendMessageToBackend(in DOMString message); }; } diff --git a/WebCore/inspector/InspectorResource.cpp b/WebCore/inspector/InspectorResource.cpp index 6a5919c..69618c3 100644 --- a/WebCore/inspector/InspectorResource.cpp +++ b/WebCore/inspector/InspectorResource.cpp @@ -283,7 +283,7 @@ InspectorResource::Type InspectorResource::type() const if (!m_overrideContent.isNull()) return m_overrideContentType; - if (m_requestURL == m_loader->requestURL()) { + if (equalIgnoringFragmentIdentifier(m_requestURL, m_loader->requestURL())) { InspectorResource::Type resourceType = cachedResourceType(); if (resourceType == Other) return Doc; @@ -291,7 +291,7 @@ InspectorResource::Type InspectorResource::type() const return resourceType; } - if (m_loader->frameLoader() && m_requestURL == m_loader->frameLoader()->iconURL()) + if (m_loader->frameLoader() && equalIgnoringFragmentIdentifier(m_requestURL, m_loader->frameLoader()->iconURL())) return Image; return cachedResourceType(); @@ -322,7 +322,7 @@ String InspectorResource::sourceString() const PassRefPtr<SharedBuffer> InspectorResource::resourceData(String* textEncodingName) const { - if (m_requestURL == m_loader->requestURL()) { + if (equalIgnoringFragmentIdentifier(m_requestURL, m_loader->requestURL())) { *textEncodingName = m_frame->document()->inputEncoding(); return m_loader->mainResourceData(); } @@ -394,12 +394,17 @@ ScriptObject InspectorResource::buildObjectForTiming(InspectorFrontend* frontend { ScriptObject jsonObject = frontend->newScriptObject(); jsonObject.set("requestTime", timing->requestTime); - jsonObject.set("proxyDuration", timing->proxyStart == -1 ? -1 : (timing->proxyEnd - timing->proxyStart) / 1000.0); - jsonObject.set("dnsDuration", timing->dnsStart == -1 ? -1 : (timing->dnsEnd - timing->dnsStart) / 1000.0); - jsonObject.set("connectDuration", timing->connectStart == -1 ? -1 : (timing->connectEnd - timing->connectStart) / 1000.0); - jsonObject.set("sslDuration", timing->sslStart == -1 ? -1 : (timing->sslEnd - timing->sslStart) / 1000.0); - jsonObject.set("sendDuration", (timing->sendEnd - timing->sendStart) / 1000.0); - jsonObject.set("waitDuration", (timing->receiveHeadersEnd - timing->sendEnd) / 1000.0); + jsonObject.set("proxyStart", timing->proxyStart); + jsonObject.set("proxyEnd", timing->proxyEnd); + jsonObject.set("dnsStart", timing->dnsStart); + jsonObject.set("dnsEnd", timing->dnsEnd); + jsonObject.set("connectStart", timing->connectStart); + jsonObject.set("connectEnd", timing->connectEnd); + jsonObject.set("sslStart", timing->sslStart); + jsonObject.set("sslEnd", timing->sslEnd); + jsonObject.set("sendStart", timing->sendStart); + jsonObject.set("sendEnd", timing->sendEnd); + jsonObject.set("receiveHeadersEnd", timing->receiveHeadersEnd); return jsonObject; } diff --git a/WebCore/inspector/InspectorValues.cpp b/WebCore/inspector/InspectorValues.cpp index 90a40f9..d488b50 100644 --- a/WebCore/inspector/InspectorValues.cpp +++ b/WebCore/inspector/InspectorValues.cpp @@ -484,6 +484,16 @@ bool InspectorValue::asNumber(double*) const return false; } +bool InspectorValue::asNumber(long*) const +{ + return false; +} + +bool InspectorValue::asNumber(unsigned long*) const +{ + return false; +} + bool InspectorValue::asString(String*) const { return false; @@ -540,6 +550,23 @@ bool InspectorBasicValue::asNumber(double* output) const return true; } +bool InspectorBasicValue::asNumber(long* output) const +{ + if (type() != TypeDouble) + return false; + *output = static_cast<long>(m_doubleValue); + return true; +} + +bool InspectorBasicValue::asNumber(unsigned long* output) const +{ + if (type() != TypeDouble) + return false; + *output = static_cast<unsigned long>(m_doubleValue); + return true; +} + + void InspectorBasicValue::writeJSON(Vector<UChar>* output) const { ASSERT(type() == TypeBoolean || type() == TypeDouble); diff --git a/WebCore/inspector/InspectorValues.h b/WebCore/inspector/InspectorValues.h index a0c0c2d..940bab9 100644 --- a/WebCore/inspector/InspectorValues.h +++ b/WebCore/inspector/InspectorValues.h @@ -69,6 +69,8 @@ public: virtual bool asBool(bool* output) const; virtual bool asNumber(double* output) const; + virtual bool asNumber(long* output) const; + virtual bool asNumber(unsigned long* output) const; virtual bool asString(String* output) const; virtual PassRefPtr<InspectorObject> asObject(); virtual PassRefPtr<InspectorArray> asArray(); @@ -105,6 +107,8 @@ public: virtual bool asBool(bool* output) const; virtual bool asNumber(double* output) const; + virtual bool asNumber(long* output) const; + virtual bool asNumber(unsigned long* output) const; virtual void writeJSON(Vector<UChar>* output) const; diff --git a/WebCore/inspector/front-end/ConsoleView.js b/WebCore/inspector/front-end/ConsoleView.js index d4119a1..e16c89e 100644 --- a/WebCore/inspector/front-end/ConsoleView.js +++ b/WebCore/inspector/front-end/ConsoleView.js @@ -296,7 +296,7 @@ WebInspector.ConsoleView.prototype = { requestClearMessages: function() { - InspectorBackend.clearConsoleMessages(); + InspectorBackend.clearConsoleMessages(WebInspector.Callback.wrap(this.clearMessages.bind(this))); }, clearMessages: function() @@ -1127,3 +1127,5 @@ WebInspector.ConsoleGroup.prototype = { event.preventDefault(); } } + +WebInspector.didClearConsoleMessages = WebInspector.Callback.processCallback; diff --git a/WebCore/inspector/front-end/DOMAgent.js b/WebCore/inspector/front-end/DOMAgent.js index 07b16b1..bcbe91e 100644 --- a/WebCore/inspector/front-end/DOMAgent.js +++ b/WebCore/inspector/front-end/DOMAgent.js @@ -698,6 +698,7 @@ WebInspector.didGetEventListenersForNode = WebInspector.Callback.processCallback WebInspector.didGetStyles = WebInspector.Callback.processCallback; WebInspector.didGetAllStyles = WebInspector.Callback.processCallback; WebInspector.didGetStyleSheet = WebInspector.Callback.processCallback; +WebInspector.didGetRuleRanges = WebInspector.Callback.processCallback; WebInspector.didGetInlineStyle = WebInspector.Callback.processCallback; WebInspector.didGetComputedStyle = WebInspector.Callback.processCallback; WebInspector.didApplyStyleText = WebInspector.Callback.processCallback; diff --git a/WebCore/inspector/front-end/ElementsPanel.js b/WebCore/inspector/front-end/ElementsPanel.js index 48eb4c0..ec9559f 100644 --- a/WebCore/inspector/front-end/ElementsPanel.js +++ b/WebCore/inspector/front-end/ElementsPanel.js @@ -222,7 +222,7 @@ WebInspector.ElementsPanel.prototype = { if (this._selectedPathOnReset) { var callId = WebInspector.Callback.wrap(selectLastSelectedNode.bind(this)); - InspectorBackend.pushNodeByPathToFrontend(callId, this._selectedPathOnReset); + InspectorBackend.pushNodeByPathToFrontend(callId, this._selectedPathOnReset.join(",")); } else selectNode.call(this); delete this._selectedPathOnReset; diff --git a/WebCore/inspector/front-end/InjectedScript.js b/WebCore/inspector/front-end/InjectedScript.js index 9e16dad..ce187d2 100644 --- a/WebCore/inspector/front-end/InjectedScript.js +++ b/WebCore/inspector/front-end/InjectedScript.js @@ -388,7 +388,7 @@ InjectedScript.createProxyObject = function(object, objectId, abbreviate) var type = typeof object; - result.hasChildren = (type === "object" && object !== null && (Object.getOwnPropertyNames(object).length || object.__proto__)) || type === "function"; + result.hasChildren = (type === "object" && object !== null && (Object.getOwnPropertyNames(object).length || !!object.__proto__)) || type === "function"; try { result.description = InjectedScript._describe(object, abbreviate); } catch (e) { @@ -411,6 +411,7 @@ InjectedScript.CallFrameProxy = function(id, callFrame) this.sourceID = callFrame.sourceID; this.line = callFrame.line; this.scopeChain = this._wrapScopeChain(callFrame); + this.injectedScriptId = injectedScriptId; } InjectedScript.CallFrameProxy.prototype = { @@ -544,7 +545,7 @@ InjectedScript._type = function(obj) return "array"; if (obj instanceof inspectedWindow.HTMLCollection) return "array"; - if (inspectedWindow.jQuery && obj instanceof inspectedWindow.jQuery) + if (typeof inspectedWindow.jQuery === "function" && obj instanceof inspectedWindow.jQuery) return "array"; if (obj instanceof inspectedWindow.Error) return "error"; diff --git a/WebCore/inspector/front-end/InjectedScriptAccess.js b/WebCore/inspector/front-end/InjectedScriptAccess.js index 0e4cc2e..5950421 100644 --- a/WebCore/inspector/front-end/InjectedScriptAccess.js +++ b/WebCore/inspector/front-end/InjectedScriptAccess.js @@ -35,7 +35,11 @@ function InjectedScriptAccess(injectedScriptId) { InjectedScriptAccess.get = function(injectedScriptId) { - return new InjectedScriptAccess(injectedScriptId); + if (typeof injectedScriptId === "number") + return new InjectedScriptAccess(injectedScriptId); + + console.error("Access to injected script with no id"); + console.trace(); } InjectedScriptAccess.getDefault = function() diff --git a/WebCore/inspector/front-end/InspectorBackendStub.js b/WebCore/inspector/front-end/InspectorBackendStub.js index 857e026..7cfc8a1 100644 --- a/WebCore/inspector/front-end/InspectorBackendStub.js +++ b/WebCore/inspector/front-end/InspectorBackendStub.js @@ -1,5 +1,5 @@ /* - * Copyright (C) 2009 Google Inc. All rights reserved. + * Copyright (C) 2009, 2010 Google Inc. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are @@ -28,270 +28,102 @@ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -if (!window.InspectorBackend) { - WebInspector.InspectorBackendStub = function() { - this._attachedWindowHeight = 0; - this._timelineEnabled = false; + this._registerDelegate("addInspectedNode"); + this._registerDelegate("addScriptToEvaluateOnLoad"); + this._registerDelegate("changeTagName"); + this._registerDelegate("clearConsoleMessages"); + this._registerDelegate("copyNode"); + this._registerDelegate("deleteCookie"); + this._registerDelegate("didEvaluateForTestInFrontend"); + this._registerDelegate("disableMonitoringXHR"); + this._registerDelegate("disableResourceTracking"); + this._registerDelegate("disableSearchingForNode"); + this._registerDelegate("disableTimeline"); + this._registerDelegate("dispatchOnInjectedScript"); + this._registerDelegate("enableMonitoringXHR"); + this._registerDelegate("enableResourceTracking"); + this._registerDelegate("enableSearchingForNode"); + this._registerDelegate("enableTimeline"); + this._registerDelegate("getChildNodes"); + this._registerDelegate("getCookies"); + this._registerDelegate("getDatabaseTableNames"); + this._registerDelegate("getDOMStorageEntries"); + this._registerDelegate("getEventListenersForNode"); + this._registerDelegate("getOuterHTML"); + this._registerDelegate("getProfile"); + this._registerDelegate("getProfileHeaders"); + this._registerDelegate("removeProfile"); + this._registerDelegate("clearProfiles"); + this._registerDelegate("getResourceContent"); + this._registerDelegate("highlightDOMNode"); + this._registerDelegate("hideDOMNodeHighlight"); + this._registerDelegate("performSearch"); + this._registerDelegate("pushNodeByPathToFrontend"); + this._registerDelegate("releaseWrapperObjectGroup"); + this._registerDelegate("removeAllScriptsToEvaluateOnLoad"); + this._registerDelegate("reloadPage"); + this._registerDelegate("removeAttribute"); + this._registerDelegate("removeDOMStorageItem"); + this._registerDelegate("removeNode"); + this._registerDelegate("saveApplicationSettings"); + this._registerDelegate("saveSessionSettings"); + this._registerDelegate("searchCanceled"); + this._registerDelegate("setAttribute"); + this._registerDelegate("setDOMStorageItem"); + this._registerDelegate("setInjectedScriptSource"); + this._registerDelegate("setOuterHTML"); + this._registerDelegate("setTextNodeValue"); + this._registerDelegate("startProfiling"); + this._registerDelegate("startTimelineProfiler"); + this._registerDelegate("stopProfiling"); + this._registerDelegate("stopTimelineProfiler"); + this._registerDelegate("storeLastActivePanel"); + this._registerDelegate("takeHeapSnapshot"); + + this._registerDelegate("getAllStyles"); + this._registerDelegate("getStyles"); + this._registerDelegate("getComputedStyle"); + this._registerDelegate("getInlineStyle"); + this._registerDelegate("getStyleSheet"); + this._registerDelegate("getRuleRanges"); + this._registerDelegate("applyStyleText"); + this._registerDelegate("setStyleText"); + this._registerDelegate("setStyleProperty"); + this._registerDelegate("toggleStyleEnabled"); + this._registerDelegate("setRuleSelector"); + this._registerDelegate("addRule"); + + this._registerDelegate("disableDebugger"); + this._registerDelegate("editScriptSource"); + this._registerDelegate("getScriptSource"); + this._registerDelegate("enableDebugger"); + this._registerDelegate("setBreakpoint"); + this._registerDelegate("removeBreakpoint"); + this._registerDelegate("activateBreakpoints"); + this._registerDelegate("deactivateBreakpoints"); + this._registerDelegate("resume"); + this._registerDelegate("stepIntoStatement"); + this._registerDelegate("stepOutOfFunction"); + this._registerDelegate("stepOverStatement"); + this._registerDelegate("setPauseOnExceptionsState"); } WebInspector.InspectorBackendStub.prototype = { - wrapCallback: function(func) - { - return func; - }, - - closeWindow: function() - { - this._windowVisible = false; - }, - - attach: function() - { - }, - - detach: function() - { - }, - - storeLastActivePanel: function(panel) - { - }, - - clearConsoleMessages: function() - { - }, - - getOuterHTML: function() - { - }, - - setOuterHTML: function() - { - }, - - addInspectedNode: function() - { - }, - - search: function(sourceRow, query) - { - }, - - moveByUnrestricted: function(x, y) - { - }, - - getResourceContent: function(callId, identifier) - { - WebInspector.didGetResourceContent(callId, ""); - }, - - highlightDOMNode: function(node) - { - }, - - hideDOMNodeHighlight: function() - { - }, - - inspectedWindow: function() - { - return window; - }, - - loaded: function() - { - }, - - localizedStringsURL: function() - { - return undefined; - }, - - windowUnloading: function() - { - return false; - }, - - hiddenPanels: function() - { - return ""; - }, - - enableResourceTracking: function() - { - WebInspector.resourceTrackingWasEnabled(); - }, - - disableResourceTracking: function() - { - WebInspector.resourceTrackingWasDisabled(); - }, - - - enableSearchingForNode: function() - { - WebInspector.searchingForNodeWasEnabled(); - }, - - disableSearchingForNode: function() - { - WebInspector.searchingForNodeWasDisabled(); - }, - - enableMonitoringXHR: function() - { - WebInspector.monitoringXHRWasEnabled(); - }, - - disableMonitoringXHR: function() - { - WebInspector.monitoringXHRWasDisabled(); - }, - - reloadPage: function() - { - }, - - enableDebugger: function() - { - WebInspector.debuggerWasEnabled(); - }, - - disableDebugger: function() - { - WebInspector.debuggerWasDisabled(); - }, - - setBreakpoint: function(callId, sourceID, line, enabled, condition) - { - WebInspector.didSetBreakpoint(callId, true, line); - }, - - removeBreakpoint: function(sourceID, line) - { - }, - - activateBreakpoints: function() - { - this._breakpointsActivated = true; - }, - - deactivateBreakpoints: function() - { - this._breakpointsActivated = false; - }, - - pause: function() - { - }, - - setPauseOnExceptionsState: function(value) - { - WebInspector.updatePauseOnExceptionsState(value); - }, - - editScriptSource: function() - { - WebInspector.didEditScriptSource(callId, false); - }, - - getScriptSource: function(callId, sourceID) - { - WebInspector.didGetScriptSource(callId, null); - }, - - resume: function() - { - }, - - enableProfiler: function() - { - WebInspector.profilerWasEnabled(); - }, - - disableProfiler: function() - { - WebInspector.profilerWasDisabled(); - }, - - startProfiling: function() - { - }, - - stopProfiling: function() - { - }, - - getProfileHeaders: function(callId) - { - WebInspector.didGetProfileHeaders(callId, []); - }, - - getProfile: function(callId, uid) - { - }, - - takeHeapSnapshot: function() - { - }, - - databaseTableNames: function(database) - { - return []; - }, - - stepIntoStatement: function() - { - }, - - stepOutOfFunction: function() - { - }, - - stepOverStatement: function() - { - }, - - saveApplicationSettings: function() - { - }, - - saveSessionSettings: function() - { - }, - - dispatchOnInjectedScript: function() + _registerDelegate: function(methodName) { + this[methodName] = this.sendMessageToBackend.bind(this, methodName); }, - releaseWrapperObjectGroup: function() - { - }, - - setInjectedScriptSource: function() - { - }, - - addScriptToEvaluateOnLoad: function() - { - }, - - removeAllScriptsToEvaluateOnLoad: function() - { - }, - - performSearch: function() - { - }, - - searchCanceled: function() + sendMessageToBackend: function() { + var message = JSON.stringify(Array.prototype.slice.call(arguments)); + if (WebInspector._paramsObject && "page" in WebInspector._paramsObject) + WebInspector.socket.send(message); + else + InspectorFrontendHost.sendMessageToBackend(message); } } InspectorBackend = new WebInspector.InspectorBackendStub(); - -} diff --git a/WebCore/inspector/front-end/ResourceView.js b/WebCore/inspector/front-end/ResourceView.js index bfd1576..7ce09b6 100644 --- a/WebCore/inspector/front-end/ResourceView.js +++ b/WebCore/inspector/front-end/ResourceView.js @@ -176,7 +176,8 @@ WebInspector.ResourceView.prototype = { this.tabbedPane.selectTabById("content"); if ("resize" in this) this.resize(); - this.contentTabSelected(); + if (this.hasContentTab()) + this.contentTabSelected(); }, _refreshURL: function() diff --git a/WebCore/inspector/front-end/ResourcesPanel.js b/WebCore/inspector/front-end/ResourcesPanel.js index b02a277..4fda07b 100644 --- a/WebCore/inspector/front-end/ResourcesPanel.js +++ b/WebCore/inspector/front-end/ResourcesPanel.js @@ -82,30 +82,30 @@ WebInspector.ResourcesPanel.prototype = { populateSidebar: function() { - var timeGraphItem = new WebInspector.SidebarTreeElement("resources-time-graph-sidebar-item", WebInspector.UIString("Time")); - timeGraphItem.onselect = this._graphSelected.bind(this); + this.timeGraphItem = new WebInspector.SidebarTreeElement("resources-time-graph-sidebar-item", WebInspector.UIString("Time")); + this.timeGraphItem.onselect = this._graphSelected.bind(this); var transferTimeCalculator = new WebInspector.ResourceTransferTimeCalculator(); var transferDurationCalculator = new WebInspector.ResourceTransferDurationCalculator(); - timeGraphItem.sortingOptions = [ - { name: WebInspector.UIString("Sort by Start Time"), sortingFunction: WebInspector.ResourceSidebarTreeElement.CompareByAscendingStartTime, calculator: transferTimeCalculator }, - { name: WebInspector.UIString("Sort by Response Time"), sortingFunction: WebInspector.ResourceSidebarTreeElement.CompareByAscendingResponseReceivedTime, calculator: transferTimeCalculator }, - { name: WebInspector.UIString("Sort by End Time"), sortingFunction: WebInspector.ResourceSidebarTreeElement.CompareByAscendingEndTime, calculator: transferTimeCalculator }, - { name: WebInspector.UIString("Sort by Duration"), sortingFunction: WebInspector.ResourceSidebarTreeElement.CompareByDescendingDuration, calculator: transferDurationCalculator }, - { name: WebInspector.UIString("Sort by Latency"), sortingFunction: WebInspector.ResourceSidebarTreeElement.CompareByDescendingLatency, calculator: transferDurationCalculator }, + this.timeGraphItem.sortingOptions = [ + { name: WebInspector.UIString("Sort by Start Time"), sortingFunction: WebInspector.ResourceSidebarTreeElement.CompareByAscendingStartTime, calculator: transferTimeCalculator, optionName: "startTime" }, + { name: WebInspector.UIString("Sort by Response Time"), sortingFunction: WebInspector.ResourceSidebarTreeElement.CompareByAscendingResponseReceivedTime, calculator: transferTimeCalculator, optionName: "responseTime" }, + { name: WebInspector.UIString("Sort by End Time"), sortingFunction: WebInspector.ResourceSidebarTreeElement.CompareByAscendingEndTime, calculator: transferTimeCalculator, optionName: "endTime" }, + { name: WebInspector.UIString("Sort by Duration"), sortingFunction: WebInspector.ResourceSidebarTreeElement.CompareByDescendingDuration, calculator: transferDurationCalculator, optionName: "duration" }, + { name: WebInspector.UIString("Sort by Latency"), sortingFunction: WebInspector.ResourceSidebarTreeElement.CompareByDescendingLatency, calculator: transferDurationCalculator, optionName: "latency" }, ]; - timeGraphItem.isBarOpaqueAtLeft = false; - timeGraphItem.selectedSortingOptionIndex = 1; + this.timeGraphItem.isBarOpaqueAtLeft = false; + this.timeGraphItem.selectedSortingOptionIndex = 1; this.sizeGraphItem = new WebInspector.SidebarTreeElement("resources-size-graph-sidebar-item", WebInspector.UIString("Size")); this.sizeGraphItem.onselect = this._graphSelected.bind(this); var transferSizeCalculator = new WebInspector.ResourceTransferSizeCalculator(); this.sizeGraphItem.sortingOptions = [ - { name: WebInspector.UIString("Sort by Transfer Size"), sortingFunction: WebInspector.ResourceSidebarTreeElement.CompareByDescendingTransferSize, calculator: transferSizeCalculator }, - { name: WebInspector.UIString("Sort by Size"), sortingFunction: WebInspector.ResourceSidebarTreeElement.CompareByDescendingSize, calculator: transferSizeCalculator }, + { name: WebInspector.UIString("Sort by Transfer Size"), sortingFunction: WebInspector.ResourceSidebarTreeElement.CompareByDescendingTransferSize, calculator: transferSizeCalculator, optionName: "transferSize" }, + { name: WebInspector.UIString("Sort by Size"), sortingFunction: WebInspector.ResourceSidebarTreeElement.CompareByDescendingSize, calculator: transferSizeCalculator, optionName: "size" }, ]; this.sizeGraphItem.isBarOpaqueAtLeft = true; @@ -114,7 +114,7 @@ WebInspector.ResourcesPanel.prototype = { this.graphsTreeElement = new WebInspector.SidebarSectionTreeElement(WebInspector.UIString("GRAPHS"), {}, true); this.sidebarTree.appendChild(this.graphsTreeElement); - this.graphsTreeElement.appendChild(timeGraphItem); + this.graphsTreeElement.appendChild(this.timeGraphItem); this.graphsTreeElement.appendChild(this.sizeGraphItem); this.graphsTreeElement.expand(); @@ -160,6 +160,32 @@ WebInspector.ResourcesPanel.prototype = { this.largerResourcesButton.toggled = WebInspector.applicationSettings.resourcesLargeRows; if (!WebInspector.applicationSettings.resourcesLargeRows) this._setLargerResources(WebInspector.applicationSettings.resourcesLargeRows); + this._loadSortOptions(); + }, + + _loadSortOptions: function() + { + var newOptions = WebInspector.applicationSettings.resourcesSortOptions; + if (!newOptions) + return; + + this._loadSortOptionForGraph(this.timeGraphItem, newOptions.timeOption || "responseTime"); + this._loadSortOptionForGraph(this.sizeGraphItem, newOptions.sizeOption || "transferSize"); + }, + + _loadSortOptionForGraph: function(graphItem, newOptionName) + { + var sortingOptions = graphItem.sortingOptions; + for (var i = 0; i < sortingOptions.length; ++i) { + if (sortingOptions[i].optionName === newOptionName) { + graphItem.selectedSortingOptionIndex = i; + // Propagate the option change down to the currently selected option. + if (this._lastSelectedGraphTreeElement === graphItem) { + this._lastSelectedGraphTreeElement = null; + this._graphSelected(graphItem); + } + } + } }, get mainResourceLoadTime() @@ -618,11 +644,12 @@ WebInspector.ResourcesPanel.prototype = { option.label = sortingOption.name; option.sortingFunction = sortingOption.sortingFunction; option.calculator = sortingOption.calculator; + option.optionName = sortingOption.optionName; this.sortingSelectElement.appendChild(option); } this.sortingSelectElement.selectedIndex = treeElement.selectedSortingOptionIndex; - this._changeSortingFunction(); + this._doChangeSortingFunction(); this.closeVisibleResource(); this.containerElement.scrollTop = 0; @@ -658,7 +685,21 @@ WebInspector.ResourcesPanel.prototype = { _changeSortingFunction: function() { - var selectedOption = this.sortingSelectElement[this.sortingSelectElement.selectedIndex]; + this._doChangeSortingFunction(); + WebInspector.applicationSettings.resourcesSortOptions = {timeOption: this._selectedOptionNameForGraph(this.timeGraphItem), sizeOption: this._selectedOptionNameForGraph(this.sizeGraphItem)}; + }, + + _selectedOptionNameForGraph: function(graphItem) + { + return graphItem.sortingOptions[graphItem.selectedSortingOptionIndex].optionName; + }, + + _doChangeSortingFunction: function() + { + var selectedIndex = this.sortingSelectElement.selectedIndex; + if (this._lastSelectedGraphTreeElement) + this._lastSelectedGraphTreeElement.selectedSortingOptionIndex = selectedIndex; + var selectedOption = this.sortingSelectElement[selectedIndex]; this.sortingFunction = selectedOption.sortingFunction; this.calculator = this.summaryBar.calculator = selectedOption.calculator; }, @@ -751,61 +792,83 @@ WebInspector.ResourcesPanel.prototype = { { var tableElement = document.createElement("table"); var resource = anchor.parentElement.resource; - var data = []; + var rows = []; - if (resource.timing.proxyDuration !== -1) { - data.push(WebInspector.UIString("Proxy")); - data.push(Number.secondsToString(resource.timing.proxyDuration)); + function addRow(title, start, end, color) + { + var row = {}; + row.title = title; + row.start = start; + row.end = end; + rows.push(row); } - if (resource.timing.dnsDuration !== -1) { - data.push(WebInspector.UIString("DNS Lookup")); - data.push(Number.secondsToString(resource.timing.dnsDuration)); + if (resource.timing.proxyStart !== -1) + addRow(WebInspector.UIString("Proxy"), resource.timing.proxyStart, resource.timing.proxyEnd); + + if (resource.timing.dnsStart !== -1) { + addRow(WebInspector.UIString("DNS Lookup"), resource.timing.dnsStart, resource.timing.dnsEnd); } - if (resource.timing.connectDuration !== -1) { - if (resource.connectionReused) { - data.push(WebInspector.UIString("Blocking")); - data.push(Number.secondsToString(resource.timing.connectDuration)); - } else { - data.push(WebInspector.UIString("Connecting")); + if (resource.timing.connectStart !== -1) { + if (resource.connectionReused) + addRow(WebInspector.UIString("Blocking"), resource.timing.connectStart, resource.timing.connectEnd); + else { + var connectStart = resource.timing.connectStart; // Connection includes DNS, subtract it here. - var connectDuration = resource.timing.connectDuration; - if (resource.timing.dnsDuration !== -1) - connectDuration -= resource.timing.dnsDuration; - data.push(Number.secondsToString(connectDuration)); + if (resource.timing.dnsStart !== -1) + connectStart += resource.timing.dnsEnd - resource.timing.dnsStart; + addRow(WebInspector.UIString("Connecting"), connectStart, resource.timing.connectEnd); } } - if (resource.timing.sslDuration !== -1) { - data.push(WebInspector.UIString("SSL")); - data.push(Number.secondsToString(resource.timing.sslDuration)); - } - - data.push(WebInspector.UIString("Sending")); - data.push(Number.secondsToString(resource.timing.sendDuration)); + if (resource.timing.sslStart !== -1) + addRow(WebInspector.UIString("SSL"), resource.timing.sslStart, resource.timing.sslEnd); - data.push(WebInspector.UIString("Waiting")); - // Waiting includes SSL, subtract it here. - var waitDuration = resource.timing.waitDuration; - if (resource.timing.sslDuration !== -1) - waitDuration -= resource.timing.sslDuration; - data.push(Number.secondsToString(waitDuration)); + var sendStart = resource.timing.sendStart; + if (resource.timing.sslStart !== -1) + sendStart += resource.timing.sslEnd - resource.timing.sslStart; + + addRow(WebInspector.UIString("Sending"), resource.timing.sendStart, resource.timing.sendEnd); + addRow(WebInspector.UIString("Waiting"), resource.timing.sendEnd, resource.timing.receiveHeadersEnd); + addRow(WebInspector.UIString("Receiving"), (resource.responseReceivedTime - resource.timing.requestTime) * 1000, (resource.endTime - resource.timing.requestTime) * 1000); - data.push(WebInspector.UIString("Receiving")); - data.push(Number.secondsToString(resource.endTime - resource.responseReceivedTime)); + const chartWidth = 200; + var total = (resource.endTime - resource.timing.requestTime) * 1000; + var scale = chartWidth / total; - for (var i = 0; i < data.length; i += 2) { + for (var i = 0; i < rows.length; ++i) { var tr = document.createElement("tr"); tableElement.appendChild(tr); var td = document.createElement("td"); - td.textContent = data[i]; + td.textContent = rows[i].title; tr.appendChild(td); td = document.createElement("td"); - td.align = "right"; - td.textContent = data[i + 1]; + td.width = chartWidth + "px"; + + var row = document.createElement("div"); + row.className = "resource-timing-row"; + td.appendChild(row); + + var bar = document.createElement("span"); + bar.className = "resource-timing-bar"; + bar.style.left = scale * rows[i].start + "px"; + bar.style.right = scale * (total - rows[i].end) + "px"; + bar.style.backgroundColor = rows[i].color; + bar.textContent = "\u200B"; // Important for 0-time items to have 0 width. + row.appendChild(bar); + + var title = document.createElement("span"); + title.className = "resource-timing-bar-title"; + if (i >= rows.length - 2) + title.style.right = (scale * (total - rows[i].end) + 3) + "px"; + else + title.style.left = (scale * rows[i].start + 3) + "px"; + title.textContent = Number.millisToString(rows[i].end - rows[i].start); + row.appendChild(title); + tr.appendChild(td); } diff --git a/WebCore/inspector/front-end/ScriptView.js b/WebCore/inspector/front-end/ScriptView.js index c576510..597fd28 100644 --- a/WebCore/inspector/front-end/ScriptView.js +++ b/WebCore/inspector/front-end/ScriptView.js @@ -97,6 +97,8 @@ WebInspector.ScriptView.prototype = { _addBreakpoint: function(line) { WebInspector.breakpointManager.setBreakpoint(this.script.sourceID, this.script.sourceURL, line, true, ""); + if (!WebInspector.panels.scripts.breakpointsActivated) + WebInspector.panels.scripts.toggleBreakpointsClicked(); }, _editLineComplete: function(newBody) diff --git a/WebCore/inspector/front-end/ScriptsPanel.js b/WebCore/inspector/front-end/ScriptsPanel.js index 7a1a4d5..dff4853 100644 --- a/WebCore/inspector/front-end/ScriptsPanel.js +++ b/WebCore/inspector/front-end/ScriptsPanel.js @@ -104,10 +104,10 @@ WebInspector.ScriptsPanel = function() this.sidebarButtonsElement.appendChild(this.stepOutButton); this.toggleBreakpointsButton = new WebInspector.StatusBarButton("", "toggle-breakpoints"); - this.toggleBreakpointsButton.addEventListener("click", this._toggleBreakpointsClicked.bind(this), false); + this.toggleBreakpointsButton.addEventListener("click", this.toggleBreakpointsClicked.bind(this), false); this.sidebarButtonsElement.appendChild(this.toggleBreakpointsButton.element); // Breakpoints should be activated by default, so emulate a click to toggle on. - this._toggleBreakpointsClicked(); + this.toggleBreakpointsClicked(); this.debuggerStatusElement = document.createElement("div"); this.debuggerStatusElement.id = "scripts-debugger-status"; @@ -164,7 +164,7 @@ WebInspector.ScriptsPanel = function() this._pauseOnExceptionButton = new WebInspector.StatusBarButton("", "scripts-pause-on-exceptions-status-bar-item", 3); this._pauseOnExceptionButton.addEventListener("click", this._togglePauseOnExceptions.bind(this), false); this._pauseOnExceptionButton.state = WebInspector.ScriptsPanel.PauseOnExceptionsState.DontPauseOnExceptions; - this._pauseOnExceptionButton.title = WebInspector.UIString("Don't pause on exceptions.\nClick to Pause on all exceptions."); + this._pauseOnExceptionButton.title = WebInspector.UIString("Don't pause on exceptions.\nClick to Pause on all exceptions."); this._registerShortcuts(); @@ -219,7 +219,7 @@ WebInspector.ScriptsPanel.prototype = { delete this._attachDebuggerWhenShown; } }, - + hide: function() { if (this.visibleView) @@ -278,7 +278,7 @@ WebInspector.ScriptsPanel.prototype = { // Remove script from the files list. script.filesSelectOption.parentElement.removeChild(script.filesSelectOption); - + // Move breakpoints to the resource's frame. if (script._scriptView) { var sourceFrame = script._scriptView.sourceFrame; @@ -296,9 +296,6 @@ WebInspector.ScriptsPanel.prototype = { { var breakpoint = event.data; - if (!this.breakpointsActivated) - this._toggleBreakpointsClicked(); - var sourceFrame; if (breakpoint.url) { var resource = WebInspector.resourceURLMap[breakpoint.url]; @@ -540,7 +537,7 @@ WebInspector.ScriptsPanel.prototype = { this._showScriptOrResource(scriptOrResource, {line: line, shouldHighlightLine: true}); }, - _scriptOrResourceForURLAndLine: function(url, line) + _scriptOrResourceForURLAndLine: function(url, line) { var scriptWithMatchingUrl = null; for (var sourceID in this._sourceIDMap) { @@ -612,8 +609,7 @@ WebInspector.ScriptsPanel.prototype = { _showScriptOrResource: function(scriptOrResource, options) { // options = {line:, shouldHighlightLine:, fromBackForwardAction:, initialLoad:} - if (!options) - options = {}; + options = options || {}; if (!scriptOrResource) return; @@ -695,7 +691,7 @@ WebInspector.ScriptsPanel.prototype = { return; this._resourceForURLInFilesSelect[script.resource.url] = script.resource; } - + var displayName = script.sourceURL ? WebInspector.displayNameForURL(script.sourceURL) : WebInspector.UIString("(program)"); var select = this.filesSelectElement; @@ -814,7 +810,7 @@ WebInspector.ScriptsPanel.prototype = { this.resize(); }, - + updatePauseOnExceptionsState: function(pauseOnExceptionsState) { if (pauseOnExceptionsState == WebInspector.ScriptsPanel.PauseOnExceptionsState.DontPauseOnExceptions) @@ -973,7 +969,7 @@ WebInspector.ScriptsPanel.prototype = { InspectorBackend.stepOutOfFunction(); }, - _toggleBreakpointsClicked: function() + toggleBreakpointsClicked: function() { this.toggleBreakpointsButton.toggled = !this.toggleBreakpointsButton.toggled; if (this.toggleBreakpointsButton.toggled) { diff --git a/WebCore/inspector/front-end/Settings.js b/WebCore/inspector/front-end/Settings.js index 39c1e1e..22db491 100644 --- a/WebCore/inspector/front-end/Settings.js +++ b/WebCore/inspector/front-end/Settings.js @@ -58,6 +58,7 @@ WebInspector.populateApplicationSettings = function(settingsString) WebInspector.applicationSettings.installSetting("showUserAgentStyles", "show-user-agent-styles", true); WebInspector.applicationSettings.installSetting("resourceViewTab", "resource-view-tab", "content"); WebInspector.applicationSettings.installSetting("consoleHistory", "console-history", []); + WebInspector.applicationSettings.installSetting("resourcesSortOptions", "resources-sort-options", {timeOption: "responseTime", sizeOption: "transferSize"}); WebInspector.applicationSettings.dispatchEventToListeners("loaded"); } @@ -71,38 +72,42 @@ WebInspector.populateSessionSettings = function(settingsString) WebInspector.Settings = function(sessionScope) { this._sessionScope = sessionScope; - this._defaultValues = {}; + this._store = {}; } WebInspector.Settings.prototype = { reset: function() { this._store = {}; + // FIXME: restore default values (bug 42820) this.dispatchEventToListeners("loaded"); }, _load: function(settingsString) { try { - this._store = JSON.parse(settingsString); + var loadedStore = JSON.parse(settingsString); } catch (e) { // May fail; - this._store = {}; + loadedStore = {}; } + if (!loadedStore) + return; + for (var propertyName in loadedStore) + this._store[propertyName] = loadedStore[propertyName]; }, installSetting: function(name, propertyName, defaultValue) { this.__defineGetter__(name, this._get.bind(this, propertyName)); this.__defineSetter__(name, this._set.bind(this, propertyName)); - this._defaultValues[propertyName] = defaultValue; + if (!(propertyName in this._store)) + this._store[propertyName] = defaultValue; }, _get: function(propertyName) { - if (propertyName in this._store) - return this._store[propertyName]; - return this._defaultValues[propertyName]; + return this._store[propertyName]; }, _set: function(propertyName, newValue) diff --git a/WebCore/inspector/front-end/SourceView.js b/WebCore/inspector/front-end/SourceView.js index 1bf8194..4d03ecd 100644 --- a/WebCore/inspector/front-end/SourceView.js +++ b/WebCore/inspector/front-end/SourceView.js @@ -128,6 +128,8 @@ WebInspector.SourceView.prototype = { { var sourceID = this._sourceIDForLine(line); WebInspector.breakpointManager.setBreakpoint(sourceID, this.resource.url, line, true, ""); + if (!WebInspector.panels.scripts.breakpointsActivated) + WebInspector.panels.scripts.toggleBreakpointsClicked(); }, _removeBreakpoint: function(breakpoint) diff --git a/WebCore/inspector/front-end/inspector.css b/WebCore/inspector/front-end/inspector.css index f1ee49f..8c4a2ea 100644 --- a/WebCore/inspector/front-end/inspector.css +++ b/WebCore/inspector/front-end/inspector.css @@ -977,6 +977,22 @@ body.platform-linux .monospace, body.platform-linux .source-code { content: "\A"; } +.resource-timing-row { + position: relative; + height: 12px; +} + +.resource-timing-bar { + position: absolute; + background-color: red; + border-left: 1px solid red; + opacity: 0.4; +} + +.resource-timing-bar-title { + position: absolute; +} + #elements-content { display: block; overflow: auto; diff --git a/WebCore/inspector/front-end/inspector.js b/WebCore/inspector/front-end/inspector.js index 5ec7081..0adf057 100644 --- a/WebCore/inspector/front-end/inspector.js +++ b/WebCore/inspector/front-end/inspector.js @@ -1129,11 +1129,6 @@ WebInspector.showAuditsPanel = function() this.currentPanel = this.panels.audits; } -WebInspector.clearConsoleMessages = function() -{ - WebInspector.console.clearMessages(); -} - WebInspector.selectDatabase = function(o) { WebInspector.showStoragePanel(); diff --git a/WebCore/inspector/front-end/utilities.js b/WebCore/inspector/front-end/utilities.js index 6e7c725..d248071 100644 --- a/WebCore/inspector/front-end/utilities.js +++ b/WebCore/inspector/front-end/utilities.js @@ -639,6 +639,11 @@ function parentNode(node) return node.parentNode; } +Number.millisToString = function(ms, formatterFunction, higherResolution) +{ + return Number.secondsToString(ms / 1000, formatterFunction, higherResolution); +} + Number.secondsToString = function(seconds, formatterFunction, higherResolution) { if (!formatterFunction) diff --git a/WebCore/platform/win/PlatformScrollBar.h b/WebCore/loader/DocumentLoadTiming.h index 89c6e4a..71a1dc4 100644 --- a/WebCore/platform/win/PlatformScrollBar.h +++ b/WebCore/loader/DocumentLoadTiming.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2004, 2005, 2006, 2007, 2008 Apple Inc. All rights reserved. + * Copyright (C) 2010 Google, Inc. All Rights Reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -10,10 +10,10 @@ * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * - * THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY + * THIS SOFTWARE IS PROVIDED BY GOOGLE INC. ``AS IS'' AND ANY * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL GOOGLE INC. OR * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR @@ -23,28 +23,38 @@ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -#ifndef PlatformScrollBar_h -#define PlatformScrollBar_h +#ifndef DocumentLoadTiming_h +#define DocumentLoadTiming_h -#include "Scrollbar.h" -#include "Timer.h" -#include <wtf/PassRefPtr.h> - -typedef struct HDC__* HDC; +#include <wtf/Noncopyable.h> namespace WebCore { -class PlatformScrollbar : public Scrollbar { -public: - static PassRefPtr<PlatformScrollbar> create(ScrollbarClient* client, ScrollbarOrientation orientation, ScrollbarControlSize size) +struct DocumentLoadTiming : public Noncopyable { + DocumentLoadTiming() + : navigationStart(0.0) + , unloadEventEnd(0.0) + , redirectStart(0.0) + , redirectEnd(0.0) + , redirectCount(0) + , fetchStart(0.0) + , responseEnd(0.0) + , loadEventStart(0.0) + , loadEventEnd(0.0) { - return adoptRef(new PlatformScrollbar(client, orientation, size)); } - - PlatformScrollbar(ScrollbarClient*, ScrollbarOrientation, ScrollbarControlSize, ScrollbarTheme* = 0); + + double navigationStart; + double unloadEventEnd; + double redirectStart; + double redirectEnd; + short redirectCount; + double fetchStart; + double responseEnd; + double loadEventStart; + double loadEventEnd; }; } -#endif // PlatformScrollBar_h - +#endif diff --git a/WebCore/loader/DocumentLoader.h b/WebCore/loader/DocumentLoader.h index f5935c9..2bd0761 100644 --- a/WebCore/loader/DocumentLoader.h +++ b/WebCore/loader/DocumentLoader.h @@ -29,6 +29,7 @@ #ifndef DocumentLoader_h #define DocumentLoader_h +#include "DocumentLoadTiming.h" #include "NavigationAction.h" #include "ResourceError.h" #include "ResourceRequest.h" diff --git a/WebCore/loader/FormSubmission.cpp b/WebCore/loader/FormSubmission.cpp index 4d44174..f661273 100644 --- a/WebCore/loader/FormSubmission.cpp +++ b/WebCore/loader/FormSubmission.cpp @@ -31,18 +31,86 @@ #include "config.h" #include "FormSubmission.h" +#include "CSSHelper.h" +#include "DOMFormData.h" +#include "Document.h" #include "Event.h" #include "FormData.h" +#include "FormDataBuilder.h" #include "FormState.h" #include "Frame.h" #include "FrameLoadRequest.h" #include "FrameLoader.h" +#include "HTMLFormControlElement.h" #include "HTMLFormElement.h" -#include <wtf/PassRefPtr.h> +#include "HTMLInputElement.h" +#include "HTMLNames.h" +#include "TextEncoding.h" +#include <wtf/CurrentTime.h> +#include <wtf/RandomNumber.h> namespace WebCore { -FormSubmission::FormSubmission(Method method, const KURL& action, const String& target, const String& contentType, PassRefPtr<FormState> state, PassRefPtr<FormData> data, const String& boundary, bool lockHistory, PassRefPtr<Event> event) +using namespace HTMLNames; + +static int64_t generateFormDataIdentifier() +{ + // Initialize to the current time to reduce the likelihood of generating + // identifiers that overlap with those from past/future browser sessions. + static int64_t nextIdentifier = static_cast<int64_t>(currentTime() * 1000000.0); + return ++nextIdentifier; +} + +static void appendMailtoPostFormDataToURL(KURL& url, const FormData& data, const String& encodingType) +{ + String body = data.flattenToString(); + + if (equalIgnoringCase(encodingType, "text/plain")) { + // Convention seems to be to decode, and s/&/\r\n/. Also, spaces are encoded as %20. + body = decodeURLEscapeSequences(body.replace('&', "\r\n").replace('+', ' ') + "\r\n"); + } + + Vector<char> bodyData; + bodyData.append("body=", 5); + FormDataBuilder::encodeStringAsFormData(bodyData, body.utf8()); + body = String(bodyData.data(), bodyData.size()).replace('+', "%20"); + + String query = url.query(); + if (!query.isEmpty()) + query.append('&'); + query.append(body); + url.setQuery(query); +} + +void FormSubmission::Attributes::parseAction(const String& action) +{ + // FIXME: Can we parse into a KURL? + m_action = deprecatedParseURL(action); +} + +void FormSubmission::Attributes::parseEncodingType(const String& type) +{ + if (type.contains("multipart", false) || type.contains("form-data", false)) { + m_encodingType = "multipart/form-data"; + m_isMultiPartForm = true; + } else if (type.contains("text", false) || type.contains("plain", false)) { + m_encodingType = "text/plain"; + m_isMultiPartForm = false; + } else { + m_encodingType = "application/x-www-form-urlencoded"; + m_isMultiPartForm = false; + } +} + +void FormSubmission::Attributes::parseMethodType(const String& type) +{ + if (equalIgnoringCase(type, "post")) + m_method = FormSubmission::PostMethod; + else if (equalIgnoringCase(type, "get")) + m_method = FormSubmission::GetMethod; +} + +inline FormSubmission::FormSubmission(Method method, const KURL& action, const String& target, const String& contentType, PassRefPtr<FormState> state, PassRefPtr<FormData> data, const String& boundary, bool lockHistory, PassRefPtr<Event> event) : m_method(method) , m_action(action) , m_target(target) @@ -55,9 +123,60 @@ FormSubmission::FormSubmission(Method method, const KURL& action, const String& { } -PassRefPtr<FormSubmission> FormSubmission::create(Method method, const KURL& action, const String& target, const String& contentType, PassRefPtr<FormState> state, PassRefPtr<FormData> data, const String& boundary, bool lockHistory, PassRefPtr<Event> event) +PassRefPtr<FormSubmission> FormSubmission::create(HTMLFormElement* form, const Attributes& attributes, PassRefPtr<Event> event, bool lockHistory, FormSubmissionTrigger trigger) { - return adoptRef(new FormSubmission(method, action, target, contentType, state, data, boundary, lockHistory, event)); + ASSERT(form); + Document* document = form->document(); + KURL actionURL = document->completeURL(attributes.action().isEmpty() ? document->url().string() : attributes.action()); + bool isMailtoForm = actionURL.protocolIs("mailto"); + bool isMultiPartForm = false; + String encodingType = attributes.encodingType(); + + if (attributes.method() == PostMethod) { + isMultiPartForm = attributes.isMultiPartForm(); + if (isMultiPartForm && isMailtoForm) { + encodingType = "application/x-www-form-urlencoded"; + isMultiPartForm = false; + } + } + + TextEncoding dataEncoding = isMailtoForm ? UTF8Encoding() : FormDataBuilder::encodingFromAcceptCharset(attributes.acceptCharset(), document); + RefPtr<DOMFormData> domFormData = DOMFormData::create(dataEncoding.encodingForFormSubmission()); + Vector<pair<String, String> > formValues; + + for (unsigned i = 0; i < form->associatedElements().size(); ++i) { + HTMLFormControlElement* control = form->associatedElements()[i]; + if (!control->disabled()) + control->appendFormData(*domFormData, isMultiPartForm); + if (control->hasLocalName(inputTag)) { + HTMLInputElement* input = static_cast<HTMLInputElement*>(control); + if (input->isTextField()) { + formValues.append(pair<String, String>(input->name(), input->value())); + if (input->isSearchField()) + input->addSearchResult(); + } + } + } + + RefPtr<FormData> formData; + String boundary; + + if (isMultiPartForm) { + formData = FormData::createMultiPart(domFormData->items(), domFormData->encoding(), document); + boundary = formData->boundary().data(); + } else { + formData = FormData::create(domFormData->items(), domFormData->encoding()); + if (attributes.method() == PostMethod && isMailtoForm) { + // Convert the form data into a string that we put into the URL. + appendMailtoPostFormDataToURL(actionURL, *formData, encodingType); + formData = FormData::create(); + } + } + + formData->setIdentifier(generateFormDataIdentifier()); + String targetOrBaseTarget = attributes.target().isEmpty() ? document->baseTarget() : attributes.target(); + RefPtr<FormState> formState = FormState::create(form, formValues, document->frame(), trigger); + return adoptRef(new FormSubmission(attributes.method(), actionURL, targetOrBaseTarget, encodingType, formState.release(), formData.release(), boundary, lockHistory, event)); } void FormSubmission::populateFrameLoadRequest(FrameLoadRequest& frameRequest) diff --git a/WebCore/loader/FormSubmission.h b/WebCore/loader/FormSubmission.h index 647c6c6..bee4e71 100644 --- a/WebCore/loader/FormSubmission.h +++ b/WebCore/loader/FormSubmission.h @@ -31,34 +31,69 @@ #ifndef FormSubmission_h #define FormSubmission_h +#include "FormState.h" #include "KURL.h" namespace WebCore { +class Document; class Event; class FormData; -class FormState; struct FrameLoadRequest; +class HTMLFormElement; +class TextEncoding; class FormSubmission : public RefCounted<FormSubmission> { public: - enum Method { - GetMethod, - PostMethod + enum Method { GetMethod, PostMethod }; + + class Attributes : public Noncopyable { + public: + Attributes() + : m_method(GetMethod) + , m_isMultiPartForm(false) + , m_encodingType("application/x-www-form-urlencoded") + { + } + + Method method() const { return m_method; } + void parseMethodType(const String&); + + const String& action() const { return m_action; } + void parseAction(const String&); + + const String& target() const { return m_target; } + void setTarget(const String& target) { m_target = target; } + + const String& encodingType() const { return m_encodingType; } + void parseEncodingType(const String&); + bool isMultiPartForm() const { return m_isMultiPartForm; } + + const String& acceptCharset() const { return m_acceptCharset; } + void setAcceptCharset(const String& value) { m_acceptCharset = value; } + + private: + Method m_method; + bool m_isMultiPartForm; + + String m_action; + String m_target; + String m_encodingType; + String m_acceptCharset; }; - static PassRefPtr<FormSubmission> create(Method, const KURL& action, const String& target, const String& contentType, PassRefPtr<FormState>, PassRefPtr<FormData>, const String& boundary, bool lockHistory, PassRefPtr<Event>); + static PassRefPtr<FormSubmission> create(HTMLFormElement*, const Attributes&, PassRefPtr<Event> event, bool lockHistory, FormSubmissionTrigger); void populateFrameLoadRequest(FrameLoadRequest&); Method method() const { return m_method; } const KURL& action() const { return m_action; } - String target() const { return m_target; } + const String& target() const { return m_target; } void clearTarget() { m_target = String(); } - String contentType() const { return m_contentType; } + const String& contentType() const { return m_contentType; } FormState* state() const { return m_formState.get(); } FormData* data() const { return m_formData.get(); } - String boundary() const { return m_boundary; } + const String boundary() const { return m_boundary; } bool lockHistory() const { return m_lockHistory; } Event* event() const { return m_event.get(); } @@ -70,6 +105,7 @@ public: private: FormSubmission(Method, const KURL& action, const String& target, const String& contentType, PassRefPtr<FormState>, PassRefPtr<FormData>, const String& boundary, bool lockHistory, PassRefPtr<Event>); + // FIXME: Hold an instance of Attributes instead of individual members. Method m_method; KURL m_action; String m_target; diff --git a/WebCore/loader/FrameLoader.cpp b/WebCore/loader/FrameLoader.cpp index 0ec4c98..f36aa60 100644 --- a/WebCore/loader/FrameLoader.cpp +++ b/WebCore/loader/FrameLoader.cpp @@ -47,6 +47,7 @@ #include "DOMWindow.h" #include "DocLoader.h" #include "Document.h" +#include "DocumentLoadTiming.h" #include "DocumentLoader.h" #include "Editor.h" #include "EditorClient.h" @@ -93,6 +94,7 @@ #include "ProgressTracker.h" #include "ResourceHandle.h" #include "ResourceRequest.h" +#include "SchemeRegistry.h" #include "ScriptController.h" #include "ScriptSourceCode.h" #include "ScriptString.h" @@ -1085,7 +1087,7 @@ bool FrameLoader::isMixedContent(SecurityOrigin* context, const KURL& url) if (context->protocol() != "https") return false; // We only care about HTTPS security origins. - if (!url.isValid() || SecurityOrigin::shouldTreatURLSchemeAsSecure(url.protocol())) + if (!url.isValid() || SchemeRegistry::shouldTreatURLSchemeAsSecure(url.protocol())) return false; // Loading these protocols is secure. return true; @@ -1351,7 +1353,7 @@ void FrameLoader::loadFrameRequest(const FrameLoadRequest& request, bool lockHis referrer = m_outgoingReferrer; ASSERT(frame()->document()); - if (SecurityOrigin::shouldTreatURLAsLocal(url.string()) && !isFeedWithNestedProtocolInHTTPFamily(url)) { + if (SchemeRegistry::shouldTreatURLAsLocal(url.string()) && !isFeedWithNestedProtocolInHTTPFamily(url)) { if (!SecurityOrigin::canLoad(url, String(), frame()->document()) && !SecurityOrigin::canLoad(url, referrer, 0)) { FrameLoader::reportLocalLoadFailed(m_frame, url.string()); return; @@ -2253,8 +2255,6 @@ void FrameLoader::finishedLoading() RefPtr<Frame> protect(m_frame); RefPtr<DocumentLoader> dl = activeDocumentLoader(); - ASSERT(!dl->timing()->responseEnd); - dl->timing()->responseEnd = currentTime(); dl->finishedLoading(); if (!dl->mainDocumentError().isNull() || !dl->frameLoader()) return; diff --git a/WebCore/loader/FrameLoaderTypes.h b/WebCore/loader/FrameLoaderTypes.h index 387b067..016de19 100644 --- a/WebCore/loader/FrameLoaderTypes.h +++ b/WebCore/loader/FrameLoaderTypes.h @@ -60,32 +60,6 @@ namespace WebCore { FrameLoadTypeBackWMLDeckNotAccessible }; - // FIXME: Move to DocumentLoadTiming.h. - struct DocumentLoadTiming { - DocumentLoadTiming() - : navigationStart(0.0) - , unloadEventEnd(0.0) - , redirectStart(0.0) - , redirectEnd(0.0) - , redirectCount(0) - , fetchStart(0.0) - , responseEnd(0.0) - , loadEventStart(0.0) - , loadEventEnd(0.0) - { - } - - double navigationStart; - double unloadEventEnd; - double redirectStart; - double redirectEnd; - short redirectCount; - double fetchStart; - double responseEnd; - double loadEventStart; - double loadEventEnd; - }; - enum NavigationType { NavigationTypeLinkClicked, NavigationTypeFormSubmitted, diff --git a/WebCore/loader/MainResourceLoader.cpp b/WebCore/loader/MainResourceLoader.cpp index 504a5ea..c03f9ca 100644 --- a/WebCore/loader/MainResourceLoader.cpp +++ b/WebCore/loader/MainResourceLoader.cpp @@ -31,6 +31,7 @@ #include "MainResourceLoader.h" #include "ApplicationCacheHost.h" +#include "DocumentLoadTiming.h" #include "DocumentLoader.h" #include "FormState.h" #include "Frame.h" @@ -43,6 +44,7 @@ #endif #include "ResourceError.h" #include "ResourceHandle.h" +#include "SchemeRegistry.h" #include "Settings.h" #include <wtf/CurrentTime.h> @@ -205,7 +207,7 @@ static bool shouldLoadAsEmptyDocument(const KURL& url) #if PLATFORM(TORCHMOBILE) return url.isEmpty() || (url.protocolIs("about") && equalIgnoringRef(url, blankURL())); #else - return url.isEmpty() || url.protocolIs("about"); + return url.isEmpty() || SchemeRegistry::shouldLoadURLSchemeAsEmptyDocument(url.protocol()); #endif } @@ -413,6 +415,8 @@ void MainResourceLoader::didReceiveData(const char* data, int length, long long // reference to this object; one example of this is 3266216. RefPtr<MainResourceLoader> protect(this); + m_timeOfLastDataReceived = currentTime(); + ResourceLoader::didReceiveData(data, length, lengthReceived, allAtOnce); } @@ -432,6 +436,8 @@ void MainResourceLoader::didFinishLoading() RefPtr<DocumentLoader> dl = documentLoader(); #endif + ASSERT(!documentLoader()->timing()->responseEnd); + documentLoader()->timing()->responseEnd = m_timeOfLastDataReceived; frameLoader()->finishedLoading(); ResourceLoader::didFinishLoading(); diff --git a/WebCore/loader/MainResourceLoader.h b/WebCore/loader/MainResourceLoader.h index 5ed0cc8..e2d075c 100644 --- a/WebCore/loader/MainResourceLoader.h +++ b/WebCore/loader/MainResourceLoader.h @@ -107,6 +107,7 @@ namespace WebCore { bool m_loadingMultipartContent; bool m_waitingForContentPolicy; + double m_timeOfLastDataReceived; }; } diff --git a/WebCore/loader/SubframeLoader.cpp b/WebCore/loader/SubframeLoader.cpp index 2206b4e..2821a50 100644 --- a/WebCore/loader/SubframeLoader.cpp +++ b/WebCore/loader/SubframeLoader.cpp @@ -146,7 +146,7 @@ bool SubframeLoader::requestObject(RenderEmbeddedObject* renderer, const String& #if ENABLE(PLUGIN_PROXY_FOR_VIDEO) -PassRefPtr<Widget> FrameLoader::loadMediaPlayerProxyPlugin(Node* node, const KURL& url, +PassRefPtr<Widget> SubframeLoader::loadMediaPlayerProxyPlugin(Node* node, const KURL& url, const Vector<String>& paramNames, const Vector<String>& paramValues) { ASSERT(node->hasTagName(videoTag) || node->hasTagName(audioTag)); @@ -158,7 +158,7 @@ PassRefPtr<Widget> FrameLoader::loadMediaPlayerProxyPlugin(Node* node, const KUR if (!url.isEmpty()) completedURL = completeURL(url); - if (!SecurityOrigin::canLoad(completedURL, String(), frame()->document())) { + if (!SecurityOrigin::canLoad(completedURL, String(), m_frame->document())) { FrameLoader::reportLocalLoadFailed(m_frame, completedURL.string()); return 0; } @@ -181,7 +181,7 @@ PassRefPtr<Widget> FrameLoader::loadMediaPlayerProxyPlugin(Node* node, const KUR renderer->setWidget(widget); renderer->node()->setNeedsStyleRecalc(SyntheticStyleChange); } - m_containsPlugIns = true; + m_containsPlugins = true; return widget ? widget.release() : 0; } diff --git a/WebCore/loader/appcache/ApplicationCacheHost.cpp b/WebCore/loader/appcache/ApplicationCacheHost.cpp index f63de55..eca6861 100644 --- a/WebCore/loader/appcache/ApplicationCacheHost.cpp +++ b/WebCore/loader/appcache/ApplicationCacheHost.cpp @@ -250,6 +250,37 @@ void ApplicationCacheHost::stopDeferringEvents() m_defersEvents = false; } +#if ENABLE(INSPECTOR) +void ApplicationCacheHost::fillResourceList(ResourceInfoList* resources) +{ + ApplicationCache* cache = applicationCache(); + if (!cache || !cache->isComplete()) + return; + + ApplicationCache::ResourceMap::const_iterator end = cache->end(); + for (ApplicationCache::ResourceMap::const_iterator it = cache->begin(); it != end; ++it) { + RefPtr<ApplicationCacheResource> resource = it->second; + unsigned type = resource->type(); + bool isMaster = type & ApplicationCacheResource::Master; + bool isManifest = type & ApplicationCacheResource::Manifest; + bool isExplicit = type & ApplicationCacheResource::Explicit; + bool isForeign = type & ApplicationCacheResource::Foreign; + bool isFallback = type & ApplicationCacheResource::Fallback; + resources->append(ResourceInfo(resource->url(), isMaster, isManifest, isFallback, isForeign, isExplicit, resource->estimatedSizeInStorage())); + } +} + +ApplicationCacheHost::CacheInfo ApplicationCacheHost::applicationCacheInfo() +{ + ApplicationCache* cache = applicationCache(); + if (!cache || !cache->isComplete()) + return CacheInfo(KURL(), 0, 0, 0); + + // FIXME: Add "Creation Time" and "Update Time" to Application Caches. + return CacheInfo(cache->manifestResource()->url(), 0, 0, cache->estimatedSizeInStorage()); +} +#endif + void ApplicationCacheHost::dispatchDOMEvent(EventID id, int total, int done) { if (m_domApplicationCache) { diff --git a/WebCore/loader/appcache/ApplicationCacheHost.h b/WebCore/loader/appcache/ApplicationCacheHost.h index a5b55e9..c224172 100644 --- a/WebCore/loader/appcache/ApplicationCacheHost.h +++ b/WebCore/loader/appcache/ApplicationCacheHost.h @@ -33,6 +33,7 @@ #if ENABLE(OFFLINE_WEB_APPLICATIONS) +#include "KURL.h" #include <wtf/Deque.h> #include <wtf/OwnPtr.h> #include <wtf/PassRefPtr.h> @@ -40,10 +41,8 @@ #include <wtf/Vector.h> namespace WebCore { - class ApplicationCache; class DOMApplicationCache; class DocumentLoader; - class KURL; class ResourceLoader; class ResourceError; class ResourceRequest; @@ -52,6 +51,7 @@ namespace WebCore { #if PLATFORM(CHROMIUM) class ApplicationCacheHostInternal; #else + class ApplicationCache; class ApplicationCacheGroup; class ApplicationCacheResource; class ApplicationCacheStorage; @@ -80,6 +80,40 @@ namespace WebCore { OBSOLETE_EVENT // Must remain the last value, this is used to size arrays. }; +#if ENABLE(INSPECTOR) + struct CacheInfo { + CacheInfo(const KURL& manifest, double creationTime, double updateTime, long long size) + : m_manifest(manifest) + , m_creationTime(creationTime) + , m_updateTime(updateTime) + , m_size(size) { } + KURL m_manifest; + double m_creationTime; + double m_updateTime; + long long m_size; + }; + + struct ResourceInfo { + ResourceInfo(const KURL& resource, bool isMaster, bool isManifest, bool isFallback, bool isForeign, bool isExplicit, long long size) + : m_resource(resource) + , m_isMaster(isMaster) + , m_isManifest(isManifest) + , m_isFallback(isFallback) + , m_isForeign(isForeign) + , m_isExplicit(isExplicit) + , m_size(size) { } + KURL m_resource; + bool m_isMaster; + bool m_isManifest; + bool m_isFallback; + bool m_isForeign; + bool m_isExplicit; + long long m_size; + }; + + typedef Vector<ResourceInfo> ResourceInfoList; +#endif + ApplicationCacheHost(DocumentLoader*); ~ApplicationCacheHost(); @@ -112,7 +146,10 @@ namespace WebCore { void stopDeferringEvents(); // Also raises the events that have been queued up. - ApplicationCache* applicationCacheForInspector() const { return applicationCache(); } +#if ENABLE(INSPECTOR) + void fillResourceList(ResourceInfoList*); + CacheInfo applicationCacheInfo(); +#endif private: bool isApplicationCacheEnabled(); @@ -135,7 +172,6 @@ namespace WebCore { #if PLATFORM(CHROMIUM) friend class ApplicationCacheHostInternal; OwnPtr<ApplicationCacheHostInternal> m_internal; - ApplicationCache* applicationCache() const { return 0; } // FIXME: Implement for Chromium Web Inspector Support. #else friend class ApplicationCacheGroup; friend class ApplicationCacheStorage; diff --git a/WebCore/manual-tests/autoscroll-over-scrollbar.html b/WebCore/manual-tests/autoscroll-over-scrollbar.html new file mode 100644 index 0000000..2330ed1 --- /dev/null +++ b/WebCore/manual-tests/autoscroll-over-scrollbar.html @@ -0,0 +1,8 @@ +<html> + <body> + <h1><a href="https://bugs.webkit.org/show_bug.cgi?id=40403">Bug 40403</a></h1> + <p>Click down somewhere in this text, then move the pointer over the scrollbar at the bottom of the window, stop there, holding the mouse button down.</p> + <div style="height:3000px; width:3000px;"></div> + <p>If the bug occurs, then this text won't be selected until you move the mouse slightly. If the bug does not occur, this text should be selected.</p> + </body> +</html> diff --git a/WebCore/mathml/mathattrs.in b/WebCore/mathml/mathattrs.in index 55a25ed..5431453 100644 --- a/WebCore/mathml/mathattrs.in +++ b/WebCore/mathml/mathattrs.in @@ -4,6 +4,7 @@ guardFactoryWith="ENABLE(MATHML)" attrsNullNamespace close +definitionURL denomalign linethickness mathbackground diff --git a/WebCore/page/DOMWindow.cpp b/WebCore/page/DOMWindow.cpp index 6498042..a369a32 100644 --- a/WebCore/page/DOMWindow.cpp +++ b/WebCore/page/DOMWindow.cpp @@ -56,6 +56,7 @@ #include "FrameView.h" #include "HTMLFrameOwnerElement.h" #include "History.h" +#include "IDBKeyRange.h" #include "IndexedDatabase.h" #include "IndexedDatabaseRequest.h" #include "InspectorController.h" @@ -483,6 +484,7 @@ void DOMWindow::clear() #endif #if ENABLE(INDEXED_DATABASE) + m_idb_key_range = 0; m_indexedDatabaseRequest = 0; #endif } @@ -705,6 +707,14 @@ IndexedDatabaseRequest* DOMWindow::indexedDB() const m_indexedDatabaseRequest = IndexedDatabaseRequest::create(page->group().indexedDatabase()); return m_indexedDatabaseRequest.get(); } + +IDBKeyRange* DOMWindow::iDBKeyRange() const +{ + if (!m_idb_key_range) + m_idb_key_range = IDBKeyRange::create(0, 0, 0); + + return m_idb_key_range.get(); +} #endif void DOMWindow::postMessage(PassRefPtr<SerializedScriptValue> message, MessagePort* port, const String& targetOrigin, DOMWindow* source, ExceptionCode& ec) diff --git a/WebCore/page/DOMWindow.h b/WebCore/page/DOMWindow.h index 69d7428..7a13651 100644 --- a/WebCore/page/DOMWindow.h +++ b/WebCore/page/DOMWindow.h @@ -53,6 +53,7 @@ namespace WebCore { class FloatRect; class Frame; class History; + class IDBKeyRange; class IndexedDatabaseRequest; class InspectorTimelineAgent; class Location; @@ -231,6 +232,7 @@ namespace WebCore { void pageDestroyed(); #if ENABLE(INDEXED_DATABASE) + IDBKeyRange* iDBKeyRange() const; IndexedDatabaseRequest* indexedDB() const; #endif @@ -422,6 +424,7 @@ namespace WebCore { mutable RefPtr<NotificationCenter> m_notifications; #endif #if ENABLE(INDEXED_DATABASE) + mutable RefPtr<IDBKeyRange> m_idb_key_range; mutable RefPtr<IndexedDatabaseRequest> m_indexedDatabaseRequest; #endif diff --git a/WebCore/page/DOMWindow.idl b/WebCore/page/DOMWindow.idl index f6b9feb..74e7504 100644 --- a/WebCore/page/DOMWindow.idl +++ b/WebCore/page/DOMWindow.idl @@ -174,6 +174,7 @@ module window { #endif #if defined(ENABLE_INDEXED_DATABASE) && ENABLE_INDEXED_DATABASE readonly attribute [EnabledAtRuntime] IndexedDatabaseRequest indexedDB; + readonly attribute [EnabledAtRuntime] IDBKeyRange IDBKeyRange; #endif #if defined(ENABLE_ORIENTATION_EVENTS) && ENABLE_ORIENTATION_EVENTS @@ -741,9 +742,7 @@ module window { #endif #endif -#if defined(ENABLE_DATABASE) - attribute SQLExceptionConstructor SQLException; -#endif + attribute [Conditional=DATABASE] SQLExceptionConstructor SQLException; attribute [Conditional=TOUCH_EVENTS] TouchEventConstructor TouchEvent; diff --git a/WebCore/page/DragController.cpp b/WebCore/page/DragController.cpp index 716772b..d93a256 100644 --- a/WebCore/page/DragController.cpp +++ b/WebCore/page/DragController.cpp @@ -170,7 +170,7 @@ void DragController::dragExited(DragData* dragData) if (RefPtr<FrameView> v = mainFrame->view()) { ClipboardAccessPolicy policy = (!m_documentUnderMouse || m_documentUnderMouse->securityOrigin()->isLocal()) ? ClipboardReadable : ClipboardTypesReadable; - RefPtr<Clipboard> clipboard = dragData->createClipboard(policy); + RefPtr<Clipboard> clipboard = Clipboard::create(policy, dragData, mainFrame); clipboard->setSourceOperation(dragData->draggingSourceOperationMask()); mainFrame->eventHandler()->cancelDragAndDrop(createMouseEvent(dragData), clipboard.get()); clipboard->setAccessPolicy(ClipboardNumb); // invalidate clipboard here for security @@ -193,7 +193,7 @@ bool DragController::performDrag(DragData* dragData) RefPtr<Frame> mainFrame = m_page->mainFrame(); if (mainFrame->view()) { // Sending an event can result in the destruction of the view and part. - RefPtr<Clipboard> clipboard = dragData->createClipboard(ClipboardReadable); + RefPtr<Clipboard> clipboard = Clipboard::create(ClipboardReadable, dragData, mainFrame.get()); clipboard->setSourceOperation(dragData->draggingSourceOperationMask()); mainFrame->eventHandler()->performDragAndDrop(createMouseEvent(dragData), clipboard.get()); clipboard->setAccessPolicy(ClipboardNumb); // invalidate clipboard here for security @@ -524,7 +524,7 @@ bool DragController::tryDHTMLDrag(DragData* dragData, DragOperation& operation) return false; ClipboardAccessPolicy policy = m_documentUnderMouse->securityOrigin()->isLocal() ? ClipboardReadable : ClipboardTypesReadable; - RefPtr<Clipboard> clipboard = dragData->createClipboard(policy); + RefPtr<Clipboard> clipboard = Clipboard::create(policy, dragData, mainFrame.get()); DragOperation srcOpMask = dragData->draggingSourceOperationMask(); clipboard->setSourceOperation(srcOpMask); diff --git a/WebCore/page/EventHandler.cpp b/WebCore/page/EventHandler.cpp index e2fab6e..466ddf5 100644 --- a/WebCore/page/EventHandler.cpp +++ b/WebCore/page/EventHandler.cpp @@ -72,6 +72,7 @@ #include "TextEvent.h" #include "TextIterator.h" #include "UserGestureIndicator.h" +#include "UserTypingGestureIndicator.h" #include "WheelEvent.h" #include "htmlediting.h" // for comparePositions() #include <wtf/CurrentTime.h> @@ -869,11 +870,15 @@ void EventHandler::allowDHTMLDrag(bool& flagDHTML, bool& flagUA) const } #endif // ENABLE(DRAG_SUPPORT) +<<<<<<< HEAD #ifdef ANDROID_HITTEST_WITHSIZE HitTestResult EventHandler::hitTestResultAtPoint(const IntPoint& point, bool allowShadowContent, bool ignoreClipping, HitTestScrollbars testScrollbars, int hitType, const IntSize& pointPadding) #else HitTestResult EventHandler::hitTestResultAtPoint(const IntPoint& point, bool allowShadowContent, bool ignoreClipping, HitTestScrollbars testScrollbars, int hitType) #endif +======= +HitTestResult EventHandler::hitTestResultAtPoint(const IntPoint& point, bool allowShadowContent, bool ignoreClipping, HitTestScrollbars testScrollbars, HitTestRequest::HitTestRequestType hitType) +>>>>>>> webkit.org at r64264 { #ifdef ANDROID_HITTEST_WITHSIZE HitTestResult result(point, pointPadding); @@ -1464,7 +1469,7 @@ bool EventHandler::handleMouseMoveEvent(const PlatformMouseEvent& mouseEvent, Hi // if we are allowed to select. // This means that :hover and :active freeze in the state they were in when the mouse // was pressed, rather than updating for nodes the mouse moves over as you hold the mouse down. - int hitType = HitTestRequest::MouseMove; + HitTestRequest::HitTestRequestType hitType = HitTestRequest::MouseMove; if (m_mousePressed && m_mouseDownMayStartSelect) hitType |= HitTestRequest::ReadOnly; if (m_mousePressed) @@ -2305,6 +2310,7 @@ bool EventHandler::keyEvent(const PlatformKeyboardEvent& initialKeyEvent) return false; UserGestureIndicator gestureIndicator(DefinitelyProcessingUserGesture); + UserTypingGestureIndicator typingGestureIndicator(m_frame); if (FrameView* view = m_frame->view()) view->resetDeferredRepaintDelay(); @@ -2886,7 +2892,7 @@ bool EventHandler::handleTouchEvent(const PlatformTouchEvent& event) const PlatformTouchPoint& point = points[i]; IntPoint pagePoint = documentPointForWindowPoint(m_frame, point.pos()); - int hitType = HitTestRequest::Active | HitTestRequest::ReadOnly; + HitTestRequest::HitTestRequestType hitType = HitTestRequest::Active | HitTestRequest::ReadOnly; // The HitTestRequest types used for mouse events map quite adequately // to touch events. Note that in addition to meaning that the hit test // should affect the active state of the current node if necessary, diff --git a/WebCore/page/EventHandler.h b/WebCore/page/EventHandler.h index 5348502..16dadc6 100644 --- a/WebCore/page/EventHandler.h +++ b/WebCore/page/EventHandler.h @@ -106,11 +106,15 @@ public: void dispatchFakeMouseMoveEventSoonInQuad(const FloatQuad&); +<<<<<<< HEAD #ifdef ANDROID_HITTEST_WITHSIZE HitTestResult hitTestResultAtPoint(const IntPoint&, bool allowShadowContent, bool ignoreClipping = false, HitTestScrollbars scrollbars = DontHitTestScrollbars, int hitType = HitTestRequest::ReadOnly | HitTestRequest::Active, const IntSize& pointPadding = IntSize()); #else HitTestResult hitTestResultAtPoint(const IntPoint&, bool allowShadowContent, bool ignoreClipping = false, HitTestScrollbars scrollbars = DontHitTestScrollbars, int hitType = HitTestRequest::ReadOnly | HitTestRequest::Active); #endif +======= + HitTestResult hitTestResultAtPoint(const IntPoint&, bool allowShadowContent, bool ignoreClipping = false, HitTestScrollbars scrollbars = DontHitTestScrollbars, HitTestRequest::HitTestRequestType hitType = HitTestRequest::ReadOnly | HitTestRequest::Active); +>>>>>>> webkit.org at r64264 bool mousePressed() const { return m_mousePressed; } void setMousePressed(bool pressed) { m_mousePressed = pressed; } diff --git a/WebCore/page/Frame.cpp b/WebCore/page/Frame.cpp index a8d0f15..77bf071 100644 --- a/WebCore/page/Frame.cpp +++ b/WebCore/page/Frame.cpp @@ -77,6 +77,7 @@ #include "TextIterator.h" #include "TextResourceDecoder.h" #include "UserContentURLPattern.h" +#include "UserTypingGestureIndicator.h" #include "XMLNSNames.h" #include "XMLNames.h" #include "htmlediting.h" diff --git a/WebCore/page/FrameView.cpp b/WebCore/page/FrameView.cpp index 31f9910..d460da3 100644 --- a/WebCore/page/FrameView.cpp +++ b/WebCore/page/FrameView.cpp @@ -337,6 +337,22 @@ void FrameView::invalidateRect(const IntRect& rect) renderer->repaintRectangle(repaintRect); } +void FrameView::setFrameRect(const IntRect& newRect) +{ + IntRect oldRect = frameRect(); + if (newRect == oldRect) + return; + + ScrollView::setFrameRect(newRect); + +#if USE(ACCELERATED_COMPOSITING) + if (RenderView* root = m_frame->contentRenderer()) { + if (root->usesCompositing()) + root->compositor()->frameViewDidChangeSize(); + } +#endif +} + void FrameView::setMarginWidth(int w) { // make it update the rendering area when set @@ -534,10 +550,10 @@ bool FrameView::syncCompositingStateRecursive() if (!contentRenderer) return true; // We don't want to keep trying to update layers if we have no renderer. - if (m_layoutTimer.isActive()) { - // Don't sync layers if there's a layout pending. + // If we sync compositing layers when a layout is pending, we may cause painting of compositing + // layer content to occur before layout has happened, which will cause paintContents() to bail. + if (needsLayout()) return false; - } if (GraphicsLayer* rootLayer = contentRenderer->compositor()->rootPlatformLayer()) rootLayer->syncCompositingState(); @@ -1131,8 +1147,20 @@ void FrameView::setScrollPosition(const IntPoint& scrollPoint) void FrameView::scrollPositionChangedViaPlatformWidget() { + scrollPositionChanged(); +} + +void FrameView::scrollPositionChanged() +{ frame()->eventHandler()->sendScrollEvent(); repaintFixedElementsAfterScrolling(); + +#if USE(ACCELERATED_COMPOSITING) + if (RenderView* root = m_frame->contentRenderer()) { + if (root->usesCompositing()) + root->compositor()->frameViewDidScroll(scrollPosition()); + } +#endif } void FrameView::repaintFixedElementsAfterScrolling() @@ -1148,13 +1176,6 @@ void FrameView::repaintFixedElementsAfterScrolling() #endif } } - -#if USE(ACCELERATED_COMPOSITING) - if (RenderView* root = m_frame->contentRenderer()) { - if (root->usesCompositing()) - root->compositor()->updateContentLayerScrollPosition(scrollPosition()); - } -#endif } HostWindow* FrameView::hostWindow() const @@ -1745,7 +1766,7 @@ void FrameView::valueChanged(Scrollbar* bar) IntSize offset = scrollOffset(); ScrollView::valueChanged(bar); if (offset != scrollOffset()) - frame()->eventHandler()->sendScrollEvent(); + scrollPositionChanged(); frame()->loader()->client()->didChangeScrollOffset(); } diff --git a/WebCore/page/FrameView.h b/WebCore/page/FrameView.h index 868a15f..718b793 100644 --- a/WebCore/page/FrameView.h +++ b/WebCore/page/FrameView.h @@ -63,6 +63,7 @@ public: virtual HostWindow* hostWindow() const; virtual void invalidateRect(const IntRect&); + virtual void setFrameRect(const IntRect&); Frame* frame() const { return m_frame.get(); } void clearFrame(); @@ -279,6 +280,7 @@ private: bool updateWidgets(); void scrollToAnchor(); + void scrollPositionChanged(); #if ENABLE(INSPECTOR) InspectorTimelineAgent* inspectorTimelineAgent() const; diff --git a/WebCore/page/Geolocation.cpp b/WebCore/page/Geolocation.cpp index abdb8bf..523c21d 100644 --- a/WebCore/page/Geolocation.cpp +++ b/WebCore/page/Geolocation.cpp @@ -421,6 +421,8 @@ void Geolocation::setIsAllowed(bool allowed) if (isAllowed()) { // Permission request was made during the startUpdating process m_startRequestPermissionNotifier->startTimerIfNeeded(); + // The notifier is always ref'ed by m_oneShots or m_watchers. + GeoNotifier* notifier = m_startRequestPermissionNotifier.get(); m_startRequestPermissionNotifier = 0; #if ENABLE(CLIENT_BASED_GEOLOCATION) if (!m_frame) @@ -428,7 +430,7 @@ void Geolocation::setIsAllowed(bool allowed) Page* page = m_frame->page(); if (!page) return; - page->geolocationController()->addObserver(this); + page->geolocationController()->addObserver(this, notifier->m_options->enableHighAccuracy()); #else // TODO: Handle startUpdate() for non-client based implementations using pre-emptive policy #endif @@ -648,8 +650,7 @@ bool Geolocation::startUpdating(GeoNotifier* notifier) if (!page) return false; - // FIXME: Pass options to client. - page->geolocationController()->addObserver(this); + page->geolocationController()->addObserver(this, notifier->m_options->enableHighAccuracy()); return true; #else #if PLATFORM(ANDROID) diff --git a/WebCore/page/GeolocationController.cpp b/WebCore/page/GeolocationController.cpp index 40f01ba..08932a9 100644 --- a/WebCore/page/GeolocationController.cpp +++ b/WebCore/page/GeolocationController.cpp @@ -45,17 +45,21 @@ GeolocationController::~GeolocationController() m_client->geolocationDestroyed(); } -void GeolocationController::addObserver(Geolocation* observer) +void GeolocationController::addObserver(Geolocation* observer, bool enableHighAccuracy) { // This may be called multiple times with the same observer, though removeObserver() // is called only once with each. - if (m_observers.contains(observer)) - return; - bool wasEmpty = m_observers.isEmpty(); m_observers.add(observer); - if (wasEmpty && m_client) - m_client->startUpdating(); + if (enableHighAccuracy) + m_highAccuracyObservers.add(observer); + + if (m_client) { + if (enableHighAccuracy) + m_client->setEnableHighAccuracy(true); + if (wasEmpty) + m_client->startUpdating(); + } } void GeolocationController::removeObserver(Geolocation* observer) @@ -64,8 +68,14 @@ void GeolocationController::removeObserver(Geolocation* observer) return; m_observers.remove(observer); - if (m_observers.isEmpty() && m_client) - m_client->stopUpdating(); + m_highAccuracyObservers.remove(observer); + + if (m_client) { + if (m_observers.isEmpty()) + m_client->stopUpdating(); + else if (m_highAccuracyObservers.isEmpty()) + m_client->setEnableHighAccuracy(false); + } } void GeolocationController::positionChanged(GeolocationPosition* position) diff --git a/WebCore/page/GeolocationController.h b/WebCore/page/GeolocationController.h index bb36101..57f6e32 100644 --- a/WebCore/page/GeolocationController.h +++ b/WebCore/page/GeolocationController.h @@ -45,7 +45,7 @@ public: GeolocationController(Page*, GeolocationControllerClient*); ~GeolocationController(); - void addObserver(Geolocation*); + void addObserver(Geolocation*, bool enableHighAccuracy); void removeObserver(Geolocation*); void positionChanged(GeolocationPosition*); @@ -58,7 +58,10 @@ private: GeolocationControllerClient* m_client; RefPtr<GeolocationPosition> m_lastPosition; - HashSet<RefPtr<Geolocation> > m_observers; + typedef HashSet<RefPtr<Geolocation> > ObserversSet; + // All observers; both those requesting high accuracy and those not. + ObserversSet m_observers; + ObserversSet m_highAccuracyObservers; }; } // namespace WebCore diff --git a/WebCore/page/GeolocationControllerClient.h b/WebCore/page/GeolocationControllerClient.h index cc0e1e4..4648cf8 100644 --- a/WebCore/page/GeolocationControllerClient.h +++ b/WebCore/page/GeolocationControllerClient.h @@ -36,6 +36,11 @@ public: virtual void startUpdating() = 0; virtual void stopUpdating() = 0; + // FIXME: The V2 Geolocation specification proposes that this property is + // renamed. See http://www.w3.org/2008/geolocation/track/issues/6 + // We should update WebKit to reflect this if and when the V2 specification + // is published. + virtual void setEnableHighAccuracy(bool) = 0; virtual GeolocationPosition* lastPosition() = 0; protected: diff --git a/WebCore/page/History.cpp b/WebCore/page/History.cpp index 78e8ea6..337f5b2 100644 --- a/WebCore/page/History.cpp +++ b/WebCore/page/History.cpp @@ -86,14 +86,7 @@ KURL History::urlForState(const String& urlString) if (urlString.isEmpty()) return baseURL; - KURL absoluteURL(baseURL, urlString); - if (!absoluteURL.isValid()) - return KURL(); - - if (absoluteURL.string().left(absoluteURL.pathStart()) != baseURL.string().left(baseURL.pathStart())) - return KURL(); - - return absoluteURL; + return KURL(baseURL, urlString); } void History::stateObjectAdded(PassRefPtr<SerializedScriptValue> data, const String& title, const String& urlString, StateObjectType stateObjectType, ExceptionCode& ec) @@ -102,7 +95,8 @@ void History::stateObjectAdded(PassRefPtr<SerializedScriptValue> data, const Str return; KURL fullURL = urlForState(urlString); - if (!fullURL.isValid()) { + RefPtr<SecurityOrigin> origin = SecurityOrigin::create(fullURL); + if (!fullURL.isValid() || !m_frame->document()->securityOrigin()->isSameSchemeHostPort(origin.get())) { ec = SECURITY_ERR; return; } diff --git a/WebCore/page/Page.cpp b/WebCore/page/Page.cpp index 8e471fc..c997645 100644 --- a/WebCore/page/Page.cpp +++ b/WebCore/page/Page.cpp @@ -62,6 +62,7 @@ #include "SelectionController.h" #include "Settings.h" #include "SharedBuffer.h" +#include "SpeechInput.h" #include "SpeechInputClient.h" #include "StringHash.h" #include "TextResourceDecoder.h" @@ -127,6 +128,7 @@ static void networkStateChanged() frames[i]->document()->dispatchWindowEvent(Event::create(eventName, false, false)); } +<<<<<<< HEAD #if PLATFORM(ANDROID) && ENABLE(APPLICATION_INSTALLED) static void onPackageResultAvailable() { @@ -140,31 +142,35 @@ static void onPackageResultAvailable() Page::Page(ChromeClient* chromeClient, ContextMenuClient* contextMenuClient, EditorClient* editorClient, DragClient* dragClient, InspectorClient* inspectorClient, PluginHalterClient* pluginHalterClient, GeolocationControllerClient* geolocationControllerClient, DeviceOrientationClient* deviceOrientationClient, BackForwardControllerClient* backForwardControllerClient) : m_chrome(new Chrome(this, chromeClient)) +======= +Page::Page(const PageClients& pageClients) + : m_chrome(new Chrome(this, pageClients.chromeClient)) +>>>>>>> webkit.org at r64264 , m_dragCaretController(new SelectionController(0, true)) #if ENABLE(DRAG_SUPPORT) - , m_dragController(new DragController(this, dragClient)) + , m_dragController(new DragController(this, pageClients.dragClient)) #endif , m_focusController(new FocusController(this)) #if ENABLE(CONTEXT_MENUS) - , m_contextMenuController(new ContextMenuController(this, contextMenuClient)) + , m_contextMenuController(new ContextMenuController(this, pageClients.contextMenuClient)) #endif #if ENABLE(INSPECTOR) - , m_inspectorController(new InspectorController(this, inspectorClient)) + , m_inspectorController(new InspectorController(this, pageClients.inspectorClient)) #endif #if ENABLE(CLIENT_BASED_GEOLOCATION) - , m_geolocationController(new GeolocationController(this, geolocationControllerClient)) + , m_geolocationController(new GeolocationController(this, pageClients.geolocationControllerClient)) #endif #if ENABLE(DEVICE_ORIENTATION) - , m_deviceOrientationController(RuntimeEnabledFeatures::deviceOrientationEnabled() ? new DeviceOrientationController(this, deviceOrientationClient) : 0) + , m_deviceOrientationController(RuntimeEnabledFeatures::deviceOrientationEnabled() ? new DeviceOrientationController(this, pageClients.deviceOrientationClient) : 0) #endif #if ENABLE(INPUT_SPEECH) - , m_speechInputClient(0) + , m_speechInputClient(pageClients.speechInputClient) #endif , m_settings(new Settings(this)) , m_progress(new ProgressTracker) - , m_backForwardController(new BackForwardController(this, backForwardControllerClient)) + , m_backForwardController(new BackForwardController(this, pageClients.backForwardControllerClient)) , m_theme(RenderTheme::themeForPage(this)) - , m_editorClient(editorClient) + , m_editorClient(pageClients.editorClient) , m_frameCount(0) , m_openedByDOM(false) , m_tabKeyCyclesThroughElements(true) @@ -182,22 +188,6 @@ Page::Page(ChromeClient* chromeClient, ContextMenuClient* contextMenuClient, Edi , m_customHTMLTokenizerChunkSize(-1) , m_canStartMedia(true) { -#if !ENABLE(CONTEXT_MENUS) - UNUSED_PARAM(contextMenuClient); -#endif -#if !ENABLE(DRAG_SUPPORT) - UNUSED_PARAM(dragClient); -#endif -#if !ENABLE(INSPECTOR) - UNUSED_PARAM(inspectorClient); -#endif -#if !ENABLE(CLIENT_BASED_GEOLOCATION) - UNUSED_PARAM(geolocationControllerClient); -#endif -#if !ENABLE(CLIENT_DEVICE_ORIENTATION) - UNUSED_PARAM(deviceOrientationClient); -#endif - if (!allPages) { allPages = new HashSet<Page*>; @@ -210,8 +200,8 @@ Page::Page(ChromeClient* chromeClient, ContextMenuClient* contextMenuClient, Edi ASSERT(!allPages->contains(this)); allPages->add(this); - if (pluginHalterClient) { - m_pluginHalter.set(new PluginHalter(pluginHalterClient)); + if (pageClients.pluginHalterClient) { + m_pluginHalter.set(new PluginHalter(pageClients.pluginHalterClient)); m_pluginHalter->setPluginAllowedRunTime(m_settings->pluginAllowedRunTime()); } @@ -809,6 +799,16 @@ InspectorTimelineAgent* Page::inspectorTimelineAgent() const } #endif +#if ENABLE(INPUT_SPEECH) +SpeechInput* Page::speechInput() +{ + ASSERT(m_speechInputClient); + if (!m_speechInput.get()) + m_speechInput.set(new SpeechInput(m_speechInputClient)); + return m_speechInput.get(); +} +#endif + void Page::privateBrowsingStateChanged() { bool privateBrowsingEnabled = m_settings->privateBrowsingEnabled(); diff --git a/WebCore/page/Page.h b/WebCore/page/Page.h index 8599a83..aab95f3 100644 --- a/WebCore/page/Page.h +++ b/WebCore/page/Page.h @@ -70,6 +70,7 @@ namespace WebCore { class VisibleSelection; class SelectionController; class Settings; + class SpeechInput; class SpeechInputClient; #if ENABLE(DOM_STORAGE) @@ -90,7 +91,34 @@ namespace WebCore { public: static void setNeedsReapplyStyles(); - Page(ChromeClient*, ContextMenuClient*, EditorClient*, DragClient*, InspectorClient*, PluginHalterClient*, GeolocationControllerClient*, DeviceOrientationClient*, BackForwardControllerClient*); + // It is up to the platform to ensure that non-null clients are provided where required. + struct PageClients { + PageClients() + : chromeClient(0) + , contextMenuClient(0) + , editorClient(0) + , dragClient(0) + , inspectorClient(0) + , pluginHalterClient(0) + , geolocationControllerClient(0) + , deviceOrientationClient(0) + , backForwardControllerClient(0) + , speechInputClient(0) + { } + + ChromeClient* chromeClient; + ContextMenuClient* contextMenuClient; + EditorClient* editorClient; + DragClient* dragClient; + InspectorClient* inspectorClient; + PluginHalterClient* pluginHalterClient; + GeolocationControllerClient* geolocationControllerClient; + DeviceOrientationClient* deviceOrientationClient; + BackForwardControllerClient* backForwardControllerClient; + SpeechInputClient* speechInputClient; + }; + + Page(const PageClients&); ~Page(); RenderTheme* theme() const { return m_theme.get(); }; @@ -154,8 +182,7 @@ namespace WebCore { DeviceOrientationController* deviceOrientationController() const { return m_deviceOrientationController.get(); } #endif #if ENABLE(INPUT_SPEECH) - void setSpeechInputClient(SpeechInputClient* client) { m_speechInputClient = client; } - SpeechInputClient* speechInputClient() const { return m_speechInputClient; } + SpeechInput* speechInput(); #endif Settings* settings() const { return m_settings.get(); } ProgressTracker* progress() const { return m_progress.get(); } @@ -276,6 +303,7 @@ namespace WebCore { #endif #if ENABLE(INPUT_SPEECH) SpeechInputClient* m_speechInputClient; + OwnPtr<SpeechInput> m_speechInput; #endif OwnPtr<Settings> m_settings; OwnPtr<ProgressTracker> m_progress; diff --git a/WebCore/page/PrintContext.cpp b/WebCore/page/PrintContext.cpp index 2bbc63a..74af4b1 100644 --- a/WebCore/page/PrintContext.cpp +++ b/WebCore/page/PrintContext.cpp @@ -203,6 +203,8 @@ int PrintContext::pageNumberForElement(Element* element, const FloatSize& pageSi String PrintContext::pageProperty(Frame* frame, const char* propertyName, int pageNumber) { Document* document = frame->document(); + PrintContext printContext(frame); + printContext.begin(800); // Any width is OK here. document->updateLayout(); RefPtr<RenderStyle> style = document->styleForPage(pageNumber); @@ -218,6 +220,8 @@ String PrintContext::pageProperty(Frame* frame, const char* propertyName, int pa return String::format("%d", style->fontDescription().computedPixelSize()); if (!strcmp(propertyName, "font-family")) return String::format("%s", style->fontDescription().family().family().string().utf8().data()); + if (!strcmp(propertyName, "size")) + return String::format("%d %d", style->pageSize().width().rawValue(), style->pageSize().height().rawValue()); return String::format("pageProperty() unimplemented for: %s", propertyName); } diff --git a/WebCore/page/SecurityOrigin.cpp b/WebCore/page/SecurityOrigin.cpp index aab8866..87b3ed2 100644 --- a/WebCore/page/SecurityOrigin.cpp +++ b/WebCore/page/SecurityOrigin.cpp @@ -32,6 +32,7 @@ #include "Document.h" #include "KURL.h" #include "OriginAccessEntry.h" +#include "SchemeRegistry.h" #include <wtf/StdLibExtras.h> namespace WebCore { @@ -47,48 +48,6 @@ static OriginAccessMap& originAccessMap() return originAccessMap; } -static URLSchemesMap& localSchemes() -{ - DEFINE_STATIC_LOCAL(URLSchemesMap, localSchemes, ()); - - if (localSchemes.isEmpty()) { - localSchemes.add("file"); -#if PLATFORM(MAC) - localSchemes.add("applewebdata"); -#endif -#if PLATFORM(QT) - localSchemes.add("qrc"); -#endif - } - - return localSchemes; -} - -static URLSchemesMap& secureSchemes() -{ - DEFINE_STATIC_LOCAL(URLSchemesMap, secureSchemes, ()); - - if (secureSchemes.isEmpty()) { - secureSchemes.add("https"); - secureSchemes.add("about"); - secureSchemes.add("data"); - } - - return secureSchemes; -} - -static URLSchemesMap& schemesWithUniqueOrigins() -{ - DEFINE_STATIC_LOCAL(URLSchemesMap, schemesWithUniqueOrigins, ()); - - // This is a willful violation of HTML5. - // See https://bugs.webkit.org/show_bug.cgi?id=11885 - if (schemesWithUniqueOrigins.isEmpty()) - schemesWithUniqueOrigins.add("data"); - - return schemesWithUniqueOrigins; -} - static bool schemeRequiresAuthority(const String& scheme) { DEFINE_STATIC_LOCAL(URLSchemesMap, schemes, ()); @@ -108,7 +67,7 @@ SecurityOrigin::SecurityOrigin(const KURL& url, SandboxFlags sandboxFlags) , m_protocol(url.protocol().isNull() ? "" : url.protocol().lower()) , m_host(url.host().isNull() ? "" : url.host().lower()) , m_port(url.port()) - , m_isUnique(isSandboxed(SandboxOrigin) || shouldTreatURLSchemeAsNoAccess(m_protocol)) + , m_isUnique(isSandboxed(SandboxOrigin) || SchemeRegistry::shouldTreatURLSchemeAsNoAccess(m_protocol)) , m_universalAccess(false) , m_domainWasSetInDOM(false) , m_enforceFilePathSeparation(false) @@ -315,7 +274,7 @@ bool SecurityOrigin::isAccessWhiteListed(const SecurityOrigin* targetOrigin) con bool SecurityOrigin::canLoad(const KURL& url, const String& referrer, Document* document) { - if (!shouldTreatURLAsLocal(url.string())) + if (!SchemeRegistry::shouldTreatURLAsLocal(url.string())) return true; // If we were provided a document, we first check if the access has been white listed. @@ -329,7 +288,7 @@ bool SecurityOrigin::canLoad(const KURL& url, const String& referrer, Document* return documentOrigin->canLoadLocalResources(); } if (!referrer.isEmpty()) - return shouldTreatURLAsLocal(referrer); + return SchemeRegistry::shouldTreatURLAsLocal(referrer); return false; } @@ -357,7 +316,7 @@ void SecurityOrigin::enforceFilePathSeparation() bool SecurityOrigin::isLocal() const { - return shouldTreatURLSchemeAsLocal(m_protocol); + return SchemeRegistry::shouldTreatURLSchemeAsLocal(m_protocol); } bool SecurityOrigin::isSecureTransitionTo(const KURL& url) const @@ -557,85 +516,6 @@ bool SecurityOrigin::isSameSchemeHostPort(const SecurityOrigin* other) const return true; } -void SecurityOrigin::registerURLSchemeAsLocal(const String& scheme) -{ - localSchemes().add(scheme); -} - -void SecurityOrigin::removeURLSchemeRegisteredAsLocal(const String& scheme) -{ - if (scheme == "file") - return; -#if PLATFORM(MAC) - if (scheme == "applewebdata") - return; -#endif - localSchemes().remove(scheme); -} - -const URLSchemesMap& SecurityOrigin::localURLSchemes() -{ - return localSchemes(); -} - -bool SecurityOrigin::shouldTreatURLAsLocal(const String& url) -{ - // This avoids an allocation of another String and the HashSet contains() - // call for the file: and http: schemes. - if (url.length() >= 5) { - const UChar* s = url.characters(); - if (s[0] == 'h' && s[1] == 't' && s[2] == 't' && s[3] == 'p' && s[4] == ':') - return false; - if (s[0] == 'f' && s[1] == 'i' && s[2] == 'l' && s[3] == 'e' && s[4] == ':') - return true; - } - - int loc = url.find(':'); - if (loc == -1) - return false; - - String scheme = url.left(loc); - return localSchemes().contains(scheme); -} - -bool SecurityOrigin::shouldTreatURLSchemeAsLocal(const String& scheme) -{ - // This avoids an allocation of another String and the HashSet contains() - // call for the file: and http: schemes. - if (scheme.length() == 4) { - const UChar* s = scheme.characters(); - if (s[0] == 'h' && s[1] == 't' && s[2] == 't' && s[3] == 'p') - return false; - if (s[0] == 'f' && s[1] == 'i' && s[2] == 'l' && s[3] == 'e') - return true; - } - - if (scheme.isEmpty()) - return false; - - return localSchemes().contains(scheme); -} - -void SecurityOrigin::registerURLSchemeAsNoAccess(const String& scheme) -{ - schemesWithUniqueOrigins().add(scheme); -} - -bool SecurityOrigin::shouldTreatURLSchemeAsNoAccess(const String& scheme) -{ - return schemesWithUniqueOrigins().contains(scheme); -} - -void SecurityOrigin::registerURLSchemeAsSecure(const String& scheme) -{ - secureSchemes().add(scheme); -} - -bool SecurityOrigin::shouldTreatURLSchemeAsSecure(const String& scheme) -{ - return secureSchemes().contains(scheme); -} - bool SecurityOrigin::shouldHideReferrer(const KURL& url, const String& referrer) { bool referrerIsSecureURL = protocolIs(referrer, "https"); diff --git a/WebCore/page/SecurityOrigin.h b/WebCore/page/SecurityOrigin.h index 2254096..fa5b1e4 100644 --- a/WebCore/page/SecurityOrigin.h +++ b/WebCore/page/SecurityOrigin.h @@ -40,8 +40,6 @@ namespace WebCore { -typedef HashSet<String, CaseFoldingHash> URLSchemesMap; - class Document; class KURL; @@ -174,18 +172,6 @@ public: // (and whether it was set) but considering the host. It is used for postMessage. bool isSameSchemeHostPort(const SecurityOrigin*) const; - static void registerURLSchemeAsLocal(const String&); - static void removeURLSchemeRegisteredAsLocal(const String&); - static const URLSchemesMap& localURLSchemes(); - static bool shouldTreatURLAsLocal(const String&); - static bool shouldTreatURLSchemeAsLocal(const String&); - - // Secure schemes do not trigger mixed content warnings. For example, - // https and data are secure schemes because they cannot be corrupted by - // active network attackers. - static void registerURLSchemeAsSecure(const String&); - static bool shouldTreatURLSchemeAsSecure(const String&); - static bool shouldHideReferrer(const KURL&, const String& referrer); enum LocalLoadPolicy { @@ -197,9 +183,6 @@ public: static bool restrictAccessToLocal(); static bool allowSubstituteDataAccessToLocal(); - static void registerURLSchemeAsNoAccess(const String&); - static bool shouldTreatURLSchemeAsNoAccess(const String&); - static void addOriginAccessWhitelistEntry(const SecurityOrigin& sourceOrigin, const String& destinationProtocol, const String& destinationDomains, bool allowDestinationSubdomains); static void removeOriginAccessWhitelistEntry(const SecurityOrigin& sourceOrigin, const String& destinationProtocol, const String& destinationDomains, bool allowDestinationSubdomains); static void resetOriginAccessWhitelists(); diff --git a/WebCore/page/Settings.cpp b/WebCore/page/Settings.cpp index 95c4d21..88bf484 100644 --- a/WebCore/page/Settings.cpp +++ b/WebCore/page/Settings.cpp @@ -142,6 +142,7 @@ Settings::Settings(Page* page) , m_showRepaintCounter(false) , m_experimentalNotificationsEnabled(false) , m_webGLEnabled(false) + , m_acceleratedCanvas2dEnabled(false) , m_loadDeferringEnabled(true) , m_tiledBackingStoreEnabled(false) , m_html5ParserEnabled(true) @@ -149,9 +150,13 @@ Settings::Settings(Page* page) , m_paginateDuringLayoutEnabled(false) , m_dnsPrefetchingEnabled(true) , m_memoryInfoEnabled(false) +<<<<<<< HEAD #ifdef ANDROID_PLUGINS , m_pluginsOnDemand(false) #endif +======= + , m_interactiveFormValidation(false) +>>>>>>> webkit.org at r64264 { // A Frame may not have been created yet, so we initialize the AtomicString // hash before trying to use it. @@ -800,6 +805,11 @@ void Settings::setWebGLEnabled(bool enabled) m_webGLEnabled = enabled; } +void Settings::setAccelerated2dCanvasEnabled(bool enabled) +{ + m_acceleratedCanvas2dEnabled = enabled; +} + void Settings::setLoadDeferringEnabled(bool enabled) { m_loadDeferringEnabled = enabled; diff --git a/WebCore/page/Settings.h b/WebCore/page/Settings.h index 8d02d7c..bae035f 100644 --- a/WebCore/page/Settings.h +++ b/WebCore/page/Settings.h @@ -357,6 +357,9 @@ namespace WebCore { void setWebGLEnabled(bool); bool webGLEnabled() const { return m_webGLEnabled; } + void setAccelerated2dCanvasEnabled(bool); + bool accelerated2dCanvasEnabled() const { return m_acceleratedCanvas2dEnabled; } + void setLoadDeferringEnabled(bool); bool loadDeferringEnabled() const { return m_loadDeferringEnabled; } @@ -379,6 +382,13 @@ namespace WebCore { void setMemoryInfoEnabled(bool flag) { m_memoryInfoEnabled = flag; } bool memoryInfoEnabled() const { return m_memoryInfoEnabled; } + // This setting will be removed when an HTML5 compatibility issue is + // resolved and WebKit implementation of interactive validation is + // completed. See http://webkit.org/b/40520, http://webkit.org/b/40747, + // and http://webkit.org/b/40908 + void setInteractiveFormValidationEnabled(bool flag) { m_interactiveFormValidation = flag; } + bool interactiveFormValidationEnabled() const { return m_interactiveFormValidation; } + private: Page* m_page; @@ -493,6 +503,7 @@ namespace WebCore { bool m_showRepaintCounter : 1; bool m_experimentalNotificationsEnabled : 1; bool m_webGLEnabled : 1; + bool m_acceleratedCanvas2dEnabled : 1; bool m_loadDeferringEnabled : 1; bool m_tiledBackingStoreEnabled : 1; bool m_html5ParserEnabled: 1; @@ -500,9 +511,13 @@ namespace WebCore { bool m_paginateDuringLayoutEnabled : 1; bool m_dnsPrefetchingEnabled : 1; bool m_memoryInfoEnabled: 1; +<<<<<<< HEAD #ifdef ANDROID_PLUGINS bool m_pluginsOnDemand : 1; #endif +======= + bool m_interactiveFormValidation: 1; +>>>>>>> webkit.org at r64264 #if USE(SAFARI_THEME) static bool gShouldPaintNativeControls; diff --git a/WebCore/page/SpeechInput.cpp b/WebCore/page/SpeechInput.cpp index 92df70e..4f37988 100644 --- a/WebCore/page/SpeechInput.cpp +++ b/WebCore/page/SpeechInput.cpp @@ -39,27 +39,48 @@ namespace WebCore { -SpeechInput::SpeechInput(SpeechInputClient* client, SpeechInputListener* listener) +SpeechInput::SpeechInput(SpeechInputClient* client) : m_client(client) - , m_listener(listener) + , m_listener(0) { } -void SpeechInput::recordingComplete() +void SpeechInput::didCompleteRecording() { - m_listener->recordingComplete(); + ASSERT(m_listener); + m_listener->didCompleteRecording(); +} + +void SpeechInput::didCompleteRecognition() +{ + ASSERT(m_listener); + m_listener->didCompleteRecognition(); + m_listener = 0; } void SpeechInput::setRecognitionResult(const String& result) { + ASSERT(m_listener); m_listener->setRecognitionResult(result); } -bool SpeechInput::startRecognition() +bool SpeechInput::startRecognition(SpeechInputListener* listener) +{ + // Cancel any ongoing recognition first. + if (m_listener) { + m_listener->didCompleteRecognition(); + m_listener = 0; + m_client->cancelRecognition(); + } + + m_listener = listener; + return m_client->startRecognition(this); +} + +void SpeechInput::stopRecording() { - if (m_client) - return m_client->startRecognition(this); - return false; + ASSERT(m_listener); + m_client->stopRecording(); } } // namespace WebCore diff --git a/WebCore/page/SpeechInput.h b/WebCore/page/SpeechInput.h index 201be99..2ce0eea 100644 --- a/WebCore/page/SpeechInput.h +++ b/WebCore/page/SpeechInput.h @@ -33,7 +33,7 @@ #if ENABLE(INPUT_SPEECH) -#include "SpeechInputClientListener.h" +#include "SpeechInputListener.h" #include <wtf/Noncopyable.h> namespace WebCore { @@ -45,21 +45,20 @@ class String; // This class connects the input elements requiring speech input with the platform specific // speech recognition engine. It provides methods for the input elements to activate speech // recognition and methods for the speech recognition engine to return back the results. -class SpeechInput : public Noncopyable, public SpeechInputClientListener { +class SpeechInput : public Noncopyable, public SpeechInputListener { public: - SpeechInput(SpeechInputClient*, SpeechInputListener*); + SpeechInput(SpeechInputClient*); virtual ~SpeechInput() { } // Methods invoked by the input elements. - virtual bool startRecognition(); + bool startRecognition(SpeechInputListener* listener); + void stopRecording(); - // SpeechInputClient::Listener methods. - virtual void recordingComplete(); + // SpeechInputListener methods. + virtual void didCompleteRecording(); + virtual void didCompleteRecognition(); virtual void setRecognitionResult(const String&); -protected: - SpeechInputClient* client() const { return m_client; } - private: SpeechInputClient* m_client; SpeechInputListener* m_listener; diff --git a/WebCore/page/SpeechInputClient.h b/WebCore/page/SpeechInputClient.h index be68f46..f6c61cf 100644 --- a/WebCore/page/SpeechInputClient.h +++ b/WebCore/page/SpeechInputClient.h @@ -35,12 +35,20 @@ namespace WebCore { -class SpeechInputClientListener; +class SpeechInputListener; // Provides an interface for SpeechInput to call into the embedder. class SpeechInputClient { public: - virtual bool startRecognition(SpeechInputClientListener* listener) = 0; + virtual bool startRecognition(SpeechInputListener* listener) = 0; + + // Stops audio recording and performs recognition with the audio recorded until now + // (does not discard audio). + virtual void stopRecording() = 0; + + // Cancels an ongoing recognition and discards any audio recorded so far. No partial + // recognition results are returned to the listener. + virtual void cancelRecognition() = 0; protected: virtual ~SpeechInputClient() { } diff --git a/WebCore/page/SpeechInputListener.h b/WebCore/page/SpeechInputListener.h index d087d36..1b21a11 100644 --- a/WebCore/page/SpeechInputListener.h +++ b/WebCore/page/SpeechInputListener.h @@ -40,7 +40,19 @@ class String; // Interface to be implemented by the element which invokes SpeechInput. class SpeechInputListener { public: - virtual void recordingComplete() = 0; + // Informs that audio recording has completed and recognition is underway. + virtual void didCompleteRecording() = 0; + + // Informs that speech recognition has completed. This gets invoked irrespective of whether + // recognition was succesful or not, whether setRecognitionResult() was invoked or not. The + // handler typically frees up any temporary resources allocated and waits for the next speech + // recognition request. + virtual void didCompleteRecognition() = 0; + + // Gives results from speech recognition, either partial or the final results. + // This method can potentially get called multiple times if there are partial results + // available as the user keeps speaking. If the speech could not be recognized properly + // or if there was any other errors in the process, this method may never be called. virtual void setRecognitionResult(const String& result) = 0; protected: diff --git a/WebCore/page/Timing.cpp b/WebCore/page/Timing.cpp index 527390a..f65322b 100644 --- a/WebCore/page/Timing.cpp +++ b/WebCore/page/Timing.cpp @@ -33,6 +33,7 @@ #if ENABLE(WEB_TIMING) +#include "DocumentLoadTiming.h" #include "DocumentLoader.h" #include "Frame.h" #include "ResourceLoadTiming.h" @@ -159,31 +160,49 @@ unsigned long long Timing::domainLookupEnd() const unsigned long long Timing::connectStart() const { - ResourceLoadTiming* timing = resourceLoadTiming(); + DocumentLoader* loader = documentLoader(); + if (!loader) + return 0; + + ResourceLoadTiming* timing = loader->response().resourceLoadTiming(); if (!timing) return 0; - // This will be -1 when a new connection is not established. + // connectStart will be -1 when a network request is not made. // Rather than exposing a special value that indicates no new connection, we "backfill" with domainLookupEnd. int connectStart = timing->connectStart; - if (connectStart < 0) + if (connectStart < 0 || loader->response().connectionReused()) return domainLookupEnd(); + // ResourceLoadTiming's connect phase includes DNS and SSL, however Web Timing's + // connect phase should not. So if there is DNS time, trim it from the start. + if (timing->dnsEnd >= 0 && timing->dnsEnd > connectStart) + connectStart = timing->dnsEnd; + return resourceLoadTimeRelativeToAbsolute(connectStart); } unsigned long long Timing::connectEnd() const { - ResourceLoadTiming* timing = resourceLoadTiming(); + DocumentLoader* loader = documentLoader(); + if (!loader) + return 0; + + ResourceLoadTiming* timing = loader->response().resourceLoadTiming(); if (!timing) return 0; - // This will be -1 when a new connection is not established. + // connectEnd will be -1 when a network request is not made. // Rather than exposing a special value that indicates no new connection, we "backfill" with connectStart. int connectEnd = timing->connectEnd; - if (connectEnd < 0) + if (connectEnd < 0 || loader->response().connectionReused()) return connectStart(); + // ResourceLoadTiming's connect phase includes DNS and SSL, however Web Timing's + // connect phase should not. So if there is SSL time, trim it from the end. + if (timing->sslStart >= 0 && timing->sslStart < connectEnd) + connectEnd = timing->sslStart; + return resourceLoadTimeRelativeToAbsolute(connectEnd); } @@ -290,7 +309,7 @@ unsigned long long Timing::resourceLoadTimeRelativeToAbsolute(int relativeSecond // // Since ResourceLoadTimings came from the network platform layer, we must // check them for skew because they may be from another thread/process. - double baseTime = getPossiblySkewedTimeInKnownRange(resourceTiming->requestTime, documentTiming->fetchStart, documentTiming->responseEnd); + double baseTime = getPossiblySkewedTimeInKnownRange(resourceTiming->requestTime, documentTiming->fetchStart, documentTiming->responseEnd - (resourceTiming->receiveHeadersEnd / 1000.0)); return toIntegerMilliseconds(baseTime) + relativeSeconds; } diff --git a/WebCore/page/animation/AnimationBase.cpp b/WebCore/page/animation/AnimationBase.cpp index 83fd039..4f304e2 100644 --- a/WebCore/page/animation/AnimationBase.cpp +++ b/WebCore/page/animation/AnimationBase.cpp @@ -964,28 +964,33 @@ void AnimationBase::updateStateMachine(AnimStateInput input, double param) case AnimationStateStartWaitStyleAvailable: ASSERT(input == AnimationStateInputStyleAvailable || input == AnimationStateInputPlayStatePaused); - // Start timer has fired, tell the animation to start and wait for it to respond with start time - m_animState = AnimationStateStartWaitResponse; + if (input == AnimationStateInputStyleAvailable) { + // Start timer has fired, tell the animation to start and wait for it to respond with start time + m_animState = AnimationStateStartWaitResponse; - overrideAnimations(); + overrideAnimations(); + + // Start the animation + if (overridden()) { + // We won't try to start accelerated animations if we are overridden and + // just move on to the next state. + m_animState = AnimationStateStartWaitResponse; + m_isAccelerated = false; + updateStateMachine(AnimationStateInputStartTimeSet, beginAnimationUpdateTime()); + } else { + double timeOffset = 0; + // If the value for 'animation-delay' is negative then the animation appears to have started in the past. + if (m_animation->delay() < 0) + timeOffset = -m_animation->delay(); + bool started = startAnimation(timeOffset); - // Start the animation - if (overridden()) { - // We won't try to start accelerated animations if we are overridden and - // just move on to the next state. - m_animState = AnimationStateStartWaitResponse; - m_isAccelerated = false; - updateStateMachine(AnimationStateInputStartTimeSet, beginAnimationUpdateTime()); - } - else { - double timeOffset = 0; - // If the value for 'animation-delay' is negative then the animation appears to have started in the past. - if (m_animation->delay() < 0) - timeOffset = -m_animation->delay(); - bool started = startAnimation(timeOffset); - - m_compAnim->animationController()->addToStartTimeResponseWaitList(this, started); - m_isAccelerated = started; + m_compAnim->animationController()->addToStartTimeResponseWaitList(this, started); + m_isAccelerated = started; + } + } else { + // We're waiting for the style to be available and we got a pause. Pause and wait + m_pauseTime = beginAnimationUpdateTime(); + m_animState = AnimationStatePausedWaitStyleAvailable; } break; case AnimationStateStartWaitResponse: @@ -1075,17 +1080,51 @@ void AnimationBase::updateStateMachine(AnimStateInput input, double param) updateStateMachine(AnimationStateInputStartAnimation, 0); break; case AnimationStatePausedWaitResponse: + case AnimationStatePausedWaitStyleAvailable: case AnimationStatePausedRun: // We treat these two cases the same. The only difference is that, when we are in // AnimationStatePausedWaitResponse, we don't yet have a valid startTime, so we send 0 to startAnimation. // When the AnimationStateInputStartTimeSet comes in and we were in AnimationStatePausedRun, we will notice // that we have already set the startTime and will ignore it. - ASSERT(input == AnimationStateInputPlayStateRunning || input == AnimationStateInputStartTimeSet); + ASSERT(input == AnimationStateInputPlayStateRunning || input == AnimationStateInputStartTimeSet || input == AnimationStateInputStyleAvailable); ASSERT(paused()); - // If we are paused, but we get the callback that notifies us that an accelerated animation started, - // then we ignore the start time and just move into the paused-run state. - if (m_animState == AnimationStatePausedWaitResponse && input == AnimationStateInputStartTimeSet) { + if (input == AnimationStateInputPlayStateRunning) { + // Update the times + if (m_animState == AnimationStatePausedRun) + m_startTime += beginAnimationUpdateTime() - m_pauseTime; + else + m_startTime = 0; + m_pauseTime = -1; + + if (m_animState == AnimationStatePausedWaitStyleAvailable) + m_animState = AnimationStateStartWaitStyleAvailable; + else { + // We were either running or waiting for a begin time response from the animation. + // Either way we need to restart the animation (possibly with an offset if we + // had already been running) and wait for it to start. + m_animState = AnimationStateStartWaitResponse; + + // Start the animation + if (overridden()) { + // We won't try to start accelerated animations if we are overridden and + // just move on to the next state. + updateStateMachine(AnimationStateInputStartTimeSet, beginAnimationUpdateTime()); + m_isAccelerated = true; + } else { + bool started = startAnimation(beginAnimationUpdateTime() - m_startTime); + m_compAnim->animationController()->addToStartTimeResponseWaitList(this, started); + m_isAccelerated = !started; + } + } + break; + } + + if (input == AnimationStateInputStartTimeSet) { + ASSERT(m_animState == AnimationStatePausedWaitResponse); + + // We are paused but we got the callback that notifies us that an accelerated animation started. + // We ignore the start time and just move into the paused-run state. m_animState = AnimationStatePausedRun; ASSERT(m_startTime == 0); m_startTime = param; @@ -1093,27 +1132,11 @@ void AnimationBase::updateStateMachine(AnimStateInput input, double param) break; } - // Update the times - if (m_animState == AnimationStatePausedRun) - m_startTime += beginAnimationUpdateTime() - m_pauseTime; - else - m_startTime = 0; - m_pauseTime = -1; - - // We were waiting for a begin time response from the animation, go back and wait again - m_animState = AnimationStateStartWaitResponse; - - // Start the animation - if (overridden()) { - // We won't try to start accelerated animations if we are overridden and - // just move on to the next state. - updateStateMachine(AnimationStateInputStartTimeSet, beginAnimationUpdateTime()); - m_isAccelerated = false; - } else { - bool started = startAnimation(beginAnimationUpdateTime() - m_startTime); - m_compAnim->animationController()->addToStartTimeResponseWaitList(this, started); - m_isAccelerated = started; - } + ASSERT(m_animState == AnimationStatePausedWaitStyleAvailable); + // We are paused but we got the callback that notifies us that style has been updated. + // We move to the AnimationStatePausedWaitResponse state + m_animState = AnimationStatePausedWaitResponse; + overrideAnimations(); break; case AnimationStateFillingForwards: case AnimationStateDone: diff --git a/WebCore/page/animation/AnimationBase.h b/WebCore/page/animation/AnimationBase.h index 9bdca3a..33a0b1d 100644 --- a/WebCore/page/animation/AnimationBase.h +++ b/WebCore/page/animation/AnimationBase.h @@ -69,6 +69,7 @@ public: AnimationStateLooping, // response received, animation running, loop timer running, waiting for fire AnimationStateEnding, // received, animation running, end timer running, waiting for fire AnimationStatePausedWaitTimer, // in pause mode when animation started + AnimationStatePausedWaitStyleAvailable, // in pause mode when waiting for style setup AnimationStatePausedWaitResponse, // animation paused when in STARTING state AnimationStatePausedRun, // animation paused when in LOOPING or ENDING state AnimationStateDone, // end timer fired, animation finished and removed diff --git a/WebCore/page/chromium/EventHandlerChromium.cpp b/WebCore/page/chromium/EventHandlerChromium.cpp index ff161af..719163f 100644 --- a/WebCore/page/chromium/EventHandlerChromium.cpp +++ b/WebCore/page/chromium/EventHandlerChromium.cpp @@ -129,7 +129,7 @@ bool EventHandler::eventActivatedView(const PlatformMouseEvent& event) const PassRefPtr<Clipboard> EventHandler::createDraggingClipboard() const { RefPtr<ChromiumDataObject> dataObject = ChromiumDataObject::create(); - return ClipboardChromium::create(true, dataObject.get(), ClipboardWritable); + return ClipboardChromium::create(true, dataObject.get(), ClipboardWritable, m_frame); } void EventHandler::focusDocumentView() diff --git a/WebCore/page/gtk/EventHandlerGtk.cpp b/WebCore/page/gtk/EventHandlerGtk.cpp index 0ff67d2..429aea6 100644 --- a/WebCore/page/gtk/EventHandlerGtk.cpp +++ b/WebCore/page/gtk/EventHandlerGtk.cpp @@ -96,7 +96,7 @@ bool EventHandler::passWheelEventToWidget(PlatformWheelEvent& event, Widget* wid PassRefPtr<Clipboard> EventHandler::createDraggingClipboard() const { - return ClipboardGtk::create(ClipboardWritable, DataObjectGtk::create(), true); + return ClipboardGtk::create(ClipboardWritable, DataObjectGtk::create(), true, m_frame); } bool EventHandler::passMousePressEventToSubframe(MouseEventWithHitTestResults& mev, Frame* subframe) diff --git a/WebCore/page/mac/WebCoreViewFactory.h b/WebCore/page/mac/WebCoreViewFactory.h index 2ca0d17..9191abe 100644 --- a/WebCore/page/mac/WebCoreViewFactory.h +++ b/WebCore/page/mac/WebCoreViewFactory.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2003, 2005, 2009 Apple Computer, Inc. All rights reserved. + * Copyright (C) 2003, 2005, 2009, 2010 Apple Inc. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -28,83 +28,8 @@ @protocol WebCoreViewFactory -- (NSString *)inputElementAltText; -- (NSString *)resetButtonDefaultLabel; -- (NSString *)searchableIndexIntroduction; -- (NSString *)submitButtonDefaultLabel; -- (NSString *)fileButtonChooseFileLabel; -- (NSString *)fileButtonNoFileSelectedLabel; -- (NSString *)copyImageUnknownFileLabel; - -#if ENABLE(CONTEXT_MENUS) -// Context menu item titles -- (NSString *)contextMenuItemTagOpenLinkInNewWindow; -- (NSString *)contextMenuItemTagDownloadLinkToDisk; -- (NSString *)contextMenuItemTagCopyLinkToClipboard; -- (NSString *)contextMenuItemTagOpenImageInNewWindow; -- (NSString *)contextMenuItemTagDownloadImageToDisk; -- (NSString *)contextMenuItemTagCopyImageToClipboard; -- (NSString *)contextMenuItemTagOpenFrameInNewWindow; -- (NSString *)contextMenuItemTagCopy; -- (NSString *)contextMenuItemTagGoBack; -- (NSString *)contextMenuItemTagGoForward; -- (NSString *)contextMenuItemTagStop; -- (NSString *)contextMenuItemTagReload; -- (NSString *)contextMenuItemTagCut; -- (NSString *)contextMenuItemTagPaste; -- (NSString *)contextMenuItemTagNoGuessesFound; -- (NSString *)contextMenuItemTagIgnoreSpelling; -- (NSString *)contextMenuItemTagLearnSpelling; -- (NSString *)contextMenuItemTagSearchInSpotlight; -- (NSString *)contextMenuItemTagSearchWeb; -- (NSString *)contextMenuItemTagLookUpInDictionary; -- (NSString *)contextMenuItemTagOpenLink; -- (NSString *)contextMenuItemTagIgnoreGrammar; -- (NSString *)contextMenuItemTagSpellingMenu; -- (NSString *)contextMenuItemTagShowSpellingPanel:(bool)show; -- (NSString *)contextMenuItemTagCheckSpelling; -- (NSString *)contextMenuItemTagCheckSpellingWhileTyping; -- (NSString *)contextMenuItemTagCheckGrammarWithSpelling; -- (NSString *)contextMenuItemTagFontMenu; -- (NSString *)contextMenuItemTagShowFonts; -- (NSString *)contextMenuItemTagBold; -- (NSString *)contextMenuItemTagItalic; -- (NSString *)contextMenuItemTagUnderline; -- (NSString *)contextMenuItemTagOutline; -- (NSString *)contextMenuItemTagStyles; -- (NSString *)contextMenuItemTagShowColors; -- (NSString *)contextMenuItemTagSpeechMenu; -- (NSString *)contextMenuItemTagStartSpeaking; -- (NSString *)contextMenuItemTagStopSpeaking; -- (NSString *)contextMenuItemTagWritingDirectionMenu; -- (NSString *)contextMenuItemTagTextDirectionMenu; -- (NSString *)contextMenuItemTagDefaultDirection; -- (NSString *)contextMenuItemTagLeftToRight; -- (NSString *)contextMenuItemTagRightToLeft; -- (NSString *)contextMenuItemTagCorrectSpellingAutomatically; -- (NSString *)contextMenuItemTagSubstitutionsMenu; -- (NSString *)contextMenuItemTagShowSubstitutions:(bool)show; -- (NSString *)contextMenuItemTagSmartCopyPaste; -- (NSString *)contextMenuItemTagSmartQuotes; -- (NSString *)contextMenuItemTagSmartDashes; -- (NSString *)contextMenuItemTagSmartLinks; -- (NSString *)contextMenuItemTagTextReplacement; -- (NSString *)contextMenuItemTagTransformationsMenu; -- (NSString *)contextMenuItemTagMakeUpperCase; -- (NSString *)contextMenuItemTagMakeLowerCase; -- (NSString *)contextMenuItemTagCapitalize; -- (NSString *)contextMenuItemTagChangeBack:(NSString *)replacedString; -- (NSString *)contextMenuItemTagInspectElement; -#endif // ENABLE(CONTEXT_MENUS) - -- (NSString *)searchMenuNoRecentSearchesText; -- (NSString *)searchMenuRecentSearchesText; -- (NSString *)searchMenuClearRecentSearchesText; - - (NSString *)defaultLanguageCode; -- (NSString *)imageTitleForFilename:(NSString *)filename width:(int)width height:(int)height; - - (BOOL)objectIsTextMarker:(id)object; - (BOOL)objectIsTextMarkerRange:(id)object; @@ -121,45 +46,6 @@ - (AXUIElementRef)AXUIElementForElement:(id)element; - (void)unregisterUniqueIdForUIElement:(id)element; -- (NSString *)AXWebAreaText; -- (NSString *)AXLinkText; -- (NSString *)AXListMarkerText; -- (NSString *)AXImageMapText; -- (NSString *)AXHeadingText; -- (NSString *)AXDefinitionListTermText; -- (NSString *)AXDefinitionListDefinitionText; -- (NSString *)AXARIAContentGroupText:(NSString *)ariaType; - -- (NSString *)AXButtonActionVerb; -- (NSString *)AXRadioButtonActionVerb; -- (NSString *)AXTextFieldActionVerb; -- (NSString *)AXCheckedCheckBoxActionVerb; -- (NSString *)AXUncheckedCheckBoxActionVerb; -- (NSString *)AXLinkActionVerb; -- (NSString *)AXMenuListPopupActionVerb; -- (NSString *)AXMenuListActionVerb; - -- (NSString *)missingPluginText; -- (NSString *)crashedPluginText; - -- (NSString *)multipleFileUploadTextForNumberOfFiles:(unsigned)numberOfFiles; -// FTP Directory Related -- (NSString *)unknownFileSizeText; - -- (NSString *)mediaElementLoadingStateText; -- (NSString *)mediaElementLiveBroadcastStateText; -- (NSString*)localizedMediaControlElementString:(NSString*)name; -- (NSString*)localizedMediaControlElementHelpText:(NSString*)name; -- (NSString*)localizedMediaTimeDescription:(float)time; - -- (NSString *)validationMessageValueMissingText; -- (NSString *)validationMessageTypeMismatchText; -- (NSString *)validationMessagePatternMismatchText; -- (NSString *)validationMessageTooLongText; -- (NSString *)validationMessageRangeUnderflowText; -- (NSString *)validationMessageRangeOverflowText; -- (NSString *)validationMessageStepMismatchText; - @end @interface WebCoreViewFactory : NSObject diff --git a/WebCore/page/win/EventHandlerWin.cpp b/WebCore/page/win/EventHandlerWin.cpp index e1d5be9..ee4b360 100644 --- a/WebCore/page/win/EventHandlerWin.cpp +++ b/WebCore/page/win/EventHandlerWin.cpp @@ -98,7 +98,7 @@ PassRefPtr<Clipboard> EventHandler::createDraggingClipboard() const #else COMPtr<WCDataObject> dataObject; WCDataObject::createInstance(&dataObject); - return ClipboardWin::create(true, dataObject.get(), ClipboardWritable); + return ClipboardWin::create(true, dataObject.get(), ClipboardWritable, m_frame); #endif } diff --git a/WebCore/platform/ContextMenu.cpp b/WebCore/platform/ContextMenu.cpp index 00bb253..84a2ffc 100644 --- a/WebCore/platform/ContextMenu.cpp +++ b/WebCore/platform/ContextMenu.cpp @@ -815,6 +815,8 @@ void ContextMenu::checkOrEnableIfNeeded(ContextMenuItem& item) const case ContextMenuItemTagInspectElement: #endif case ContextMenuItemBaseCustomTag: + case ContextMenuItemCustomTagNoAction: + case ContextMenuItemLastCustomTag: case ContextMenuItemBaseApplicationTag: break; } diff --git a/WebCore/platform/ContextMenuItem.h b/WebCore/platform/ContextMenuItem.h index 8c46e10..3731e24 100644 --- a/WebCore/platform/ContextMenuItem.h +++ b/WebCore/platform/ContextMenuItem.h @@ -144,6 +144,8 @@ namespace WebCore { ContextMenuItemTagChangeBack, #endif ContextMenuItemBaseCustomTag = 5000, + ContextMenuItemCustomTagNoAction = 5998, + ContextMenuItemLastCustomTag = 5999, ContextMenuItemBaseApplicationTag = 10000 }; diff --git a/WebCore/platform/DragData.h b/WebCore/platform/DragData.h index 230e344..d90a424 100644 --- a/WebCore/platform/DragData.h +++ b/WebCore/platform/DragData.h @@ -26,7 +26,6 @@ #ifndef DragData_h #define DragData_h -#include "ClipboardAccessPolicy.h" #include "Color.h" #include "DragActions.h" #include "IntPoint.h" @@ -70,7 +69,6 @@ typedef void* DragDataRef; namespace WebCore { - class Clipboard; class Document; class DocumentFragment; class KURL; @@ -97,7 +95,6 @@ namespace WebCore { const IntPoint& globalPosition() const { return m_globalPosition; } DragDataRef platformData() const { return m_platformDragData; } DragOperation draggingSourceOperationMask() const { return m_draggingSourceOperationMask; } - PassRefPtr<Clipboard> createClipboard(ClipboardAccessPolicy) const; bool containsURL(FilenameConversionPolicy filenamePolicy = ConvertFilenames) const; bool containsPlainText() const; bool containsCompatibleContent() const; diff --git a/WebCore/platform/LocalizationStrategy.h b/WebCore/platform/LocalizationStrategy.h new file mode 100644 index 0000000..9bde316 --- /dev/null +++ b/WebCore/platform/LocalizationStrategy.h @@ -0,0 +1,172 @@ +/* + * Copyright (C) 2010 Apple Inc. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, + * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS + * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF + * THE POSSIBILITY OF SUCH DAMAGE. + */ + +#ifndef LocalizationStrategy_h +#define LocalizationStrategy_h + +#if USE(PLATFORM_STRATEGIES) + +namespace WebCore { + +class String; +class IntSize; + +class LocalizationStrategy { +public: + virtual String inputElementAltText() = 0; + virtual String resetButtonDefaultLabel() = 0; + virtual String searchableIndexIntroduction() = 0; + virtual String submitButtonDefaultLabel() = 0; + virtual String fileButtonChooseFileLabel() = 0; + virtual String fileButtonNoFileSelectedLabel() = 0; + virtual String copyImageUnknownFileLabel() = 0; + +#if ENABLE(CONTEXT_MENUS) + virtual String contextMenuItemTagOpenLinkInNewWindow() = 0; + virtual String contextMenuItemTagDownloadLinkToDisk() = 0; + virtual String contextMenuItemTagCopyLinkToClipboard() = 0; + virtual String contextMenuItemTagOpenImageInNewWindow() = 0; + virtual String contextMenuItemTagDownloadImageToDisk() = 0; + virtual String contextMenuItemTagCopyImageToClipboard() = 0; + virtual String contextMenuItemTagOpenFrameInNewWindow() = 0; + virtual String contextMenuItemTagCopy() = 0; + virtual String contextMenuItemTagGoBack() = 0; + virtual String contextMenuItemTagGoForward() = 0; + virtual String contextMenuItemTagStop() = 0; + virtual String contextMenuItemTagReload() = 0; + virtual String contextMenuItemTagCut() = 0; + virtual String contextMenuItemTagPaste() = 0; +#if PLATFORM(GTK) + virtual String contextMenuItemTagDelete() = 0; + virtual String contextMenuItemTagSelectAll() = 0; + virtual String contextMenuItemTagInputMethods() = 0; + virtual String contextMenuItemTagUnicode() = 0; +#endif + virtual String contextMenuItemTagNoGuessesFound() = 0; + virtual String contextMenuItemTagIgnoreSpelling() = 0; + virtual String contextMenuItemTagLearnSpelling() = 0; + virtual String contextMenuItemTagSearchWeb() = 0; + virtual String contextMenuItemTagLookUpInDictionary() = 0; + virtual String contextMenuItemTagOpenLink() = 0; + virtual String contextMenuItemTagIgnoreGrammar() = 0; + virtual String contextMenuItemTagSpellingMenu() = 0; + virtual String contextMenuItemTagShowSpellingPanel(bool show) = 0; + virtual String contextMenuItemTagCheckSpelling() = 0; + virtual String contextMenuItemTagCheckSpellingWhileTyping() = 0; + virtual String contextMenuItemTagCheckGrammarWithSpelling() = 0; + virtual String contextMenuItemTagFontMenu() = 0; + virtual String contextMenuItemTagBold() = 0; + virtual String contextMenuItemTagItalic() = 0; + virtual String contextMenuItemTagUnderline() = 0; + virtual String contextMenuItemTagOutline() = 0; + virtual String contextMenuItemTagWritingDirectionMenu() = 0; + virtual String contextMenuItemTagTextDirectionMenu() = 0; + virtual String contextMenuItemTagDefaultDirection() = 0; + virtual String contextMenuItemTagLeftToRight() = 0; + virtual String contextMenuItemTagRightToLeft() = 0; +#if PLATFORM(MAC) + virtual String contextMenuItemTagSearchInSpotlight() = 0; + virtual String contextMenuItemTagShowFonts() = 0; + virtual String contextMenuItemTagStyles() = 0; + virtual String contextMenuItemTagShowColors() = 0; + virtual String contextMenuItemTagSpeechMenu() = 0; + virtual String contextMenuItemTagStartSpeaking() = 0; + virtual String contextMenuItemTagStopSpeaking() = 0; + virtual String contextMenuItemTagCorrectSpellingAutomatically() = 0; + virtual String contextMenuItemTagSubstitutionsMenu() = 0; + virtual String contextMenuItemTagShowSubstitutions(bool show) = 0; + virtual String contextMenuItemTagSmartCopyPaste() = 0; + virtual String contextMenuItemTagSmartQuotes() = 0; + virtual String contextMenuItemTagSmartDashes() = 0; + virtual String contextMenuItemTagSmartLinks() = 0; + virtual String contextMenuItemTagTextReplacement() = 0; + virtual String contextMenuItemTagTransformationsMenu() = 0; + virtual String contextMenuItemTagMakeUpperCase() = 0; + virtual String contextMenuItemTagMakeLowerCase() = 0; + virtual String contextMenuItemTagCapitalize() = 0; + virtual String contextMenuItemTagChangeBack(const String& replacedString) = 0; +#endif + virtual String contextMenuItemTagInspectElement() = 0; +#endif // ENABLE(CONTEXT_MENUS) + + virtual String searchMenuNoRecentSearchesText() = 0; + virtual String searchMenuRecentSearchesText() = 0; + virtual String searchMenuClearRecentSearchesText() = 0; + + virtual String AXWebAreaText() = 0; + virtual String AXLinkText() = 0; + virtual String AXListMarkerText() = 0; + virtual String AXImageMapText() = 0; + virtual String AXHeadingText() = 0; + virtual String AXDefinitionListTermText() = 0; + virtual String AXDefinitionListDefinitionText() = 0; + virtual String AXARIAContentGroupText(const String& ariaType) = 0; + + virtual String AXButtonActionVerb() = 0; + virtual String AXRadioButtonActionVerb() = 0; + virtual String AXTextFieldActionVerb() = 0; + virtual String AXCheckedCheckBoxActionVerb() = 0; + virtual String AXUncheckedCheckBoxActionVerb() = 0; + virtual String AXMenuListActionVerb() = 0; + virtual String AXMenuListPopupActionVerb() = 0; + virtual String AXLinkActionVerb() = 0; + + virtual String missingPluginText() = 0; + virtual String crashedPluginText() = 0; + virtual String multipleFileUploadText(unsigned numberOfFiles) = 0; + virtual String unknownFileSizeText() = 0; + +#if PLATFORM(WIN) + virtual String uploadFileText() = 0; + virtual String allFilesText() = 0; +#endif + + virtual String imageTitle(const String& filename, const IntSize& size) = 0; + + virtual String mediaElementLoadingStateText() = 0; + virtual String mediaElementLiveBroadcastStateText() = 0; + virtual String localizedMediaControlElementString(const String&) = 0; + virtual String localizedMediaControlElementHelpText(const String&) = 0; + virtual String localizedMediaTimeDescription(float) = 0; + + virtual String validationMessageValueMissingText() = 0; + virtual String validationMessageTypeMismatchText() = 0; + virtual String validationMessagePatternMismatchText() = 0; + virtual String validationMessageTooLongText() = 0; + virtual String validationMessageRangeUnderflowText() = 0; + virtual String validationMessageRangeOverflowText() = 0; + virtual String validationMessageStepMismatchText() = 0; + +protected: + virtual ~LocalizationStrategy() + { + } +}; + +} // namespace WebCore + +#endif // USE(PLATFORM_STRATEGIES) + +#endif // LocalizationStrategy_h diff --git a/WebCore/platform/PlatformStrategies.h b/WebCore/platform/PlatformStrategies.h index 22da3ac..f585202 100644 --- a/WebCore/platform/PlatformStrategies.h +++ b/WebCore/platform/PlatformStrategies.h @@ -31,6 +31,7 @@ namespace WebCore { class PluginStrategy; +class LocalizationStrategy; class PlatformStrategies { public: @@ -38,21 +39,33 @@ public: { if (!m_pluginStrategy) m_pluginStrategy = createPluginStrategy(); - return m_pluginStrategy; } + LocalizationStrategy* localizationStrategy() + { + if (!m_localizationStrategy) + m_localizationStrategy = createLocalizationStrategy(); + return m_localizationStrategy; + } + protected: PlatformStrategies() - : m_pluginStrategy(0) + : m_pluginStrategy(0), + m_localizationStrategy(0) + { + } + + virtual ~PlatformStrategies() { } - virtual ~PlatformStrategies() { } -private: +private: virtual PluginStrategy* createPluginStrategy() = 0; + virtual LocalizationStrategy* createLocalizationStrategy() = 0; PluginStrategy* m_pluginStrategy; + LocalizationStrategy* m_localizationStrategy; }; PlatformStrategies* platformStrategies(); diff --git a/WebCore/platform/PopupMenuClient.h b/WebCore/platform/PopupMenuClient.h index a1396e8..976f28c 100644 --- a/WebCore/platform/PopupMenuClient.h +++ b/WebCore/platform/PopupMenuClient.h @@ -43,6 +43,7 @@ public: virtual String itemText(unsigned listIndex) const = 0; virtual String itemLabel(unsigned listIndex) const = 0; + virtual String itemIcon(unsigned listIndex) const = 0; virtual String itemToolTip(unsigned listIndex) const = 0; virtual String itemAccessibilityText(unsigned listIndex) const = 0; virtual bool itemIsEnabled(unsigned listIndex) const = 0; diff --git a/WebCore/platform/SchemeRegistry.cpp b/WebCore/platform/SchemeRegistry.cpp new file mode 100644 index 0000000..0423236 --- /dev/null +++ b/WebCore/platform/SchemeRegistry.cpp @@ -0,0 +1,172 @@ +/* + * Copyright (C) 2010 Apple Inc. All Rights Reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY APPLE, INC. ``AS IS'' AND ANY + * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, + * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY + * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ +#include "config.h" +#include "SchemeRegistry.h" + +namespace WebCore { + +static URLSchemesMap& localURLSchemes() +{ + DEFINE_STATIC_LOCAL(URLSchemesMap, localSchemes, ()); + + if (localSchemes.isEmpty()) { + localSchemes.add("file"); +#if PLATFORM(MAC) + localSchemes.add("applewebdata"); +#endif +#if PLATFORM(QT) + localSchemes.add("qrc"); +#endif + } + + return localSchemes; +} + +static URLSchemesMap& secureSchemes() +{ + DEFINE_STATIC_LOCAL(URLSchemesMap, secureSchemes, ()); + + if (secureSchemes.isEmpty()) { + secureSchemes.add("https"); + secureSchemes.add("about"); + secureSchemes.add("data"); + } + + return secureSchemes; +} + +static URLSchemesMap& schemesWithUniqueOrigins() +{ + DEFINE_STATIC_LOCAL(URLSchemesMap, schemesWithUniqueOrigins, ()); + + // This is a willful violation of HTML5. + // See https://bugs.webkit.org/show_bug.cgi?id=11885 + if (schemesWithUniqueOrigins.isEmpty()) + schemesWithUniqueOrigins.add("data"); + + return schemesWithUniqueOrigins; +} + +static URLSchemesMap& emptyDocumentSchemes() +{ + DEFINE_STATIC_LOCAL(URLSchemesMap, emptyDocumentSchemes, ()); + + if (emptyDocumentSchemes.isEmpty()) + emptyDocumentSchemes.add("about"); + + return emptyDocumentSchemes; +} + +void SchemeRegistry::registerURLSchemeAsLocal(const String& scheme) +{ + WebCore::localURLSchemes().add(scheme); +} + +void SchemeRegistry::removeURLSchemeRegisteredAsLocal(const String& scheme) +{ + if (scheme == "file") + return; +#if PLATFORM(MAC) + if (scheme == "applewebdata") + return; +#endif + WebCore::localURLSchemes().remove(scheme); +} + +const URLSchemesMap& SchemeRegistry::localURLSchemes() +{ + return WebCore::localURLSchemes(); +} + +bool SchemeRegistry::shouldTreatURLAsLocal(const String& url) +{ + // This avoids an allocation of another String and the HashSet contains() + // call for the file: and http: schemes. + if (url.length() >= 5) { + const UChar* s = url.characters(); + if (s[0] == 'h' && s[1] == 't' && s[2] == 't' && s[3] == 'p' && s[4] == ':') + return false; + if (s[0] == 'f' && s[1] == 'i' && s[2] == 'l' && s[3] == 'e' && s[4] == ':') + return true; + } + + int loc = url.find(':'); + if (loc == -1) + return false; + + String scheme = url.left(loc); + return WebCore::localURLSchemes().contains(scheme); +} + +bool SchemeRegistry::shouldTreatURLSchemeAsLocal(const String& scheme) +{ + // This avoids an allocation of another String and the HashSet contains() + // call for the file: and http: schemes. + if (scheme.length() == 4) { + const UChar* s = scheme.characters(); + if (s[0] == 'h' && s[1] == 't' && s[2] == 't' && s[3] == 'p') + return false; + if (s[0] == 'f' && s[1] == 'i' && s[2] == 'l' && s[3] == 'e') + return true; + } + + if (scheme.isEmpty()) + return false; + + return WebCore::localURLSchemes().contains(scheme); +} + +void SchemeRegistry::registerURLSchemeAsNoAccess(const String& scheme) +{ + schemesWithUniqueOrigins().add(scheme); +} + +bool SchemeRegistry::shouldTreatURLSchemeAsNoAccess(const String& scheme) +{ + return schemesWithUniqueOrigins().contains(scheme); +} + +void SchemeRegistry::registerURLSchemeAsSecure(const String& scheme) +{ + secureSchemes().add(scheme); +} + +bool SchemeRegistry::shouldTreatURLSchemeAsSecure(const String& scheme) +{ + return secureSchemes().contains(scheme); +} + +void SchemeRegistry::registerURLSchemeAsEmptyDocument(const String& scheme) +{ + emptyDocumentSchemes().add(scheme); +} + +bool SchemeRegistry::shouldLoadURLSchemeAsEmptyDocument(const String& scheme) +{ + return emptyDocumentSchemes().contains(scheme); +} + +} // namespace WebCore diff --git a/WebCore/platform/SchemeRegistry.h b/WebCore/platform/SchemeRegistry.h new file mode 100644 index 0000000..d92ec4e --- /dev/null +++ b/WebCore/platform/SchemeRegistry.h @@ -0,0 +1,61 @@ +/* + * Copyright (C) 2010 Apple Inc. All Rights Reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY APPLE, INC. ``AS IS'' AND ANY + * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, + * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY + * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ +#ifndef SchemeRegistry_h +#define SchemeRegistry_h + +#include "PlatformString.h" +#include "StringHash.h" +#include <wtf/HashSet.h> + +namespace WebCore { + +typedef HashSet<String, CaseFoldingHash> URLSchemesMap; + +class SchemeRegistry { +public: + static void registerURLSchemeAsLocal(const String&); + static void removeURLSchemeRegisteredAsLocal(const String&); + static const URLSchemesMap& localURLSchemes(); + + static bool shouldTreatURLAsLocal(const String&); + static bool shouldTreatURLSchemeAsLocal(const String&); + + // Secure schemes do not trigger mixed content warnings. For example, + // https and data are secure schemes because they cannot be corrupted by + // active network attackers. + static void registerURLSchemeAsSecure(const String&); + static bool shouldTreatURLSchemeAsSecure(const String&); + + static void registerURLSchemeAsNoAccess(const String&); + static bool shouldTreatURLSchemeAsNoAccess(const String&); + + static void registerURLSchemeAsEmptyDocument(const String&); + static bool shouldLoadURLSchemeAsEmptyDocument(const String&); +}; + +} // namespace WebCore + +#endif // SchemeRegistry_h diff --git a/WebCore/platform/ScrollView.cpp b/WebCore/platform/ScrollView.cpp index 615ae5d..ddecf1e 100644 --- a/WebCore/platform/ScrollView.cpp +++ b/WebCore/platform/ScrollView.cpp @@ -322,7 +322,6 @@ void ScrollView::valueChanged(Scrollbar* scrollbar) if (scrollbarsSuppressed()) return; - repaintFixedElementsAfterScrolling(); scrollContents(scrollDelta); } diff --git a/WebCore/platform/android/ClipboardAndroid.cpp b/WebCore/platform/android/ClipboardAndroid.cpp index 375f980..d9b2d68 100644 --- a/WebCore/platform/android/ClipboardAndroid.cpp +++ b/WebCore/platform/android/ClipboardAndroid.cpp @@ -35,6 +35,11 @@ namespace WebCore { +PassRefPtr<Clipboard> Clipboard::create(ClipboardAccessPolicy, DragData*, Frame*) +{ + return 0; +} + ClipboardAndroid::ClipboardAndroid(ClipboardAccessPolicy policy, bool isForDragging) : Clipboard(policy, isForDragging) { diff --git a/WebCore/platform/android/DragDataAndroid.cpp b/WebCore/platform/android/DragDataAndroid.cpp index 756d007..4e99b2c 100644 --- a/WebCore/platform/android/DragDataAndroid.cpp +++ b/WebCore/platform/android/DragDataAndroid.cpp @@ -27,7 +27,6 @@ #include "config.h" #include "DragData.h" -#include "Clipboard.h" #include "Document.h" #include "DocumentFragment.h" @@ -58,11 +57,6 @@ Color DragData::asColor() const return Color(); } -PassRefPtr<Clipboard> DragData::createClipboard(ClipboardAccessPolicy) const -{ - return 0; -} - bool DragData::containsCompatibleContent() const { return false; diff --git a/WebCore/platform/brew/ClipboardBrew.cpp b/WebCore/platform/brew/ClipboardBrew.cpp index 3fd085a..720d6a6 100644 --- a/WebCore/platform/brew/ClipboardBrew.cpp +++ b/WebCore/platform/brew/ClipboardBrew.cpp @@ -36,6 +36,11 @@ namespace WebCore { +PassRefPtr<Clipboard> Clipboard::create(ClipboardAccessPolicy, DragData*, Frame*) +{ + return 0; +} + ClipboardBrew::ClipboardBrew(ClipboardAccessPolicy policy, bool isForDragging) : Clipboard(policy, isForDragging) { diff --git a/WebCore/platform/brew/DragDataBrew.cpp b/WebCore/platform/brew/DragDataBrew.cpp index eec8bc4..d114fd6 100644 --- a/WebCore/platform/brew/DragDataBrew.cpp +++ b/WebCore/platform/brew/DragDataBrew.cpp @@ -27,7 +27,6 @@ #include "config.h" #include "DragData.h" -#include "Clipboard.h" #include "Document.h" #include "DocumentFragment.h" @@ -58,11 +57,6 @@ Color DragData::asColor() const return Color(); } -PassRefPtr<Clipboard> DragData::createClipboard(ClipboardAccessPolicy) const -{ - return 0; -} - bool DragData::containsCompatibleContent() const { return false; diff --git a/WebCore/platform/chromium/ChromiumBridge.h b/WebCore/platform/chromium/ChromiumBridge.h index 2d9695e..711c728 100644 --- a/WebCore/platform/chromium/ChromiumBridge.h +++ b/WebCore/platform/chromium/ChromiumBridge.h @@ -155,8 +155,7 @@ namespace WebCore { // Geolocation -------------------------------------------------------- static GeolocationServiceBridge* createGeolocationServiceBridge(GeolocationServiceChromium*); - // HTML5 DB ----------------------------------------------------------- -#if ENABLE(DATABASE) + // Databases ---------------------------------------------------------- // Returns a handle to the DB file and ooptionally a handle to its containing directory static PlatformFileHandle databaseOpenFile(const String& vfsFleName, int desiredFlags); // Returns a SQLite code (SQLITE_OK = 0, on success) @@ -165,7 +164,6 @@ namespace WebCore { static long databaseGetFileAttributes(const String& vfsFileName); // Returns the size of the DB file static long long databaseGetFileSize(const String& vfsFileName); -#endif // IndexedDB ---------------------------------------------------------- static PassRefPtr<IndexedDatabase> indexedDatabase(); diff --git a/WebCore/platform/chromium/ClipboardChromium.cpp b/WebCore/platform/chromium/ClipboardChromium.cpp index 8aad8aa..06244a2 100644 --- a/WebCore/platform/chromium/ClipboardChromium.cpp +++ b/WebCore/platform/chromium/ClipboardChromium.cpp @@ -32,6 +32,7 @@ #include "ChromiumDataObject.h" #include "ClipboardUtilitiesChromium.h" #include "Document.h" +#include "DragData.h" #include "Element.h" #include "FileList.h" #include "Frame.h" @@ -43,6 +44,7 @@ #include "PlatformString.h" #include "Range.h" #include "RenderImage.h" +#include "ScriptExecutionContext.h" #include "StringBuilder.h" #include "markup.h" @@ -89,18 +91,25 @@ static ClipboardDataType clipboardTypeFromMIMEType(const String& type) return ClipboardDataTypeOther; } +PassRefPtr<Clipboard> Clipboard::create(ClipboardAccessPolicy policy, DragData* dragData, Frame* frame) +{ + return ClipboardChromium::create(true, dragData->platformData(), policy, frame); +} + ClipboardChromium::ClipboardChromium(bool isForDragging, PassRefPtr<ChromiumDataObject> dataObject, - ClipboardAccessPolicy policy) + ClipboardAccessPolicy policy, + Frame* frame) : Clipboard(policy, isForDragging) , m_dataObject(dataObject) + , m_frame(frame) { } PassRefPtr<ClipboardChromium> ClipboardChromium::create(bool isForDragging, - PassRefPtr<ChromiumDataObject> dataObject, ClipboardAccessPolicy policy) + PassRefPtr<ChromiumDataObject> dataObject, ClipboardAccessPolicy policy, Frame* frame) { - return adoptRef(new ClipboardChromium(isForDragging, dataObject, policy)); + return adoptRef(new ClipboardChromium(isForDragging, dataObject, policy, frame)); } void ClipboardChromium::clearData(const String& type) @@ -355,9 +364,10 @@ PassRefPtr<FileList> ClipboardChromium::files() const if (!m_dataObject || m_dataObject->filenames.isEmpty()) return FileList::create(); + ScriptExecutionContext* scriptExecutionContext = m_frame->document()->scriptExecutionContext(); RefPtr<FileList> fileList = FileList::create(); for (size_t i = 0; i < m_dataObject->filenames.size(); ++i) - fileList->append(File::create(m_dataObject->filenames.at(i))); + fileList->append(File::create(scriptExecutionContext, m_dataObject->filenames.at(i))); return fileList.release(); } diff --git a/WebCore/platform/chromium/ClipboardChromium.h b/WebCore/platform/chromium/ClipboardChromium.h index fbebde2..a4150d0 100644 --- a/WebCore/platform/chromium/ClipboardChromium.h +++ b/WebCore/platform/chromium/ClipboardChromium.h @@ -38,6 +38,7 @@ namespace WebCore { class CachedImage; class ChromiumDataObject; + class Frame; class IntPoint; class ClipboardChromium : public Clipboard, public CachedResourceClient { @@ -45,7 +46,7 @@ namespace WebCore { ~ClipboardChromium() {} static PassRefPtr<ClipboardChromium> create( - bool isForDragging, PassRefPtr<ChromiumDataObject>, ClipboardAccessPolicy); + bool isForDragging, PassRefPtr<ChromiumDataObject>, ClipboardAccessPolicy, Frame*); // Returns the file name (not including the extension). This removes any // invalid file system characters as well as making sure the @@ -79,11 +80,12 @@ namespace WebCore { virtual bool hasData(); private: - ClipboardChromium(bool, PassRefPtr<ChromiumDataObject>, ClipboardAccessPolicy); + ClipboardChromium(bool, PassRefPtr<ChromiumDataObject>, ClipboardAccessPolicy, Frame*); void resetFromClipboard(); void setDragImage(CachedImage*, Node*, const IntPoint&); RefPtr<ChromiumDataObject> m_dataObject; + Frame* m_frame; }; } // namespace WebCore diff --git a/WebCore/platform/chromium/DragDataChromium.cpp b/WebCore/platform/chromium/DragDataChromium.cpp index 2c2151a..674d34d 100644 --- a/WebCore/platform/chromium/DragDataChromium.cpp +++ b/WebCore/platform/chromium/DragDataChromium.cpp @@ -32,8 +32,6 @@ #include "ChromiumBridge.h" #include "ChromiumDataObject.h" -#include "Clipboard.h" -#include "ClipboardChromium.h" #include "DocumentFragment.h" #include "FileSystem.h" #include "KURL.h" @@ -48,14 +46,6 @@ static bool containsHTML(const ChromiumDataObject* dropData) return dropData->textHtml.length() > 0; } -PassRefPtr<Clipboard> DragData::createClipboard(ClipboardAccessPolicy policy) const -{ - RefPtr<ClipboardChromium> clipboard = ClipboardChromium::create(true, - m_platformDragData, policy); - - return clipboard.release(); -} - bool DragData::containsURL(FilenameConversionPolicy filenamePolicy) const { return !asURL(filenamePolicy).isEmpty(); diff --git a/WebCore/platform/chromium/PlatformThemeChromiumGtk.cpp b/WebCore/platform/chromium/PlatformThemeChromiumGtk.cpp index 1f74840..6529482 100644 --- a/WebCore/platform/chromium/PlatformThemeChromiumGtk.cpp +++ b/WebCore/platform/chromium/PlatformThemeChromiumGtk.cpp @@ -180,8 +180,8 @@ void PlatformThemeChromiumGtk::paintArrowButton(GraphicsContext* gc, const IntRe paint.setColor(outlineColor(trackHSV, thumbHSV)); canvas->drawPath(outline, paint); - // If the button is disabled, the arrow is drawn with the outline color. - if (states & EnabledState) + // If the button is disabled or read-only, the arrow is drawn with the outline color. + if (states & EnabledState && !(states & ReadOnlyState)) paint.setColor(SK_ColorBLACK); paint.setAntiAlias(false); diff --git a/WebCore/platform/chromium/PopupMenuChromium.cpp b/WebCore/platform/chromium/PopupMenuChromium.cpp index 4701a75..d07ba2e 100644 --- a/WebCore/platform/chromium/PopupMenuChromium.cpp +++ b/WebCore/platform/chromium/PopupMenuChromium.cpp @@ -71,6 +71,7 @@ static const int kMaxVisibleRows = 20; static const int kMaxHeight = 500; static const int kBorderSize = 1; static const int kTextToLabelPadding = 10; +static const int kLabelToIconPadding = 5; static const TimeStamp kTypeAheadTimeoutMs = 1000; // The settings used for the drop down menu. @@ -959,18 +960,30 @@ void PopupListBox::paintRow(GraphicsContext* gc, const IntRect& rect, int rowInd int textY = rowRect.y() + itemFont.ascent() + (rowRect.height() - itemFont.height()) / 2; gc->drawBidiText(itemFont, textRun, IntPoint(textX, textY)); + // We are using the left padding as the right padding includes room for the scroll-bar which + // does not show in this case. + int rightPadding = max(0, m_popupClient->clientPaddingLeft() - m_popupClient->clientInsetLeft()); + int remainingWidth = rowRect.width() - rightPadding; + + // Draw the icon if applicable. + String itemIcon = m_popupClient->itemIcon(rowIndex); + RefPtr<Image> image(Image::loadPlatformResource(itemIcon.utf8().data())); + if (image && !image->isNull()) { + IntRect imageRect = image->rect(); + remainingWidth -= (imageRect.width() + kLabelToIconPadding); + imageRect.setX(rowRect.width() - rightPadding - imageRect.width()); + imageRect.setY(rowRect.y() + (rowRect.height() - imageRect.height()) / 2); + gc->drawImage(image.get(), DeviceColorSpace, imageRect); + } + // Draw the the label if applicable. if (itemLabel.isEmpty()) return; TextRun labelTextRun(itemLabel.characters(), itemLabel.length(), false, 0, 0, rtl); if (rightAligned) textX = max(0, m_popupClient->clientPaddingLeft() - m_popupClient->clientInsetLeft()); - else { - // We are using the left padding as the right padding includes room for the scroll-bar which - // does not show in this case. - int rightPadding = max(0, m_popupClient->clientPaddingLeft() - m_popupClient->clientInsetLeft()); - textX = rowRect.width() - rightPadding - itemFont.width(labelTextRun); - } + else + textX = remainingWidth - itemFont.width(labelTextRun); gc->setFillColor(labelColor, DeviceColorSpace); gc->drawBidiText(itemFont, labelTextRun, IntPoint(textX, textY)); @@ -1243,10 +1256,16 @@ void PopupListBox::layout() // Ensure the popup is wide enough to fit this item. String text = m_popupClient->itemText(i); - if (!text.isEmpty()) { - int width = itemFont.width(TextRun(text)); - baseWidth = max(baseWidth, width); + String label = m_popupClient->itemLabel(i); + int width = 0; + if (!text.isEmpty()) + width = itemFont.width(TextRun(text)); + if (!label.isEmpty()) { + if (width > 0) + width += kTextToLabelPadding; + width += itemFont.width(TextRun(label)); } + baseWidth = max(baseWidth, width); // FIXME: http://b/1210481 We should get the padding of individual option elements. paddingWidth = max(paddingWidth, m_popupClient->clientPaddingLeft() + m_popupClient->clientPaddingRight()); diff --git a/WebCore/platform/efl/ClipboardEfl.cpp b/WebCore/platform/efl/ClipboardEfl.cpp index 6ef51cf..1633ccb 100644 --- a/WebCore/platform/efl/ClipboardEfl.cpp +++ b/WebCore/platform/efl/ClipboardEfl.cpp @@ -27,11 +27,16 @@ #include "StringHash.h" namespace WebCore { -PassRefPtr<Clipboard> Editor::newGeneralClipboard(ClipboardAccessPolicy policy) +PassRefPtr<Clipboard> Editor::newGeneralClipboard(ClipboardAccessPolicy policy, Frame*) { return new ClipboardEfl(policy, false); } +PassRefPtr<Clipboard> Clipboard::create(ClipboardAccessPolicy, DragData*, Frame*) +{ + return 0; +} + ClipboardEfl::ClipboardEfl(ClipboardAccessPolicy policy, bool forDragging) : Clipboard(policy, forDragging) { diff --git a/WebCore/platform/efl/DragDataEfl.cpp b/WebCore/platform/efl/DragDataEfl.cpp index f6b446c..a8458d6 100644 --- a/WebCore/platform/efl/DragDataEfl.cpp +++ b/WebCore/platform/efl/DragDataEfl.cpp @@ -21,7 +21,6 @@ #include "config.h" #include "DragData.h" -#include "Clipboard.h" #include "Document.h" #include "DocumentFragment.h" @@ -61,11 +60,6 @@ Color DragData::asColor() const return Color(); } -PassRefPtr<Clipboard> DragData::createClipboard(ClipboardAccessPolicy) const -{ - return 0; -} - bool DragData::containsCompatibleContent() const { return false; diff --git a/WebCore/platform/efl/FileSystemEfl.cpp b/WebCore/platform/efl/FileSystemEfl.cpp index 31b2e22..cb117bc 100644 --- a/WebCore/platform/efl/FileSystemEfl.cpp +++ b/WebCore/platform/efl/FileSystemEfl.cpp @@ -42,7 +42,9 @@ #include <dlfcn.h> #include <errno.h> #include <fnmatch.h> +#if ENABLE(GLIB_SUPPORT) #include <glib.h> // TODO: remove me after following TODO is solved. +#endif #include <limits.h> #include <stdio.h> #include <sys/stat.h> @@ -55,13 +57,13 @@ CString fileSystemRepresentation(const String& path) { // WARNING: this is just used by platform/network/soup, thus must be GLIB!!! // TODO: move this to CString and use it instead in both, being more standard -#if PLATFORM(WIN_OS) - return path.utf8(); -#else +#if !PLATFORM(WIN_OS) && defined(WTF_USE_SOUP) char* filename = g_uri_unescape_string(path.utf8().data(), 0); CString cfilename(filename); g_free(filename); return cfilename; +#else + return path.utf8(); #endif } diff --git a/WebCore/platform/efl/LoggingEfl.cpp b/WebCore/platform/efl/LoggingEfl.cpp index 1829c80..55de765 100644 --- a/WebCore/platform/efl/LoggingEfl.cpp +++ b/WebCore/platform/efl/LoggingEfl.cpp @@ -23,10 +23,41 @@ #include "config.h" #include "Logging.h" +#include "PlatformString.h" +#include <Eina.h> + namespace WebCore { void InitializeLoggingChannelsIfNecessary() { + static bool didInitializeLoggingChannels = false; + if (didInitializeLoggingChannels) + return; + + didInitializeLoggingChannels = true; + + char* logEnv = getenv("WEBKIT_DEBUG"); + if (!logEnv) + return; + +#if defined(NDEBUG) + EINA_LOG_WARN("WEBKIT_DEBUG is not empty, but this is a release build. Notice that many log messages will only appear in a debug build."); +#endif + + char** logv = eina_str_split(logEnv, ",", -1); + + EINA_SAFETY_ON_NULL_RETURN(logv); + + for (int i = 0; logv[i]; i++) { + if (WTFLogChannel* channel = getChannelFromName(logv[i])) + channel->state = WTFLogChannelOn; + } + + free(*logv); + free(logv); + + // To disable logging notImplemented set the DISABLE_NI_WARNING + // environment variable to 1. LogNotYetImplemented.state = WTFLogChannelOn; } diff --git a/WebCore/platform/efl/WidgetEfl.cpp b/WebCore/platform/efl/WidgetEfl.cpp index 6dbf2c2..d82e99e 100644 --- a/WebCore/platform/efl/WidgetEfl.cpp +++ b/WebCore/platform/efl/WidgetEfl.cpp @@ -222,8 +222,8 @@ void Widget::applyFallbackCursor() return; } #endif - LOG("Ooops, no fallback to set cursor %s!\n", - m_data->m_cursorGroup.utf8().data()); + LOG_ERROR("Ooops, no fallback to set cursor %s!\n", + m_data->m_cursorGroup.utf8().data()); } void Widget::applyCursor() diff --git a/WebCore/platform/graphics/BitmapImage.h b/WebCore/platform/graphics/BitmapImage.h index 2cf30d3..72f3092 100644 --- a/WebCore/platform/graphics/BitmapImage.h +++ b/WebCore/platform/graphics/BitmapImage.h @@ -175,7 +175,7 @@ protected: virtual void draw(GraphicsContext*, const FloatRect& dstRect, const FloatRect& srcRect, ColorSpace styleColorSpace, CompositeOperator); #if (OS(WINCE) && !PLATFORM(QT)) - virtual void drawPattern(GraphicsContext*, const FloatRect& srcRect, const TransformationMatrix& patternTransform, + virtual void drawPattern(GraphicsContext*, const FloatRect& srcRect, const AffineTransform& patternTransform, const FloatPoint& phase, ColorSpace styleColorSpace, CompositeOperator, const FloatRect& destRect); #endif diff --git a/WebCore/platform/graphics/Font.cpp b/WebCore/platform/graphics/Font.cpp index 61f5707..0e93d4f 100644 --- a/WebCore/platform/graphics/Font.cpp +++ b/WebCore/platform/graphics/Font.cpp @@ -68,7 +68,7 @@ Font::Font(const FontDescription& fd, short letterSpacing, short wordSpacing) , m_letterSpacing(letterSpacing) , m_wordSpacing(wordSpacing) , m_isPlatformFont(false) - , m_needsTranscoding(fontTranscoder().needsTranscoding(family().family().string())) + , m_needsTranscoding(fontTranscoder().needsTranscoding(fd)) { } @@ -77,10 +77,10 @@ Font::Font(const FontPlatformData& fontData, bool isPrinterFont, FontSmoothingMo , m_letterSpacing(0) , m_wordSpacing(0) , m_isPlatformFont(true) - , m_needsTranscoding(fontTranscoder().needsTranscoding(family().family().string())) { m_fontDescription.setUsePrinterFont(isPrinterFont); m_fontDescription.setFontSmoothing(fontSmoothingMode); + m_needsTranscoding = fontTranscoder().needsTranscoding(fontDescription()); m_fontList->setPlatformFont(fontData); } @@ -90,7 +90,7 @@ Font::Font(const Font& other) , m_letterSpacing(other.m_letterSpacing) , m_wordSpacing(other.m_wordSpacing) , m_isPlatformFont(other.m_isPlatformFont) - , m_needsTranscoding(fontTranscoder().needsTranscoding(family().family().string())) + , m_needsTranscoding(fontTranscoder().needsTranscoding(other.m_fontDescription)) { } diff --git a/WebCore/platform/graphics/FontDescription.h b/WebCore/platform/graphics/FontDescription.h index fc63db9..86a4349 100644 --- a/WebCore/platform/graphics/FontDescription.h +++ b/WebCore/platform/graphics/FontDescription.h @@ -65,6 +65,7 @@ public: , m_keywordSize(0) , m_fontSmoothing(AutoSmoothing) , m_textRendering(AutoTextRendering) + , m_isSpecifiedFont(false) { } @@ -92,6 +93,7 @@ public: TextRenderingMode textRenderingMode() const { return static_cast<TextRenderingMode>(m_textRendering); } FontTraitsMask traitsMask() const; + bool isSpecifiedFont() const { return m_isSpecifiedFont; } void setFamily(const FontFamily& family) { m_familyList = family; } void setComputedSize(float s) { m_computedSize = s; } @@ -106,6 +108,7 @@ public: void setKeywordSize(unsigned s) { m_keywordSize = s; } void setFontSmoothing(FontSmoothingMode smoothing) { m_fontSmoothing = smoothing; } void setTextRenderingMode(TextRenderingMode rendering) { m_textRendering = rendering; } + void setIsSpecifiedFont(bool isSpecifiedFont) { m_isSpecifiedFont = isSpecifiedFont; } private: FontFamily m_familyList; // The list of font families to be used. @@ -130,6 +133,7 @@ private: unsigned m_fontSmoothing : 2; // FontSmoothingMode unsigned m_textRendering : 2; // TextRenderingMode + bool m_isSpecifiedFont : 1; // True if a web page specifies a non-generic font family as the first font family. }; inline bool FontDescription::operator==(const FontDescription& other) const @@ -146,7 +150,8 @@ inline bool FontDescription::operator==(const FontDescription& other) const && m_renderingMode == other.m_renderingMode && m_keywordSize == other.m_keywordSize && m_fontSmoothing == other.m_fontSmoothing - && m_textRendering == other.m_textRendering; + && m_textRendering == other.m_textRendering + && m_isSpecifiedFont == other.m_isSpecifiedFont; } } diff --git a/WebCore/platform/graphics/GraphicsContext.h b/WebCore/platform/graphics/GraphicsContext.h index 457368b..d5df153 100644 --- a/WebCore/platform/graphics/GraphicsContext.h +++ b/WebCore/platform/graphics/GraphicsContext.h @@ -274,7 +274,7 @@ namespace WebCore { void clipOutRoundedRect(const IntRect&, const IntSize& topLeft, const IntSize& topRight, const IntSize& bottomLeft, const IntSize& bottomRight); void clipPath(WindRule); void clipToImageBuffer(const FloatRect&, const ImageBuffer*); - void clipConvexPolygon(size_t numPoints, const FloatPoint*); + void clipConvexPolygon(size_t numPoints, const FloatPoint*, bool antialias = true); int textDrawingMode(); void setTextDrawingMode(int); @@ -342,16 +342,16 @@ namespace WebCore { #if OS(WINCE) && !PLATFORM(QT) void setBitmap(PassRefPtr<SharedBitmap>); - const TransformationMatrix& affineTransform() const; - TransformationMatrix& affineTransform(); + const AffineTransform& affineTransform() const; + AffineTransform& affineTransform(); void resetAffineTransform(); void fillRect(const FloatRect&, const Gradient*); void drawText(const SimpleFontData* fontData, const GlyphBuffer& glyphBuffer, int from, int numGlyphs, const FloatPoint& point); void drawFrameControl(const IntRect& rect, unsigned type, unsigned state); void drawFocusRect(const IntRect& rect); void paintTextField(const IntRect& rect, unsigned state); - void drawBitmap(SharedBitmap*, const IntRect& dstRect, const IntRect& srcRect, CompositeOperator compositeOp); - void drawBitmapPattern(SharedBitmap*, const FloatRect& tileRectIn, const AffineTransform& patternTransform, const FloatPoint& phase, CompositeOperator op, const FloatRect& destRect, const IntSize& origSourceSize); + void drawBitmap(SharedBitmap*, const IntRect& dstRect, const IntRect& srcRect, ColorSpace styleColorSpace, CompositeOperator compositeOp); + void drawBitmapPattern(SharedBitmap*, const FloatRect& tileRectIn, const AffineTransform& patternTransform, const FloatPoint& phase, ColorSpace styleColorSpace, CompositeOperator op, const FloatRect& destRect, const IntSize& origSourceSize); void drawIcon(HICON icon, const IntRect& dstRect, UINT flags); HDC getWindowsContext(const IntRect&, bool supportAlphaBlend = false, bool mayCreateBitmap = true); // The passed in rect is used to create a bitmap for compositing inside transparency layers. void releaseWindowsContext(HDC, const IntRect&, bool supportAlphaBlend = false, bool mayCreateBitmap = true); // The passed in HDC should be the one handed back by getWindowsContext. diff --git a/WebCore/platform/graphics/Path.h b/WebCore/platform/graphics/Path.h index f2ae2df..86b77f8 100644 --- a/WebCore/platform/graphics/Path.h +++ b/WebCore/platform/graphics/Path.h @@ -59,6 +59,7 @@ typedef BRegion PlatformPath; namespace WebCore { class PlatformPath; } +typedef WebCore::PlatformPath PlatformPath; #else typedef void PlatformPath; #endif diff --git a/WebCore/platform/graphics/cairo/FontPlatformDataCairo.cpp b/WebCore/platform/graphics/cairo/FontPlatformDataCairo.cpp index 974c195..1f94f5a 100644 --- a/WebCore/platform/graphics/cairo/FontPlatformDataCairo.cpp +++ b/WebCore/platform/graphics/cairo/FontPlatformDataCairo.cpp @@ -32,7 +32,9 @@ #include <cairo-ft.h> #include <cairo.h> #include <fontconfig/fcfreetype.h> +#if !PLATFORM(EFL) || ENABLE(GLIB_SUPPORT) #include <gdk/gdk.h> +#endif namespace WebCore { @@ -109,8 +111,10 @@ FontPlatformData::FontPlatformData(const FontDescription& fontDescription, const cairo_matrix_init_scale(&fontMatrix, fontDescription.computedPixelSize(), fontDescription.computedPixelSize()); cairo_matrix_init_identity(&ctm); +#if !PLATFORM(EFL) || ENABLE(GLIB_SUPPORT) if (GdkScreen* screen = gdk_screen_get_default()) options = gdk_screen_get_font_options(screen); +#endif // gdk_screen_get_font_options() returns NULL if no default options are // set, so we always have to check. @@ -149,8 +153,10 @@ FontPlatformData::FontPlatformData(cairo_font_face_t* fontFace, float size, bool static const cairo_font_options_t* defaultOptions = cairo_font_options_create(); const cairo_font_options_t* options = NULL; +#if !PLATFORM(EFL) || ENABLE(GLIB_SUPPORT) if (GdkScreen* screen = gdk_screen_get_default()) options = gdk_screen_get_font_options(screen); +#endif // gdk_screen_get_font_options() returns NULL if no default options are // set, so we always have to check. diff --git a/WebCore/platform/graphics/cairo/GraphicsContextCairo.cpp b/WebCore/platform/graphics/cairo/GraphicsContextCairo.cpp index 6ed8905..96cd4ee 100644 --- a/WebCore/platform/graphics/cairo/GraphicsContextCairo.cpp +++ b/WebCore/platform/graphics/cairo/GraphicsContextCairo.cpp @@ -504,7 +504,7 @@ void GraphicsContext::drawConvexPolygon(size_t npoints, const FloatPoint* points cairo_restore(cr); } -void GraphicsContext::clipConvexPolygon(size_t numPoints, const FloatPoint* points) +void GraphicsContext::clipConvexPolygon(size_t numPoints, const FloatPoint* points, bool antialiased) { if (paintingDisabled()) return; diff --git a/WebCore/platform/graphics/cg/GraphicsContextCG.cpp b/WebCore/platform/graphics/cg/GraphicsContextCG.cpp index a65874c..2de4d14 100644 --- a/WebCore/platform/graphics/cg/GraphicsContextCG.cpp +++ b/WebCore/platform/graphics/cg/GraphicsContextCG.cpp @@ -469,16 +469,24 @@ void GraphicsContext::drawConvexPolygon(size_t npoints, const FloatPoint* points CGContextSetShouldAntialias(context, shouldAntialias()); } -void GraphicsContext::clipConvexPolygon(size_t numPoints, const FloatPoint* points) +void GraphicsContext::clipConvexPolygon(size_t numPoints, const FloatPoint* points, bool antialias) { if (paintingDisabled()) return; if (numPoints <= 1) return; + + CGContextRef context = platformContext(); + + if (antialias != shouldAntialias()) + CGContextSetShouldAntialias(context, antialias); - addConvexPolygonToContext(platformContext(), numPoints, points); + addConvexPolygonToContext(context, numPoints, points); clipPath(RULE_NONZERO); + + if (antialias != shouldAntialias()) + CGContextSetShouldAntialias(context, shouldAntialias()); } void GraphicsContext::applyStrokePattern() diff --git a/WebCore/platform/graphics/cg/ImageBufferCG.cpp b/WebCore/platform/graphics/cg/ImageBufferCG.cpp index fe7f83a..feb8cec 100644 --- a/WebCore/platform/graphics/cg/ImageBufferCG.cpp +++ b/WebCore/platform/graphics/cg/ImageBufferCG.cpp @@ -80,7 +80,7 @@ ImageBuffer::ImageBuffer(const IntSize& size, ImageColorSpace imageColorSpace, b case GrayScale: colorSpace.adoptCF(CGColorSpaceCreateDeviceGray()); break; -#if PLATFORM(MAC) && !defined(BUILDING_ON_TIGER) +#if ((PLATFORM(MAC) || PLATFORM(CHROMIUM)) && !defined(BUILDING_ON_TIGER)) case LinearRGB: colorSpace.adoptCF(CGColorSpaceCreateWithName(kCGColorSpaceGenericRGBLinear)); break; diff --git a/WebCore/platform/graphics/chromium/GLES2Canvas.cpp b/WebCore/platform/graphics/chromium/GLES2Canvas.cpp new file mode 100644 index 0000000..ec188c8 --- /dev/null +++ b/WebCore/platform/graphics/chromium/GLES2Canvas.cpp @@ -0,0 +1,523 @@ +/* + * Copyright (c) 2010, Google Inc. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above + * copyright notice, this list of conditions and the following disclaimer + * in the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Google Inc. nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "config.h" + +#if USE(GLES2_RENDERING) + +#include "GLES2Canvas.h" + +#include "FloatRect.h" +#include "GLES2Context.h" +#include "GLES2Texture.h" + +#include <GLES2/gl2.h> + +#define _USE_MATH_DEFINES +#include <math.h> + +#include <wtf/OwnArrayPtr.h> + +namespace WebCore { + +static inline void affineTo3x3(const AffineTransform& transform, GLfloat mat[9]) +{ + mat[0] = transform.a(); + mat[1] = transform.b(); + mat[2] = 0.0f; + mat[3] = transform.c(); + mat[4] = transform.d(); + mat[5] = 0.0f; + mat[6] = transform.e(); + mat[7] = transform.f(); + mat[8] = 1.0f; +} + +struct GLES2Canvas::State { + State() + : m_fillColor(0, 0, 0, 255) + , m_alpha(1.0f) + , m_compositeOp(CompositeSourceOver) + { + } + Color m_fillColor; + float m_alpha; + CompositeOperator m_compositeOp; + AffineTransform m_ctm; +}; + +GLES2Canvas::GLES2Canvas(GLES2Context* context, const IntSize& size) + : m_gles2Context(context) + , m_quadVertices(0) + , m_quadIndices(0) + , m_simpleProgram(0) + , m_texProgram(0) + , m_simpleMatrixLocation(-1) + , m_simpleColorLocation(-1) + , m_simplePositionLocation(-1) + , m_texMatrixLocation(-1) + , m_texTexMatrixLocation(-1) + , m_texSamplerLocation(-1) + , m_texAlphaLocation(-1) + , m_texPositionLocation(-1) + , m_state(0) +{ + m_flipMatrix.translate(-1.0f, 1.0f); + m_flipMatrix.scale(2.0f / size.width(), -2.0f / size.height()); + + m_gles2Context->makeCurrent(); + m_gles2Context->resizeOffscreenContent(size); + m_gles2Context->swapBuffers(); + glViewport(0, 0, size.width(), size.height()); + + m_stateStack.append(State()); + m_state = &m_stateStack.last(); +} + +GLES2Canvas::~GLES2Canvas() +{ + m_gles2Context->makeCurrent(); + if (m_simpleProgram) + glDeleteProgram(m_simpleProgram); + if (m_texProgram) + glDeleteProgram(m_texProgram); + if (m_quadVertices) + glDeleteBuffers(1, &m_quadVertices); + if (m_quadIndices) + glDeleteBuffers(1, &m_quadVertices); +} + +void GLES2Canvas::clearRect(const FloatRect& rect) +{ + m_gles2Context->makeCurrent(); + + glScissor(rect.x(), rect.y(), rect.width(), rect.height()); + glEnable(GL_SCISSOR_TEST); + glClear(GL_COLOR_BUFFER_BIT); + glDisable(GL_SCISSOR_TEST); +} + +void GLES2Canvas::fillRect(const FloatRect& rect, const Color& color, ColorSpace colorSpace) +{ + m_gles2Context->makeCurrent(); + + glBindBuffer(GL_ARRAY_BUFFER, getQuadVertices()); + glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, getQuadIndices()); + + float rgba[4]; + color.getRGBA(rgba[0], rgba[1], rgba[2], rgba[3]); + glUniform4f(m_simpleColorLocation, rgba[0] * rgba[3], rgba[1] * rgba[3], rgba[2] * rgba[3], rgba[3]); + + glDrawElements(GL_TRIANGLES, 6, GL_UNSIGNED_SHORT, 0); +} + +void GLES2Canvas::fillRect(const FloatRect& rect) +{ + m_gles2Context->makeCurrent(); + + applyCompositeOperator(m_state->m_compositeOp); + + glBindBuffer(GL_ARRAY_BUFFER, getQuadVertices()); + glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, getQuadIndices()); + + glUseProgram(getSimpleProgram()); + + float rgba[4]; + m_state->m_fillColor.getRGBA(rgba[0], rgba[1], rgba[2], rgba[3]); + glUniform4f(m_simpleColorLocation, rgba[0] * rgba[3], rgba[1] * rgba[3], rgba[2] * rgba[3], rgba[3]); + + AffineTransform matrix(m_flipMatrix); + matrix.multLeft(m_state->m_ctm); + matrix.translate(rect.x(), rect.y()); + matrix.scale(rect.width(), rect.height()); + GLfloat mat[9]; + affineTo3x3(matrix, mat); + glUniformMatrix3fv(m_simpleMatrixLocation, 1, GL_FALSE, mat); + + glVertexAttribPointer(m_simplePositionLocation, 3, GL_FLOAT, GL_FALSE, 0, (GLvoid*)(0)); + + glEnableVertexAttribArray(m_simplePositionLocation); + + glDrawElements(GL_TRIANGLES, 6, GL_UNSIGNED_SHORT, 0); +} + +void GLES2Canvas::setFillColor(const Color& color, ColorSpace colorSpace) +{ + m_state->m_fillColor = color; +} + +void GLES2Canvas::setAlpha(float alpha) +{ + m_state->m_alpha = alpha; +} + +void GLES2Canvas::translate(float x, float y) +{ + m_state->m_ctm.translate(x, y); +} + +void GLES2Canvas::rotate(float angleInRadians) +{ + m_state->m_ctm.rotate(angleInRadians * (180.0f / M_PI)); +} + +void GLES2Canvas::scale(const FloatSize& size) +{ + m_state->m_ctm.scale(size.width(), size.height()); +} + +void GLES2Canvas::concatCTM(const AffineTransform& affine) +{ + m_state->m_ctm.multLeft(affine); +} + +void GLES2Canvas::save() +{ + m_stateStack.append(State(m_stateStack.last())); + m_state = &m_stateStack.last(); +} + +void GLES2Canvas::restore() +{ + ASSERT(!m_stateStack.isEmpty()); + m_stateStack.removeLast(); + m_state = &m_stateStack.last(); +} + +void GLES2Canvas::drawTexturedRect(GLES2Texture* texture, const FloatRect& srcRect, const FloatRect& dstRect, ColorSpace colorSpace, CompositeOperator compositeOp) +{ + drawTexturedRect(texture, srcRect, dstRect, m_state->m_ctm, m_state->m_alpha, colorSpace, compositeOp); +} + +void GLES2Canvas::drawTexturedRect(GLES2Texture* texture, const FloatRect& srcRect, const FloatRect& dstRect, const AffineTransform& transform, float alpha, ColorSpace colorSpace, CompositeOperator compositeOp) +{ + m_gles2Context->makeCurrent(); + + applyCompositeOperator(compositeOp); + + glBindBuffer(GL_ARRAY_BUFFER, getQuadVertices()); + glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, getQuadIndices()); + checkGLError("glBindBuffer"); + + glUseProgram(getTexProgram()); + checkGLError("glUseProgram"); + + glActiveTexture(GL_TEXTURE0); + texture->bind(); + + glUniform1i(m_texSamplerLocation, 0); + checkGLError("glUniform1i"); + + glUniform1f(m_texAlphaLocation, alpha); + checkGLError("glUniform1f for alpha"); + + AffineTransform matrix(m_flipMatrix); + matrix.multLeft(transform); + matrix.translate(dstRect.x(), dstRect.y()); + matrix.scale(dstRect.width(), dstRect.height()); + GLfloat mat[9]; + affineTo3x3(matrix, mat); + glUniformMatrix3fv(m_texMatrixLocation, 1, GL_FALSE, mat); + checkGLError("glUniformMatrix3fv"); + + AffineTransform texMatrix; + texMatrix.scale(1.0f / texture->width(), 1.0f / texture->height()); + texMatrix.translate(srcRect.x(), srcRect.y()); + texMatrix.scale(srcRect.width(), srcRect.height()); + GLfloat texMat[9]; + affineTo3x3(texMatrix, texMat); + glUniformMatrix3fv(m_texTexMatrixLocation, 1, GL_FALSE, texMat); + checkGLError("glUniformMatrix3fv"); + + glVertexAttribPointer(m_texPositionLocation, 3, GL_FLOAT, GL_FALSE, 0, (GLvoid*)(0)); + + glEnableVertexAttribArray(m_texPositionLocation); + + glDrawElements(GL_TRIANGLES, 6, GL_UNSIGNED_SHORT, 0); + checkGLError("glDrawElements"); +} + +void GLES2Canvas::setCompositeOperation(CompositeOperator op) +{ + m_state->m_compositeOp = op; +} + +void GLES2Canvas::applyCompositeOperator(CompositeOperator op) +{ + if (op == m_lastCompositeOp) + return; + + switch (op) { + case CompositeClear: + glEnable(GL_BLEND); + glBlendFunc(GL_ZERO, GL_ZERO); + break; + case CompositeCopy: + glDisable(GL_BLEND); + break; + case CompositeSourceOver: + glEnable(GL_BLEND); + glBlendFunc(GL_ONE, GL_ONE_MINUS_SRC_ALPHA); + break; + case CompositeSourceIn: + glEnable(GL_BLEND); + glBlendFunc(GL_DST_ALPHA, GL_ZERO); + break; + case CompositeSourceOut: + glEnable(GL_BLEND); + glBlendFunc(GL_ONE_MINUS_DST_ALPHA, GL_ZERO); + break; + case CompositeSourceAtop: + glEnable(GL_BLEND); + glBlendFunc(GL_DST_ALPHA, GL_ONE_MINUS_SRC_ALPHA); + break; + case CompositeDestinationOver: + glEnable(GL_BLEND); + glBlendFunc(GL_ONE_MINUS_DST_ALPHA, GL_ONE); + break; + case CompositeDestinationIn: + glEnable(GL_BLEND); + glBlendFunc(GL_ZERO, GL_SRC_ALPHA); + break; + case CompositeDestinationOut: + glEnable(GL_BLEND); + glBlendFunc(GL_ZERO, GL_ONE_MINUS_SRC_ALPHA); + break; + case CompositeDestinationAtop: + glEnable(GL_BLEND); + glBlendFunc(GL_ONE_MINUS_DST_ALPHA, GL_SRC_ALPHA); + break; + case CompositeXOR: + glEnable(GL_BLEND); + glBlendFunc(GL_ONE_MINUS_DST_ALPHA, GL_ONE_MINUS_SRC_ALPHA); + break; + case CompositePlusDarker: + case CompositeHighlight: + // unsupported + glDisable(GL_BLEND); + break; + case CompositePlusLighter: + glEnable(GL_BLEND); + glBlendFunc(GL_ONE, GL_ONE); + break; + } + m_lastCompositeOp = op; +} + +unsigned GLES2Canvas::getQuadVertices() +{ + if (!m_quadVertices) { + GLfloat vertices[] = { 0.0f, 0.0f, 1.0f, + 1.0f, 0.0f, 1.0f, + 1.0f, 1.0f, 1.0f, + 0.0f, 1.0f, 1.0f }; + glGenBuffers(1, &m_quadVertices); + glBindBuffer(GL_ARRAY_BUFFER, m_quadVertices); + glBufferData(GL_ARRAY_BUFFER, sizeof(vertices), vertices, GL_STATIC_DRAW); + } + return m_quadVertices; +} + + +unsigned GLES2Canvas::getQuadIndices() +{ + if (!m_quadIndices) { + GLushort indices[] = { 0, 1, 2, 0, 2, 3}; + + glGenBuffers(1, &m_quadIndices); + glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, m_quadIndices); + glBufferData(GL_ELEMENT_ARRAY_BUFFER, sizeof(indices), indices, GL_STATIC_DRAW); + } + return m_quadIndices; +} + +static GLuint loadShader(GLenum type, const char* shaderSource) +{ + GLuint shader = glCreateShader(type); + if (!shader) + return 0; + + glShaderSource(shader, 1, &shaderSource, 0); + glCompileShader(shader); + GLint compileStatus; + glGetShaderiv(shader, GL_COMPILE_STATUS, &compileStatus); + if (!compileStatus) { + int length; + glGetShaderiv(shader, GL_INFO_LOG_LENGTH, &length); + OwnArrayPtr<char> log(new char[length]); + glGetShaderInfoLog(shader, length, 0, log.get()); + LOG_ERROR(log.get()); + glDeleteShader(shader); + return 0; + } + return shader; +} + +unsigned GLES2Canvas::getSimpleProgram() +{ + if (!m_simpleProgram) { + GLuint vertexShader = loadShader(GL_VERTEX_SHADER, + "uniform mat3 matrix;\n" + "uniform vec4 color;\n" + "attribute vec3 position;\n" + "void main() {\n" + " gl_Position = vec4(matrix * position, 1.0);\n" + "}\n"); + if (!vertexShader) + return 0; + GLuint fragmentShader = loadShader(GL_FRAGMENT_SHADER, + "precision mediump float;\n" + "uniform mat3 matrix;\n" + "uniform vec4 color;\n" + "void main() {\n" + " gl_FragColor = color;\n" + "}\n"); + if (!fragmentShader) + return 0; + m_simpleProgram = glCreateProgram(); + if (!m_simpleProgram) + return 0; + glAttachShader(m_simpleProgram, vertexShader); + glAttachShader(m_simpleProgram, fragmentShader); + glLinkProgram(m_simpleProgram); + GLint linkStatus; + glGetProgramiv(m_simpleProgram, GL_LINK_STATUS, &linkStatus); + if (!linkStatus) { + glDeleteProgram(m_simpleProgram); + m_simpleProgram = 0; + } + glDeleteShader(vertexShader); + glDeleteShader(fragmentShader); + m_simplePositionLocation = glGetAttribLocation(m_simpleProgram, "position"); + m_simpleMatrixLocation = glGetUniformLocation(m_simpleProgram, "matrix"); + m_simpleColorLocation = glGetUniformLocation(m_simpleProgram, "color"); + } + return m_simpleProgram; +} + +unsigned GLES2Canvas::getTexProgram() +{ + if (!m_texProgram) { + GLuint vertexShader = loadShader(GL_VERTEX_SHADER, + "uniform mat3 matrix;\n" + "uniform mat3 texMatrix;\n" + "attribute vec3 position;\n" + "varying vec3 texCoord;\n" + "void main() {\n" + " texCoord = texMatrix * position;\n" + " gl_Position = vec4(matrix * position, 1.0);\n" + "}\n"); + if (!vertexShader) + return 0; + GLuint fragmentShader = loadShader(GL_FRAGMENT_SHADER, + "precision mediump float;\n" + "uniform sampler2D sampler;\n" + "uniform float alpha;\n" + "varying vec3 texCoord;\n" + "void main() {\n" + " gl_FragColor = texture2D(sampler, texCoord.xy)* vec4(alpha);\n" + "}\n"); + if (!fragmentShader) + return 0; + m_texProgram = glCreateProgram(); + if (!m_texProgram) + return 0; + glAttachShader(m_texProgram, vertexShader); + glAttachShader(m_texProgram, fragmentShader); + glLinkProgram(m_texProgram); + GLint linkStatus; + glGetProgramiv(m_texProgram, GL_LINK_STATUS, &linkStatus); + if (!linkStatus) { + glDeleteProgram(m_texProgram); + m_texProgram = 0; + } + glDeleteShader(vertexShader); + glDeleteShader(fragmentShader); + m_texMatrixLocation = glGetUniformLocation(m_texProgram, "matrix"); + m_texSamplerLocation = glGetUniformLocation(m_texProgram, "sampler"); + m_texTexMatrixLocation = glGetUniformLocation(m_texProgram, "texMatrix"); + m_texPositionLocation = glGetAttribLocation(m_texProgram, "position"); + m_texAlphaLocation = glGetUniformLocation(m_texProgram, "alpha"); + } + return m_texProgram; +} + +GLES2Texture* GLES2Canvas::createTexture(NativeImagePtr ptr, GLES2Texture::Format format, int width, int height) +{ + PassRefPtr<GLES2Texture> texture = m_textures.get(ptr); + if (texture) + return texture.get(); + + texture = GLES2Texture::create(format, width, height); + GLES2Texture* t = texture.get(); + m_textures.set(ptr, texture); + return t; +} + +GLES2Texture* GLES2Canvas::getTexture(NativeImagePtr ptr) +{ + PassRefPtr<GLES2Texture> texture = m_textures.get(ptr); + return texture ? texture.get() : 0; +} + +void GLES2Canvas::checkGLError(const char* header) +{ +#ifndef NDEBUG + GLenum err; + while ((err = glGetError()) != GL_NO_ERROR) { + const char* errorStr = "*** UNKNOWN ERROR ***"; + switch (err) { + case GL_INVALID_ENUM: + errorStr = "GL_INVALID_ENUM"; + break; + case GL_INVALID_VALUE: + errorStr = "GL_INVALID_VALUE"; + break; + case GL_INVALID_OPERATION: + errorStr = "GL_INVALID_OPERATION"; + break; + case GL_INVALID_FRAMEBUFFER_OPERATION: + errorStr = "GL_INVALID_FRAMEBUFFER_OPERATION"; + break; + case GL_OUT_OF_MEMORY: + errorStr = "GL_OUT_OF_MEMORY"; + break; + } + if (header) + LOG_ERROR("%s: %s", header, errorStr); + else + LOG_ERROR("%s", errorStr); + } +#endif +} + +} + +#endif diff --git a/WebCore/platform/graphics/chromium/GLES2Canvas.h b/WebCore/platform/graphics/chromium/GLES2Canvas.h new file mode 100644 index 0000000..e3a7a3b --- /dev/null +++ b/WebCore/platform/graphics/chromium/GLES2Canvas.h @@ -0,0 +1,115 @@ +/* + * Copyright (c) 2010, Google Inc. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above + * copyright notice, this list of conditions and the following disclaimer + * in the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Google Inc. nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#ifndef GLES2Canvas_h +#define GLES2Canvas_h + +#if USE(GLES2_RENDERING) + +#include "AffineTransform.h" +#include "Color.h" +#include "ColorSpace.h" +#include "GLES2Texture.h" +#include "GraphicsTypes.h" +#include "ImageSource.h" + +#include <wtf/HashMap.h> +#include <wtf/Noncopyable.h> + +namespace WebCore { + +class FloatRect; +class Color; +class GLES2Context; + +typedef HashMap<NativeImagePtr, RefPtr<GLES2Texture> > TextureHashMap; + +class GLES2Canvas : public Noncopyable { +public: + GLES2Canvas(GLES2Context*, const IntSize&); + ~GLES2Canvas(); + + void fillRect(const FloatRect&, const Color&, ColorSpace); + void fillRect(const FloatRect&); + void clearRect(const FloatRect&); + void setFillColor(const Color&, ColorSpace); + void setAlpha(float alpha); + void setCompositeOperation(CompositeOperator); + void translate(float x, float y); + void rotate(float angleInRadians); + void scale(const FloatSize&); + void concatCTM(const AffineTransform&); + + void save(); + void restore(); + + // non-standard functions + // These are not standard GraphicsContext functions, and should be pushed + // down into a PlatformContextGLES2 at some point. + void drawTexturedRect(GLES2Texture*, const FloatRect& srcRect, const FloatRect& dstRect, const AffineTransform&, float alpha, ColorSpace, CompositeOperator); + void drawTexturedRect(GLES2Texture*, const FloatRect& srcRect, const FloatRect& dstRect, ColorSpace, CompositeOperator); + GLES2Context* gles2Context() { return m_gles2Context; } + GLES2Texture* createTexture(NativeImagePtr, GLES2Texture::Format, int width, int height); + GLES2Texture* getTexture(NativeImagePtr); + +private: + void applyCompositeOperator(CompositeOperator); + void checkGLError(const char* header); + unsigned getQuadVertices(); + unsigned getQuadIndices(); + unsigned getSimpleProgram(); + unsigned getTexProgram(); + + GLES2Context* m_gles2Context; + struct State; + WTF::Vector<State> m_stateStack; + State* m_state; + unsigned m_quadVertices; + unsigned m_quadIndices; + unsigned m_simpleProgram; + unsigned m_texProgram; + int m_simpleMatrixLocation; + int m_simpleColorLocation; + int m_simplePositionLocation; + int m_texMatrixLocation; + int m_texTexMatrixLocation; + int m_texSamplerLocation; + int m_texAlphaLocation; + int m_texPositionLocation; + AffineTransform m_flipMatrix; + TextureHashMap m_textures; + CompositeOperator m_lastCompositeOp; // This is the one last set, not necessarily the one in the state stack. +}; + +} + +#endif + +#endif // GLES2Canvas_h diff --git a/WebCore/platform/graphics/chromium/GLES2Texture.cpp b/WebCore/platform/graphics/chromium/GLES2Texture.cpp new file mode 100644 index 0000000..26c8bf7 --- /dev/null +++ b/WebCore/platform/graphics/chromium/GLES2Texture.cpp @@ -0,0 +1,128 @@ +/* + * Copyright (c) 2010, Google Inc. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above + * copyright notice, this list of conditions and the following disclaimer + * in the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Google Inc. nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "config.h" + +#if USE(GLES2_RENDERING) + +#include "GLES2Texture.h" + +#include <GLES2/gl2.h> + +#include <wtf/OwnArrayPtr.h> + +namespace WebCore { + +GLES2Texture::GLES2Texture(unsigned int textureId, Format format, int width, int height) + : m_textureId(textureId) + , m_format(format) + , m_width(width) + , m_height(height) +{ +} + +GLES2Texture::~GLES2Texture() +{ + glDeleteTextures(1, &m_textureId); +} + +PassRefPtr<GLES2Texture> GLES2Texture::create(Format format, int width, int height) +{ + GLuint textureId; + glGenTextures(1, &textureId); + if (!textureId) + return 0; + + glBindTexture(GL_TEXTURE_2D, textureId); + glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, width, height, 0, GL_RGBA, GL_UNSIGNED_BYTE, 0); + + int max; + glGetIntegerv(GL_MAX_TEXTURE_SIZE, &max); + if (width > max || height > max) + ASSERT(!"texture too big"); + + return adoptRef(new GLES2Texture(textureId, format, width, height)); +} + +static void convertFormat(GLES2Texture::Format format, unsigned int* glFormat, unsigned int* glType, bool* swizzle) +{ + *swizzle = false; + switch (format) { + case GLES2Texture::RGBA8: + *glFormat = GL_RGBA; + *glType = GL_UNSIGNED_BYTE; + break; + case GLES2Texture::BGRA8: +// FIXME: Once we have support for extensions, we should check for EXT_texture_format_BGRA8888, +// and use that if present. + *glFormat = GL_RGBA; + *glType = GL_UNSIGNED_BYTE; + *swizzle = true; + break; + default: + ASSERT(!"bad format"); + break; + } +} + +void GLES2Texture::load(void* pixels) +{ + unsigned int glFormat, glType; + bool swizzle; + convertFormat(m_format, &glFormat, &glType, &swizzle); + glBindTexture(GL_TEXTURE_2D, m_textureId); + if (swizzle) { + ASSERT(glFormat == GL_RGBA && glType == GL_UNSIGNED_BYTE); + // FIXME: This could use PBO's to save doing an extra copy here. + int size = m_width * m_height; + unsigned* pixels32 = static_cast<unsigned*>(pixels); + OwnArrayPtr<unsigned> buf(new unsigned[size]); + unsigned* bufptr = buf.get(); + for (int i = 0; i < size; ++i) { + unsigned pixel = pixels32[i]; + bufptr[i] = pixel & 0xFF00FF00 | ((pixel & 0x00FF0000) >> 16) | ((pixel & 0x000000FF) << 16); + } + glTexSubImage2D(GL_TEXTURE_2D, 0, 0, 0, m_width, m_height, glFormat, glType, buf.get()); + } else + glTexSubImage2D(GL_TEXTURE_2D, 0, 0, 0, m_width, m_height, glFormat, glType, pixels); +} + +void GLES2Texture::bind() +{ + glBindTexture(GL_TEXTURE_2D, m_textureId); + glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR); + glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR); + glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE); + glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE); +} + +} + +#endif diff --git a/WebCore/page/SpeechInputClientListener.h b/WebCore/platform/graphics/chromium/GLES2Texture.h index a9a897e..346365a 100644 --- a/WebCore/page/SpeechInputClientListener.h +++ b/WebCore/platform/graphics/chromium/GLES2Texture.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2010 Google Inc. All rights reserved. + * Copyright (c) 2010, Google Inc. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are @@ -28,27 +28,36 @@ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -#ifndef SpeechInputClientListener_h -#define SpeechInputClientListener_h +#ifndef GLES2Texture_h +#define GLES2Texture_h -#if ENABLE(INPUT_SPEECH) +#if USE(GLES2_RENDERING) -namespace WebCore { +#include "RefCounted.h" +#include "RefPtr.h" -class String; +namespace WebCore { -// Provides an interface for the embedder to call into WebCore. -class SpeechInputClientListener { +class GLES2Texture : public RefCounted<GLES2Texture> { public: - virtual void recordingComplete() = 0; - virtual void setRecognitionResult(const String& result) = 0; - -protected: - virtual ~SpeechInputClientListener() { } + ~GLES2Texture(); + enum Format { RGBA8, BGRA8 }; + static PassRefPtr<GLES2Texture> create(Format, int width, int height); + void bind(); + void load(void* pixels); + Format format() const { return m_format; } + int width() const { return m_width; } + int height() const { return m_height; } +private: + GLES2Texture(unsigned int textureId, Format format, int width, int height); + unsigned int m_textureId; + Format m_format; + int m_width; + int m_height; }; -} // namespace WebCore +} -#endif // ENABLE(INPUT_SPEECH) +#endif -#endif // SpeechInputClientListener_h +#endif // GLES2Texture_h diff --git a/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp b/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp index 7869c45..7184439 100644 --- a/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp +++ b/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp @@ -1255,6 +1255,7 @@ static HashSet<String> mimeTypeCache() || g_str_equal(name, "audio/x-m4a")) { cache.add(String("video/mp4")); cache.add(String("audio/aac")); + cache.add(String("audio/mp4")); cached = true; } @@ -1270,11 +1271,13 @@ static HashSet<String> mimeTypeCache() if (g_str_equal(name, "audio/x-wav")) { cache.add(String("audio/wav")); + cache.add(String("audio/x-wav")); cached = true; } if (g_str_equal(name, "audio/mpeg")) { cache.add(String(name)); + cache.add(String("audio/x-mpeg")); cached = true; // This is what we are handling: @@ -1289,8 +1292,10 @@ static HashSet<String> mimeTypeCache() cache.add(String("audio/mp1")); if (minLayer <= 2 && 2 <= maxLayer) cache.add(String("audio/mp2")); - if (minLayer <= 3 && 3 <= maxLayer) + if (minLayer <= 3 && 3 <= maxLayer) { + cache.add(String("audio/x-mp3")); cache.add(String("audio/mp3")); + } } } } diff --git a/WebCore/platform/graphics/haiku/GraphicsContextHaiku.cpp b/WebCore/platform/graphics/haiku/GraphicsContextHaiku.cpp index f9e1980..6561c11 100644 --- a/WebCore/platform/graphics/haiku/GraphicsContextHaiku.cpp +++ b/WebCore/platform/graphics/haiku/GraphicsContextHaiku.cpp @@ -152,7 +152,7 @@ void GraphicsContext::drawConvexPolygon(size_t pointsLength, const FloatPoint* p m_data->m_view->StrokePolygon(bPoints, pointsLength, true, getHaikuStrokeStyle()); } -void GraphicsContext::clipConvexPolygon(size_t numPoints, const FloatPoint* points) +void GraphicsContext::clipConvexPolygon(size_t numPoints, const FloatPoint* points, bool antialiased) { if (paintingDisabled()) return; diff --git a/WebCore/platform/graphics/qt/GraphicsContextQt.cpp b/WebCore/platform/graphics/qt/GraphicsContextQt.cpp index a828070..e560e15 100644 --- a/WebCore/platform/graphics/qt/GraphicsContextQt.cpp +++ b/WebCore/platform/graphics/qt/GraphicsContextQt.cpp @@ -529,7 +529,7 @@ void GraphicsContext::drawConvexPolygon(size_t npoints, const FloatPoint* points p->restore(); } -void GraphicsContext::clipConvexPolygon(size_t numPoints, const FloatPoint* points) +void GraphicsContext::clipConvexPolygon(size_t numPoints, const FloatPoint* points, bool antialiased) { if (paintingDisabled()) return; @@ -793,9 +793,11 @@ void GraphicsContext::beginPath() void GraphicsContext::addPath(const Path& path) { - QPainterPath newPath = m_data->currentPath; - newPath.addPath(path.platformPath()); - m_data->currentPath = newPath; + if (!m_data->currentPath.elementCount()) { + m_data->currentPath = path.platformPath(); + return; + } + m_data->currentPath.addPath(path.platformPath()); } bool GraphicsContext::inTransparencyLayer() const diff --git a/WebCore/platform/graphics/qt/ImageBufferQt.cpp b/WebCore/platform/graphics/qt/ImageBufferQt.cpp index b4ca617..bc25003 100644 --- a/WebCore/platform/graphics/qt/ImageBufferQt.cpp +++ b/WebCore/platform/graphics/qt/ImageBufferQt.cpp @@ -175,32 +175,53 @@ PassRefPtr<ImageData> getImageData(const IntRect& rect, const ImageBufferData& i endy = size.height(); int numRows = endy - originy; - QImage image = imageData.m_pixmap.toImage(); - if (multiplied == Unmultiplied) - image = image.convertToFormat(QImage::Format_ARGB32); - else - image = image.convertToFormat(QImage::Format_ARGB32_Premultiplied); + // NOTE: For unmultiplied data, we undo the premultiplication below. + QImage image = imageData.m_pixmap.toImage().convertToFormat(QImage::Format_ARGB32_Premultiplied); ASSERT(!image.isNull()); - unsigned destBytesPerRow = 4 * rect.width(); - unsigned char* destRows = data + desty * destBytesPerRow + destx * 4; - for (int y = 0; y < numRows; ++y) { + const int bytesPerLine = image.bytesPerLine(); #if QT_VERSION >= 0x040700 - const quint32* scanLine = reinterpret_cast<const quint32*>(image.constScanLine(y + originy)); + const uchar* bits = image.constBits(); #else - quint32* scanLine = reinterpret_cast<quint32*>(image.scanLine(y + originy)); + const uchar* bits = image.bits(); #endif - for (int x = 0; x < numColumns; x++) { - QRgb value = scanLine[x + originx]; - int basex = x * 4; - - destRows[basex] = qRed(value); - destRows[basex + 1] = qGreen(value); - destRows[basex + 2] = qBlue(value); - destRows[basex + 3] = qAlpha(value); + + quint32* destRows = reinterpret_cast<quint32*>(&data[desty * rect.width() + destx]); + + if (multiplied == Unmultiplied) { + for (int y = 0; y < numRows; ++y) { + const quint32* scanLine = reinterpret_cast<const quint32*>(bits + (y + originy) * bytesPerLine); + for (int x = 0; x < numColumns; x++) { + QRgb pixel = scanLine[x + originx]; + int alpha = qAlpha(pixel); + // Un-premultiply and convert RGB to BGR. + if (alpha == 255) + destRows[x] = (0xFF000000 + | (qBlue(pixel) << 16) + | (qGreen(pixel) << 8) + | (qRed(pixel))); + else if (alpha > 0) + destRows[x] = ((alpha << 24) + | (((255 * qBlue(pixel)) / alpha)) << 16) + | (((255 * qGreen(pixel)) / alpha) << 8) + | ((255 * qRed(pixel)) / alpha); + else + destRows[x] = 0; + } + destRows += rect.width(); + } + } else { + for (int y = 0; y < numRows; ++y) { + const quint32* scanLine = reinterpret_cast<const quint32*>(bits + (y + originy) * bytesPerLine); + for (int x = 0; x < numColumns; x++) { + QRgb pixel = scanLine[x + originx]; + // Convert RGB to BGR. + destRows[x] = ((pixel << 16) & 0xff0000) | ((pixel >> 16) & 0xff) | (pixel & 0xff00ff00); + + } + destRows += rect.width(); } - destRows += destBytesPerRow; } return result; @@ -216,6 +237,22 @@ PassRefPtr<ImageData> ImageBuffer::getPremultipliedImageData(const IntRect& rect return getImageData<Premultiplied>(rect, m_data, m_size); } +static inline unsigned int premultiplyABGRtoARGB(unsigned int x) +{ + unsigned int a = x >> 24; + if (a == 255) + return (x << 16) | ((x >> 16) & 0xff) | (x & 0xff00ff00); + unsigned int t = (x & 0xff00ff) * a; + t = (t + ((t >> 8) & 0xff00ff) + 0x800080) >> 8; + t = ((t << 16) | (t >> 16)) & 0xff00ff; + + x = ((x >> 8) & 0xff) * a; + x = (x + ((x >> 8) & 0xff) + 0x80); + x &= 0xff00; + x |= t | (a << 24); + return x; +} + template <Multiply multiplied> void putImageData(ImageData*& source, const IntRect& sourceRect, const IntPoint& destPoint, ImageBufferData& data, const IntSize& size) { @@ -247,22 +284,33 @@ void putImageData(ImageData*& source, const IntRect& sourceRect, const IntPoint& unsigned srcBytesPerRow = 4 * source->width(); - QRect destRect(destx, desty, endx - destx, endy - desty); - - QImage::Format format = multiplied == Unmultiplied ? QImage::Format_ARGB32 : QImage::Format_ARGB32_Premultiplied; - QImage image(destRect.size(), format); - - unsigned char* srcRows = source->data()->data()->data() + originy * srcBytesPerRow + originx * 4; - for (int y = 0; y < numRows; ++y) { - quint32* scanLine = reinterpret_cast<quint32*>(image.scanLine(y)); - for (int x = 0; x < numColumns; x++) { - // ImageData stores the pixels in RGBA while QImage is ARGB - quint32 pixel = reinterpret_cast<quint32*>(srcRows + 4 * x)[0]; - pixel = ((pixel << 16) & 0xff0000) | ((pixel >> 16) & 0xff) | (pixel & 0xff00ff00); - scanLine[x] = pixel; + // NOTE: For unmultiplied input data, we do the premultiplication below. + QImage image(numColumns, numRows, QImage::Format_ARGB32_Premultiplied); + uchar* bits = image.bits(); + const int bytesPerLine = image.bytesPerLine(); + + const quint32* srcScanLine = reinterpret_cast<const quint32*>(source->data()->data()->data() + originy * srcBytesPerRow + originx * 4); + + if (multiplied == Unmultiplied) { + for (int y = 0; y < numRows; ++y) { + quint32* destScanLine = reinterpret_cast<quint32*>(bits + y * bytesPerLine); + for (int x = 0; x < numColumns; x++) { + // Premultiply and convert BGR to RGB. + quint32 pixel = srcScanLine[x]; + destScanLine[x] = premultiplyABGRtoARGB(pixel); + } + srcScanLine += source->width(); + } + } else { + for (int y = 0; y < numRows; ++y) { + quint32* destScanLine = reinterpret_cast<quint32*>(bits + y * bytesPerLine); + for (int x = 0; x < numColumns; x++) { + // Convert BGR to RGB. + quint32 pixel = srcScanLine[x]; + destScanLine[x] = ((pixel << 16) & 0xff0000) | ((pixel >> 16) & 0xff) | (pixel & 0xff00ff00); + } + srcScanLine += source->width(); } - - srcRows += srcBytesPerRow; } bool isPainting = data.m_painter->isActive(); @@ -278,7 +326,7 @@ void putImageData(ImageData*& source, const IntRect& sourceRect, const IntPoint& } data.m_painter->setCompositionMode(QPainter::CompositionMode_Source); - data.m_painter->drawImage(destRect, image); + data.m_painter->drawImage(destx, desty, image); if (!isPainting) data.m_painter->end(); diff --git a/WebCore/platform/graphics/skia/GraphicsContextSkia.cpp b/WebCore/platform/graphics/skia/GraphicsContextSkia.cpp index 0c1898b..7994244 100644 --- a/WebCore/platform/graphics/skia/GraphicsContextSkia.cpp +++ b/WebCore/platform/graphics/skia/GraphicsContextSkia.cpp @@ -54,6 +54,10 @@ #include <wtf/Assertions.h> #include <wtf/MathExtras.h> +#if USE(GLES2_RENDERING) +#include "GLES2Canvas.h" +#endif + using namespace std; namespace WebCore { @@ -243,6 +247,11 @@ void GraphicsContext::savePlatformState() if (paintingDisabled()) return; +#if USE(GLES2_RENDERING) + if (platformContext()->useGPU()) + platformContext()->gpuCanvas()->save(); +#endif + // Save our private State. platformContext()->save(); } @@ -252,6 +261,11 @@ void GraphicsContext::restorePlatformState() if (paintingDisabled()) return; +#if USE(GLES2_RENDERING) + if (platformContext()->useGPU()) + platformContext()->gpuCanvas()->restore(); +#endif + // Restore our private State. platformContext()->restore(); } @@ -290,6 +304,7 @@ void GraphicsContext::addInnerRoundedRectClip(const IntRect& rect, int thickness if (!isRectSkiaSafe(getCTM(), r)) return; + platformContext()->prepareForSoftwareDraw(); SkPath path; path.addOval(r, SkPath::kCW_Direction); // only perform the inset if we won't invert r @@ -307,6 +322,7 @@ void GraphicsContext::addPath(const Path& path) { if (paintingDisabled()) return; + platformContext()->prepareForSoftwareDraw(); platformContext()->addPath(*path.platformPath()); } @@ -314,6 +330,7 @@ void GraphicsContext::beginPath() { if (paintingDisabled()) return; + platformContext()->prepareForSoftwareDraw(); platformContext()->beginPath(); } @@ -329,6 +346,16 @@ void GraphicsContext::clearRect(const FloatRect& rect) if (paintingDisabled()) return; +#if USE(GLES2_RENDERING) + if (platformContext()->useGPU()) { + platformContext()->prepareForHardwareDraw(); + platformContext()->gpuCanvas()->clearRect(rect); + return; + } +#endif + + platformContext()->prepareForSoftwareDraw(); + SkRect r = rect; if (!isRectSkiaSafe(getCTM(), r)) ClipRectToCanvas(*platformContext()->canvas(), r, &r); @@ -348,6 +375,7 @@ void GraphicsContext::clip(const FloatRect& rect) if (!isRectSkiaSafe(getCTM(), r)) return; + platformContext()->prepareForSoftwareDraw(); platformContext()->canvas()->clipRect(r); } @@ -360,6 +388,7 @@ void GraphicsContext::clip(const Path& path) if (!isPathSkiaSafe(getCTM(), p)) return; + platformContext()->prepareForSoftwareDraw(); platformContext()->clipPathAntiAliased(p); } @@ -441,6 +470,12 @@ void GraphicsContext::concatCTM(const AffineTransform& affine) { if (paintingDisabled()) return; + +#if USE(GLES2_RENDERING) + if (platformContext()->useGPU()) + platformContext()->gpuCanvas()->concatCTM(affine); +#endif + platformContext()->canvas()->concat(affine); } @@ -454,6 +489,8 @@ void GraphicsContext::drawConvexPolygon(size_t numPoints, if (numPoints <= 1) return; + platformContext()->prepareForSoftwareDraw(); + SkPath path; path.incReserve(numPoints); @@ -478,7 +515,7 @@ void GraphicsContext::drawConvexPolygon(size_t numPoints, } } -void GraphicsContext::clipConvexPolygon(size_t numPoints, const FloatPoint* points) +void GraphicsContext::clipConvexPolygon(size_t numPoints, const FloatPoint* points, bool antialiased) { if (paintingDisabled()) return; @@ -499,6 +536,7 @@ void GraphicsContext::drawEllipse(const IntRect& elipseRect) if (!isRectSkiaSafe(getCTM(), rect)) return; + platformContext()->prepareForSoftwareDraw(); SkPaint paint; platformContext()->setupPaintForFilling(&paint); platformContext()->canvas()->drawOval(rect, paint); @@ -524,6 +562,7 @@ void GraphicsContext::drawFocusRing(const Vector<IntRect>& rects, int /* width * if (!rectCount) return; + platformContext()->prepareForSoftwareDraw(); SkRegion focusRingRegion; const SkScalar focusRingOutset = WebCoreFloatToSkScalar(0.5); for (unsigned i = 0; i < rectCount; i++) { @@ -558,6 +597,8 @@ void GraphicsContext::drawLine(const IntPoint& point1, const IntPoint& point2) if (!isPointSkiaSafe(getCTM(), point1) || !isPointSkiaSafe(getCTM(), point2)) return; + platformContext()->prepareForSoftwareDraw(); + FloatPoint p1 = point1; FloatPoint p2 = point2; bool isVerticalLine = (p1.x() == p2.x()); @@ -604,6 +645,8 @@ void GraphicsContext::drawLineForMisspellingOrBadGrammar(const IntPoint& pt, if (paintingDisabled()) return; + platformContext()->prepareForSoftwareDraw(); + // Create the pattern we'll use to draw the underline. static SkBitmap* misspellBitmap = 0; if (!misspellBitmap) { @@ -684,6 +727,8 @@ void GraphicsContext::drawLineForText(const IntPoint& pt, if (width <= 0) return; + platformContext()->prepareForSoftwareDraw(); + int thickness = SkMax32(static_cast<int>(strokeThickness()), 1); SkRect r; r.fLeft = SkIntToScalar(pt.x()); @@ -704,6 +749,8 @@ void GraphicsContext::drawRect(const IntRect& rect) if (paintingDisabled()) return; + platformContext()->prepareForSoftwareDraw(); + SkRect r = rect; if (!isRectSkiaSafe(getCTM(), r)) { // See the fillRect below. @@ -722,6 +769,8 @@ void GraphicsContext::fillPath() if (!isPathSkiaSafe(getCTM(), path)) return; + platformContext()->prepareForSoftwareDraw(); + const GraphicsContextState& state = m_common->state; path.setFillType(state.fillRule == RULE_EVENODD ? SkPath::kEvenOdd_FillType : SkPath::kWinding_FillType); @@ -745,6 +794,16 @@ void GraphicsContext::fillRect(const FloatRect& rect) ClipRectToCanvas(*platformContext()->canvas(), r, &r); } +#if USE(GLES2_RENDERING) + if (platformContext()->useGPU() && !m_common->state.fillPattern && !m_common->state.fillGradient) { + platformContext()->prepareForHardwareDraw(); + platformContext()->gpuCanvas()->fillRect(rect); + return; + } +#endif + + platformContext()->prepareForSoftwareDraw(); + SkPaint paint; platformContext()->setupPaintForFilling(&paint); platformContext()->canvas()->drawRect(r, paint); @@ -757,6 +816,16 @@ void GraphicsContext::fillRect(const FloatRect& rect, const Color& color, ColorS if (paintingDisabled()) return; +#if USE(GLES2_RENDERING) + if (platformContext()->useGPU() && !m_common->state.fillPattern && !m_common->state.fillGradient) { + platformContext()->prepareForHardwareDraw(); + platformContext()->gpuCanvas()->fillRect(rect, color, colorSpace); + return; + } +#endif + + platformContext()->prepareForSoftwareDraw(); + SkRect r = rect; if (!isRectSkiaSafe(getCTM(), r)) { // Special case when the rectangle overflows fixed point. This is a @@ -789,6 +858,8 @@ void GraphicsContext::fillRoundedRect(const IntRect& rect, if (paintingDisabled()) return; + platformContext()->prepareForSoftwareDraw(); + SkRect r = rect; if (!isRectSkiaSafe(getCTM(), r)) // See fillRect(). @@ -872,6 +943,12 @@ void GraphicsContext::scale(const FloatSize& size) { if (paintingDisabled()) return; + +#if USE(GLES2_RENDERING) + if (platformContext()->useGPU()) + platformContext()->gpuCanvas()->scale(size); +#endif + platformContext()->canvas()->scale(WebCoreFloatToSkScalar(size.width()), WebCoreFloatToSkScalar(size.height())); } @@ -880,6 +957,10 @@ void GraphicsContext::setAlpha(float alpha) { if (paintingDisabled()) return; +#if USE(GLES2_RENDERING) + if (platformContext()->useGPU()) + platformContext()->gpuCanvas()->setAlpha(alpha); +#endif platformContext()->setAlpha(alpha); } @@ -887,6 +968,10 @@ void GraphicsContext::setCompositeOperation(CompositeOperator op) { if (paintingDisabled()) return; +#if USE(GLES2_RENDERING) + if (platformContext()->useGPU()) + platformContext()->gpuCanvas()->setCompositeOperation(op); +#endif platformContext()->setXfermodeMode(WebCoreCompositeToSkiaComposite(op)); } @@ -973,6 +1058,11 @@ void GraphicsContext::setPlatformFillColor(const Color& color, ColorSpace colorS { if (paintingDisabled()) return; +#if USE(GLES2_RENDERING) + if (platformContext()->useGPU()) + platformContext()->gpuCanvas()->setFillColor(color, colorSpace); +#endif + platformContext()->setFillColor(color.rgb()); } @@ -1102,6 +1192,8 @@ void GraphicsContext::strokeArc(const IntRect& r, int startAngle, int angleSpan) if (paintingDisabled()) return; + platformContext()->prepareForSoftwareDraw(); + SkPaint paint; SkRect oval = r; if (strokeStyle() == NoStroke) { @@ -1133,6 +1225,8 @@ void GraphicsContext::strokePath() if (!isPathSkiaSafe(getCTM(), path)) return; + platformContext()->prepareForSoftwareDraw(); + SkPaint paint; platformContext()->setupPaintForStroking(&paint, 0, 0); platformContext()->canvas()->drawPath(path, paint); @@ -1146,6 +1240,8 @@ void GraphicsContext::strokeRect(const FloatRect& rect, float lineWidth) if (!isRectSkiaSafe(getCTM(), rect)) return; + platformContext()->prepareForSoftwareDraw(); + SkPaint paint; platformContext()->setupPaintForStroking(&paint, 0, 0); paint.setStrokeWidth(WebCoreFloatToSkScalar(lineWidth)); @@ -1157,6 +1253,11 @@ void GraphicsContext::rotate(float angleInRadians) if (paintingDisabled()) return; +#if USE(GLES2_RENDERING) + if (platformContext()->useGPU()) + platformContext()->gpuCanvas()->rotate(angleInRadians); +#endif + platformContext()->canvas()->rotate(WebCoreFloatToSkScalar( angleInRadians * (180.0f / 3.14159265f))); } @@ -1166,6 +1267,11 @@ void GraphicsContext::translate(float w, float h) if (paintingDisabled()) return; +#if USE(GLES2_RENDERING) + if (platformContext()->useGPU()) + platformContext()->gpuCanvas()->translate(w, h); +#endif + platformContext()->canvas()->translate(WebCoreFloatToSkScalar(w), WebCoreFloatToSkScalar(h)); } diff --git a/WebCore/platform/graphics/skia/ImageBufferSkia.cpp b/WebCore/platform/graphics/skia/ImageBufferSkia.cpp index f8192fe..26c44f2 100644 --- a/WebCore/platform/graphics/skia/ImageBufferSkia.cpp +++ b/WebCore/platform/graphics/skia/ImageBufferSkia.cpp @@ -74,10 +74,7 @@ ImageBuffer::ImageBuffer(const IntSize& size, ImageColorSpace imageColorSpace, b // Make the background transparent. It would be nice if this wasn't // required, but the canvas is currently filled with the magic transparency // color. Can we have another way to manage this? - // - // Avoid drawing on a zero-sized canvas. Skia can't handle it. - if (!size.isZero()) - m_data.m_canvas.drawARGB(0, 0, 0, 0, SkXfermode::kClear_Mode); + m_data.m_canvas.drawARGB(0, 0, 0, 0, SkXfermode::kClear_Mode); success = true; } @@ -131,6 +128,13 @@ PassRefPtr<ImageData> getImageData(const IntRect& rect, const SkBitmap& bitmap, const IntSize& size) { RefPtr<ImageData> result = ImageData::create(rect.width(), rect.height()); + + if (bitmap.config() == SkBitmap::kNo_Config) { + // This is an empty SkBitmap that could not be configured. + ASSERT(size.width() == 0 || size.height() == 0); + return result; + } + unsigned char* data = result->data()->data()->data(); if (rect.x() < 0 || rect.y() < 0 || diff --git a/WebCore/platform/graphics/skia/PlatformContextSkia.cpp b/WebCore/platform/graphics/skia/PlatformContextSkia.cpp index 15bd9b4..65c6e95 100644 --- a/WebCore/platform/graphics/skia/PlatformContextSkia.cpp +++ b/WebCore/platform/graphics/skia/PlatformContextSkia.cpp @@ -44,7 +44,15 @@ #include "SkShader.h" #include "SkDashPathEffect.h" +#if USE(GLES2_RENDERING) +#include "GLES2Canvas.h" +#include "GLES2Context.h" +#include "GLES2Texture.h" +#include <GLES2/gl2.h> +#endif + #include <wtf/MathExtras.h> +#include <wtf/OwnArrayPtr.h> #include <wtf/Vector.h> namespace WebCore @@ -199,6 +207,11 @@ PlatformContextSkia::PlatformContextSkia(skia::PlatformCanvas* canvas) #if OS(WINDOWS) , m_drawingToImageBuffer(false) #endif +#if USE(GLES2_RENDERING) + , m_useGPU(false) + , m_gpuCanvas(0) + , m_backingStoreState(None) +#endif { m_stateStack.append(State()); m_state = &m_stateStack.last(); @@ -661,3 +674,117 @@ void PlatformContextSkia::applyAntiAliasedClipPaths(WTF::Vector<SkPath>& paths) m_canvas->restore(); } + +#if USE(GLES2_RENDERING) +void PlatformContextSkia::setGLES2Context(WebCore::GLES2Context* context, const WebCore::IntSize& size) +{ + m_useGPU = true; + m_gpuCanvas = new WebCore::GLES2Canvas(context, size); +} + +void PlatformContextSkia::prepareForSoftwareDraw() const +{ + if (!m_useGPU) + return; + + if (m_backingStoreState == Hardware) { + // Depending on the blend mode we need to do one of a few things: + + // * For associative blend modes, we can draw into an initially empty + // canvas and then composite the results on top of the hardware drawn + // results before the next hardware draw or swapBuffers(). + + // * For non-associative blend modes we have to do a readback and then + // software draw. When we re-upload in this mode we have to blow + // away whatever is in the hardware backing store (do a copy instead + // of a compositing operation). + + if (m_state->m_xferMode == SkXfermode::kSrcOver_Mode) { + // Last drawn on hardware; clear out the canvas. + m_canvas->save(); + SkRect bounds = {0, 0, m_canvas->getDevice()->width(), m_canvas->getDevice()->height()}; + m_canvas->clipRect(bounds, SkRegion::kReplace_Op); + m_canvas->drawARGB(0, 0, 0, 0, SkXfermode::kClear_Mode); + m_canvas->restore(); + // Start compositing into the empty canvas. + m_backingStoreState = Mixed; + } else { + readbackHardwareToSoftware(); + // When we switch back to hardware copy the results, don't composite. + m_backingStoreState = Software; + } + } else if (m_backingStoreState == Mixed) { + if (m_state->m_xferMode != SkXfermode::kSrcOver_Mode) { + // Have to composite our currently software drawn data... + uploadSoftwareToHardware(WebCore::CompositeSourceOver); + // then do a readback so we can hardware draw stuff. + readbackHardwareToSoftware(); + m_backingStoreState = Software; + } + } +} + +void PlatformContextSkia::prepareForHardwareDraw() const +{ + if (!m_useGPU) + return; + + if (m_backingStoreState == Software) { + // Last drawn in software; upload everything we've drawn. + uploadSoftwareToHardware(WebCore::CompositeCopy); + } else if (m_backingStoreState == Mixed) { + // Stuff in software/hardware, composite the software stuff on top of + // the hardware stuff. + uploadSoftwareToHardware(WebCore::CompositeSourceOver); + } + m_backingStoreState = Hardware; +} + +void PlatformContextSkia::syncSoftwareCanvas() const +{ + if (!m_useGPU) + return; + + if (m_backingStoreState == Hardware) + readbackHardwareToSoftware(); + else if (m_backingStoreState == Mixed) { + // Have to composite our currently software drawn data.. + uploadSoftwareToHardware(WebCore::CompositeSourceOver); + // then do a readback. + readbackHardwareToSoftware(); + m_backingStoreState = Software; + } + m_backingStoreState = Software; +} + +void PlatformContextSkia::uploadSoftwareToHardware(WebCore::CompositeOperator op) const +{ + const SkBitmap& bitmap = m_canvas->getDevice()->accessBitmap(false); + SkAutoLockPixels lock(bitmap); + m_gpuCanvas->gles2Context()->makeCurrent(); + // FIXME: Keep a texture around for this rather than constantly creating/destroying one. + RefPtr<WebCore::GLES2Texture> texture = WebCore::GLES2Texture::create(WebCore::GLES2Texture::BGRA8, bitmap.width(), bitmap.height()); + texture->load(bitmap.getPixels()); + WebCore::IntRect rect(0, 0, bitmap.width(), bitmap.height()); + gpuCanvas()->drawTexturedRect(texture.get(), rect, rect, WebCore::DeviceColorSpace, op); +} + +void PlatformContextSkia::readbackHardwareToSoftware() const +{ + const SkBitmap& bitmap = m_canvas->getDevice()->accessBitmap(true); + SkAutoLockPixels lock(bitmap); + m_gpuCanvas->gles2Context()->makeCurrent(); + int width = bitmap.width(), height = bitmap.height(); + OwnArrayPtr<uint32_t> buf(new uint32_t[width]); + // Flips the image vertically. + for (int y = 0; y < height; ++y) { + uint32_t* pixels = bitmap.getAddr32(0, y); + glReadPixels(0, height - 1 - y, width, 1, GL_RGBA, GL_UNSIGNED_BYTE, pixels); + for (int i = 0; i < width; ++i) { + uint32_t pixel = pixels[i]; + // Swizzles from RGBA -> BGRA. + pixels[i] = pixel & 0xFF00FF00 | ((pixel & 0x00FF0000) >> 16) | ((pixel & 0x000000FF) << 16); + } + } +} +#endif diff --git a/WebCore/platform/graphics/skia/PlatformContextSkia.h b/WebCore/platform/graphics/skia/PlatformContextSkia.h index 88a8ec7..2099dd0 100644 --- a/WebCore/platform/graphics/skia/PlatformContextSkia.h +++ b/WebCore/platform/graphics/skia/PlatformContextSkia.h @@ -41,6 +41,14 @@ #include "SkPaint.h" #include "SkPath.h" +#if USE(GLES2_RENDERING) +namespace WebCore { +enum CompositeOperator; +class GLES2Canvas; +class GLES2Context; +} +#endif + #include <wtf/Vector.h> // This class holds the platform-specific state for GraphicsContext. We put @@ -174,6 +182,24 @@ public: void setImageResamplingHint(const WebCore::IntSize& srcSize, const WebCore::FloatSize& dstSize); void clearImageResamplingHint(); bool hasImageResamplingHint() const; +#if USE(GLES2_RENDERING) + bool useGPU() { return m_useGPU; } + void setGLES2Context(WebCore::GLES2Context*, const WebCore::IntSize&); + WebCore::GLES2Canvas* gpuCanvas() const { return m_gpuCanvas.get(); } +#endif + +#if USE(GLES2_RENDERING) + // Call these before making a call that manipulates the underlying + // skia::PlatformCanvas or WebCore::GLES2Canvas + void prepareForSoftwareDraw() const; + void prepareForHardwareDraw() const; + // Call to force the skia::PlatformCanvas to contain all rendering results. + void syncSoftwareCanvas() const; +#else + void prepareForSoftwareDraw() const {} + void prepareForHardwareDraw() const {} + void syncSoftwareCanvas() const {} +#endif private: #if OS(LINUX) || OS(WINDOWS) @@ -183,6 +209,11 @@ private: #endif void applyAntiAliasedClipPaths(WTF::Vector<SkPath>& paths); +#if USE(GLES2_RENDERING) + void uploadSoftwareToHardware(WebCore::CompositeOperator) const; + void readbackHardwareToSoftware() const; +#endif + // Defines drawing style. struct State; @@ -206,6 +237,11 @@ private: #if OS(WINDOWS) bool m_drawingToImageBuffer; #endif +#if USE(GLES2_RENDERING) + bool m_useGPU; + OwnPtr<WebCore::GLES2Canvas> m_gpuCanvas; + mutable enum { None, Software, Mixed, Hardware } m_backingStoreState; +#endif }; -#endif // PlatformContextSkia_h +#endif // PlatformContextSkia_h diff --git a/WebCore/platform/graphics/wince/GraphicsContextWince.cpp b/WebCore/platform/graphics/wince/GraphicsContextWince.cpp index 5292b82..e4466c8 100644 --- a/WebCore/platform/graphics/wince/GraphicsContextWince.cpp +++ b/WebCore/platform/graphics/wince/GraphicsContextWince.cpp @@ -948,7 +948,7 @@ void GraphicsContext::drawConvexPolygon(size_t npoints, const FloatPoint* points } } -void GraphicsContext::clipConvexPolygon(size_t numPoints, const FloatPoint* points) +void GraphicsContext::clipConvexPolygon(size_t numPoints, const FloatPoint* points, bool antialiased) { if (paintingDisabled()) return; @@ -1160,12 +1160,12 @@ void GraphicsContext::concatCTM(const AffineTransform& transform) m_data->concatCTM(transform); } -TransformationMatrix& GraphicsContext::affineTransform() +AffineTransform& GraphicsContext::affineTransform() { return m_data->m_transform; } -const TransformationMatrix& GraphicsContext::affineTransform() const +const AffineTransform& GraphicsContext::affineTransform() const { return m_data->m_transform; } @@ -1268,8 +1268,8 @@ void GraphicsContext::fillRoundedRect(const IntRect& fillRect, const IntSize& to IntRect dstRect = fillRect; - dstRect.move(shadowSize); - dstRect.inflate(shadowBlur); + dstRect.move(stableRound(shadowSize.width()), stableRound(shadowSize.height())); + dstRect.inflate(stableRound(shadowBlur)); dstRect = m_data->mapRect(dstRect); FloatSize newTopLeft(m_data->mapSize(topLeft)); @@ -1513,7 +1513,7 @@ void GraphicsContext::fillRect(const FloatRect& r, const Gradient* gradient) int width = rect.width(); int height = rect.height(); FloatSize d = gradient->p1() - gradient->p0(); - bool vertical = abs(d.height()) > abs(d.width()); + bool vertical = fabs(d.height()) > fabs(d.width()); for (size_t i = 0; i < numStops; ++i) { const Gradient::ColorStop& stop = stops[i]; int iTv = i ? 2 * i - 1 : 0; @@ -1868,7 +1868,7 @@ void GraphicsContext::paintTextField(const IntRect& rect, unsigned state) FillRect(dc, &rectWin, reinterpret_cast<HBRUSH>(((state & DFCS_INACTIVE) ? COLOR_BTNFACE : COLOR_WINDOW) + 1)); } -void GraphicsContext::drawBitmap(SharedBitmap* bmp, const IntRect& dstRectIn, const IntRect& srcRect, CompositeOperator compositeOp) +void GraphicsContext::drawBitmap(SharedBitmap* bmp, const IntRect& dstRectIn, const IntRect& srcRect, ColorSpace styleColorSpace, CompositeOperator compositeOp) { if (!m_data->m_opacity) return; @@ -1891,7 +1891,7 @@ void GraphicsContext::drawBitmap(SharedBitmap* bmp, const IntRect& dstRectIn, co } void GraphicsContext::drawBitmapPattern(SharedBitmap* bmp, const FloatRect& tileRectIn, const AffineTransform& patternTransform, - const FloatPoint& phase, CompositeOperator op, const FloatRect& destRectIn, const IntSize& origSourceSize) + const FloatPoint& phase, ColorSpace styleColorSpace, CompositeOperator op, const FloatRect& destRectIn, const IntSize& origSourceSize) { if (!m_data->m_opacity) return; @@ -1912,7 +1912,7 @@ void GraphicsContext::drawBitmapPattern(SharedBitmap* bmp, const FloatRect& tile AffineTransform transform = m_data->m_transform; transform.translate(moved.width(), moved.height()); - bmp->drawPattern(dc, transform, tileRectIn, patternTransform, phase, op, destRectIn, origSourceSize); + bmp->drawPattern(dc, transform, tileRectIn, patternTransform, phase, styleColorSpace, op, destRectIn, origSourceSize); if (!bmp->hasAlpha()) transparentDC.fillAlphaChannel(); diff --git a/WebCore/platform/graphics/wince/ImageBufferWince.cpp b/WebCore/platform/graphics/wince/ImageBufferWince.cpp index 4b739c8..1a25f4f 100644 --- a/WebCore/platform/graphics/wince/ImageBufferWince.cpp +++ b/WebCore/platform/graphics/wince/ImageBufferWince.cpp @@ -26,8 +26,10 @@ #include "Image.h" #include "ImageData.h" #include "JPEGEncoder.h" +#include "NotImplemented.h" #include "PNGEncoder.h" #include "SharedBitmap.h" +#include "UnusedParam.h" #include <wtf/UnusedParam.h> namespace WebCore { @@ -43,24 +45,24 @@ public: virtual IntSize size() const { return IntSize(m_data->m_bitmap->width(), m_data->m_bitmap->height()); } virtual void destroyDecodedData(bool destroyAll = true) {} virtual unsigned decodedSize() const { return 0; } - virtual void draw(GraphicsContext*, const FloatRect& dstRect, const FloatRect& srcRect, CompositeOperator); + virtual void draw(GraphicsContext*, const FloatRect& dstRect, const FloatRect& srcRect, ColorSpace styleColorSpace, CompositeOperator); virtual void drawPattern(GraphicsContext*, const FloatRect& srcRect, const AffineTransform& patternTransform, - const FloatPoint& phase, CompositeOperator, const FloatRect& destRect); + const FloatPoint& phase, ColorSpace styleColorSpace, CompositeOperator, const FloatRect& destRect); const ImageBufferData* m_data; }; -void BufferedImage::draw(GraphicsContext* ctxt, const FloatRect& dstRect, const FloatRect& srcRect, CompositeOperator compositeOp) +void BufferedImage::draw(GraphicsContext* ctxt, const FloatRect& dstRect, const FloatRect& srcRect, ColorSpace styleColorSpace, CompositeOperator compositeOp) { IntRect intDstRect = enclosingIntRect(dstRect); IntRect intSrcRect(srcRect); - m_data->m_bitmap->draw(ctxt, intDstRect, intSrcRect, compositeOp); + m_data->m_bitmap->draw(ctxt, intDstRect, intSrcRect, styleColorSpace, compositeOp); } void BufferedImage::drawPattern(GraphicsContext* ctxt, const FloatRect& tileRectIn, const AffineTransform& patternTransform, - const FloatPoint& phase, CompositeOperator op, const FloatRect& destRect) + const FloatPoint& phase, ColorSpace styleColorSpace, CompositeOperator op, const FloatRect& destRect) { - m_data->m_bitmap->drawPattern(ctxt, tileRectIn, patternTransform, phase, op, destRect, size()); + m_data->m_bitmap->drawPattern(ctxt, tileRectIn, patternTransform, phase, styleColorSpace, op, destRect, size()); } ImageBufferData::ImageBufferData(const IntSize& size) @@ -216,6 +218,12 @@ void ImageBuffer::putPremultipliedImageData(ImageData* source, const IntRect& so putImageData<true>(source, sourceRect, destPoint, m_data.m_bitmap.get()); } +void ImageBuffer::platformTransformColorSpace(const Vector<int>& lookUpTable) +{ + UNUSED_PARAM(lookUpTable); + notImplemented(); +} + String ImageBuffer::toDataURL(const String& mimeType, const double*) const { if (!m_data.m_bitmap->bytes()) diff --git a/WebCore/platform/graphics/wince/PlatformPathWince.cpp b/WebCore/platform/graphics/wince/PlatformPathWince.cpp index cde5461..b42b52c 100644 --- a/WebCore/platform/graphics/wince/PlatformPathWince.cpp +++ b/WebCore/platform/graphics/wince/PlatformPathWince.cpp @@ -671,7 +671,7 @@ void PlatformPath::addArcTo(const FloatPoint& fp1, const FloatPoint& fp2, float double d01 = v01.length(); double d21 = v21.length(); - double angle = (piDouble - abs(asin(cross / (d01 * d21)))) * 0.5; + double angle = (piDouble - fabs(asin(cross / (d01 * d21)))) * 0.5; double span = radius * tan(angle); double rate = span / d01; PathPoint startPoint; diff --git a/WebCore/platform/graphics/wx/FontPlatformDataWx.cpp b/WebCore/platform/graphics/wx/FontPlatformDataWx.cpp index 2951223..b77a03b 100644 --- a/WebCore/platform/graphics/wx/FontPlatformDataWx.cpp +++ b/WebCore/platform/graphics/wx/FontPlatformDataWx.cpp @@ -81,23 +81,23 @@ FontPlatformData::FontPlatformData(const FontDescription& desc, const AtomicStri // this is a moot issue on Linux and Mac as they only accept the point argument. So, // we use the pixel size constructor on Windows, but we use point size on Linux and Mac. #if __WXMSW__ - m_font = new FontHolder(new wxFont( wxSize(0, -desc.computedPixelSize()), + m_font = adoptRef(new FontHolder(new wxFont( wxSize(0, -desc.computedPixelSize()), fontFamilyToWxFontFamily(desc.genericFamily()), italicToWxFontStyle(desc.italic()), fontWeightToWxFontWeight(desc.weight()), false, family.string() ) - ); + )); #else - m_font = new FontHolder(new wxFont( desc.computedPixelSize(), + m_font = adoptRef(new FontHolder(new wxFont( desc.computedPixelSize(), fontFamilyToWxFontFamily(desc.genericFamily()), italicToWxFontStyle(desc.italic()), fontWeightToWxFontWeight(desc.weight()), false, family.string() ) - ); + )); #endif #if OS(DARWIN) && !defined(wxOSX_USE_CORE_TEXT) #if wxCHECK_VERSION(2,9,0) diff --git a/WebCore/platform/graphics/wx/GraphicsContextWx.cpp b/WebCore/platform/graphics/wx/GraphicsContextWx.cpp index 01dce9e..4d5afd7 100644 --- a/WebCore/platform/graphics/wx/GraphicsContextWx.cpp +++ b/WebCore/platform/graphics/wx/GraphicsContextWx.cpp @@ -256,7 +256,7 @@ void GraphicsContext::drawConvexPolygon(size_t npoints, const FloatPoint* points delete [] polygon; } -void GraphicsContext::clipConvexPolygon(size_t numPoints, const FloatPoint* points) +void GraphicsContext::clipConvexPolygon(size_t numPoints, const FloatPoint* points, bool antialiased) { if (paintingDisabled()) return; diff --git a/WebCore/platform/gtk/ClipboardGtk.cpp b/WebCore/platform/gtk/ClipboardGtk.cpp index 924fabc..c08b03f 100644 --- a/WebCore/platform/gtk/ClipboardGtk.cpp +++ b/WebCore/platform/gtk/ClipboardGtk.cpp @@ -18,6 +18,7 @@ #include "ClipboardGtk.h" #include "CachedImage.h" +#include "DragData.h" #include "Editor.h" #include "Element.h" #include "FileList.h" @@ -27,6 +28,7 @@ #include "Pasteboard.h" #include "PasteboardHelper.h" #include "RenderImage.h" +#include "ScriptExecutionContext.h" #include "StringHash.h" #include "markup.h" #include <wtf/text/CString.h> @@ -43,24 +45,31 @@ enum ClipboardType { ClipboardTypeUnknown }; -PassRefPtr<Clipboard> Editor::newGeneralClipboard(ClipboardAccessPolicy policy) +PassRefPtr<Clipboard> Editor::newGeneralClipboard(ClipboardAccessPolicy policy, Frame* frame) { - return ClipboardGtk::create(policy, gtk_clipboard_get_for_display(gdk_display_get_default(), GDK_SELECTION_CLIPBOARD), false); + return ClipboardGtk::create(policy, gtk_clipboard_get_for_display(gdk_display_get_default(), GDK_SELECTION_CLIPBOARD), false, frame); } -ClipboardGtk::ClipboardGtk(ClipboardAccessPolicy policy, GtkClipboard* clipboard) +PassRefPtr<Clipboard> Clipboard::create(ClipboardAccessPolicy policy, DragData* dragData, Frame* frame) +{ + return ClipboardGtk::create(policy, dragData->platformData(), true, frame); +} + +ClipboardGtk::ClipboardGtk(ClipboardAccessPolicy policy, GtkClipboard* clipboard, Frame* frame) : Clipboard(policy, false) , m_dataObject(DataObjectGtk::forClipboard(clipboard)) , m_clipboard(clipboard) , m_helper(Pasteboard::generalPasteboard()->helper()) + , m_frame(frame) { } -ClipboardGtk::ClipboardGtk(ClipboardAccessPolicy policy, PassRefPtr<DataObjectGtk> dataObject, bool forDragging) +ClipboardGtk::ClipboardGtk(ClipboardAccessPolicy policy, PassRefPtr<DataObjectGtk> dataObject, bool forDragging, Frame* frame) : Clipboard(policy, forDragging) , m_dataObject(dataObject) , m_clipboard(0) , m_helper(Pasteboard::generalPasteboard()->helper()) + , m_frame(frame) { } @@ -255,8 +264,9 @@ PassRefPtr<FileList> ClipboardGtk::files() const RefPtr<FileList> fileList = FileList::create(); Vector<String> fileVector(m_dataObject->files()); + ScriptExecutionContext* scriptExecutionContext = m_frame->document()->scriptExecutionContext(); for (size_t i = 0; i < fileVector.size(); i++) - fileList->append(File::create(fileVector[i])); + fileList->append(File::create(scriptExecutionContext, fileVector[i])); return fileList.release(); } diff --git a/WebCore/platform/gtk/ClipboardGtk.h b/WebCore/platform/gtk/ClipboardGtk.h index c3438c4..5b42ac6 100644 --- a/WebCore/platform/gtk/ClipboardGtk.h +++ b/WebCore/platform/gtk/ClipboardGtk.h @@ -34,20 +34,21 @@ typedef struct _GtkClipboard GtkClipboard; namespace WebCore { class CachedImage; + class Frame; class PasteboardHelper; // State available during IE's events for drag and drop and copy/paste // Created from the EventHandlerGtk to be used by the dom class ClipboardGtk : public Clipboard { public: - static PassRefPtr<ClipboardGtk> create(ClipboardAccessPolicy policy, GtkClipboard* clipboard, bool isForDragging) + static PassRefPtr<ClipboardGtk> create(ClipboardAccessPolicy policy, GtkClipboard* clipboard, bool isForDragging, Frame* frame) { - return adoptRef(new ClipboardGtk(policy, clipboard)); + return adoptRef(new ClipboardGtk(policy, clipboard, frame)); } - static PassRefPtr<ClipboardGtk> create(ClipboardAccessPolicy policy, PassRefPtr<DataObjectGtk> dataObject, bool isForDragging) + static PassRefPtr<ClipboardGtk> create(ClipboardAccessPolicy policy, PassRefPtr<DataObjectGtk> dataObject, bool isForDragging, Frame* frame) { - return adoptRef(new ClipboardGtk(policy, dataObject, isForDragging)); + return adoptRef(new ClipboardGtk(policy, dataObject, isForDragging, frame)); } virtual ~ClipboardGtk(); @@ -77,12 +78,13 @@ namespace WebCore { PassRefPtr<DataObjectGtk> dataObject() { return m_dataObject; } private: - ClipboardGtk(ClipboardAccessPolicy, GtkClipboard*); - ClipboardGtk(ClipboardAccessPolicy, PassRefPtr<DataObjectGtk>, bool); + ClipboardGtk(ClipboardAccessPolicy, GtkClipboard*, Frame*); + ClipboardGtk(ClipboardAccessPolicy, PassRefPtr<DataObjectGtk>, bool, Frame*); RefPtr<DataObjectGtk> m_dataObject; GtkClipboard* m_clipboard; PasteboardHelper* m_helper; + Frame* m_frame; }; } diff --git a/WebCore/platform/gtk/DragDataGtk.cpp b/WebCore/platform/gtk/DragDataGtk.cpp index 68f7ffc..69966aa 100644 --- a/WebCore/platform/gtk/DragDataGtk.cpp +++ b/WebCore/platform/gtk/DragDataGtk.cpp @@ -62,11 +62,6 @@ Color DragData::asColor() const return Color(); } -PassRefPtr<Clipboard> DragData::createClipboard(ClipboardAccessPolicy policy) const -{ - return ClipboardGtk::create(policy, m_platformDragData, true); -} - bool DragData::containsCompatibleContent() const { return containsPlainText() || containsURL() || m_platformDragData->hasMarkup() || containsColor() || containsFiles(); diff --git a/WebCore/platform/haiku/ClipboardHaiku.cpp b/WebCore/platform/haiku/ClipboardHaiku.cpp index f73be01..9931131 100644 --- a/WebCore/platform/haiku/ClipboardHaiku.cpp +++ b/WebCore/platform/haiku/ClipboardHaiku.cpp @@ -42,6 +42,11 @@ namespace WebCore { +PassRefPtr<Clipboard> Clipboard::create(ClipboardAccessPolicy policy, DragData*, Frame*) +{ + return ClipboardHaiku::create(policy, true); +} + ClipboardHaiku::ClipboardHaiku(ClipboardAccessPolicy policy, bool forDragging) : Clipboard(policy, forDragging) { diff --git a/WebCore/platform/haiku/DragDataHaiku.cpp b/WebCore/platform/haiku/DragDataHaiku.cpp index 7f40b8a..7c2dc9c 100644 --- a/WebCore/platform/haiku/DragDataHaiku.cpp +++ b/WebCore/platform/haiku/DragDataHaiku.cpp @@ -27,7 +27,6 @@ #include "config.h" #include "DragData.h" -#include "ClipboardHaiku.h" #include "Document.h" #include "DocumentFragment.h" #include "NotImplemented.h" @@ -76,11 +75,6 @@ Color DragData::asColor() const return Color(); } -WTF::PassRefPtr<Clipboard> DragData::createClipboard(ClipboardAccessPolicy policy) const -{ - return ClipboardHaiku::create(policy, true); -} - bool DragData::containsCompatibleContent() const { return containsColor() || containsURL() || containsPlainText(); diff --git a/WebCore/platform/mac/ClipboardMac.mm b/WebCore/platform/mac/ClipboardMac.mm index ddfa0d5..0cbb3f6 100644 --- a/WebCore/platform/mac/ClipboardMac.mm +++ b/WebCore/platform/mac/ClipboardMac.mm @@ -29,6 +29,7 @@ #import "DOMElementInternal.h" #import "DragClient.h" #import "DragController.h" +#import "DragData.h" #import "Editor.h" #import "FoundationExtras.h" #import "FileList.h" @@ -37,6 +38,7 @@ #import "Page.h" #import "Pasteboard.h" #import "RenderImage.h" +#import "ScriptExecutionContext.h" #import "SecurityOrigin.h" #import "WebCoreSystemInterface.h" @@ -46,6 +48,11 @@ typedef unsigned NSUInteger; namespace WebCore { +PassRefPtr<Clipboard> Clipboard::create(ClipboardAccessPolicy policy, DragData* dragData, Frame* frame) +{ + return ClipboardMac::create(true, [dragData->platformData() draggingPasteboard], policy, frame); +} + ClipboardMac::ClipboardMac(bool forDragging, NSPasteboard *pasteboard, ClipboardAccessPolicy policy, Frame *frame) : Clipboard(policy, forDragging) , m_pasteboard(pasteboard) @@ -306,11 +313,12 @@ PassRefPtr<FileList> ClipboardMac::files() const NSArray *absoluteURLs = absoluteURLsFromPasteboardFilenames(m_pasteboard.get()); NSUInteger count = [absoluteURLs count]; + ScriptExecutionContext* scriptExecutionContext = m_frame->document()->scriptExecutionContext(); RefPtr<FileList> fileList = FileList::create(); for (NSUInteger x = 0; x < count; x++) { NSURL *absoluteURL = [NSURL URLWithString:[absoluteURLs objectAtIndex:x]]; ASSERT([absoluteURL isFileURL]); - fileList->append(File::create([absoluteURL path])); + fileList->append(File::create(scriptExecutionContext, [absoluteURL path])); } return fileList.release(); // We will always return a FileList, sometimes empty } diff --git a/WebCore/platform/mac/DragDataMac.mm b/WebCore/platform/mac/DragDataMac.mm index fa416ed..9cb4836 100644 --- a/WebCore/platform/mac/DragDataMac.mm +++ b/WebCore/platform/mac/DragDataMac.mm @@ -27,8 +27,6 @@ #import "DragData.h" #if ENABLE(DRAG_SUPPORT) -#import "ClipboardMac.h" -#import "ClipboardAccessPolicy.h" #import "Document.h" #import "DocumentFragment.h" #import "DOMDocumentFragment.h" @@ -100,11 +98,6 @@ Color DragData::asColor() const (int)([color blueComponent] * 255.0 + 0.5), (int)([color alphaComponent] * 255.0 + 0.5)); } -PassRefPtr<Clipboard> DragData::createClipboard(ClipboardAccessPolicy policy) const -{ - return ClipboardMac::create(true, [m_platformDragData draggingPasteboard], policy, 0); -} - bool DragData::containsCompatibleContent() const { NSPasteboard *pasteboard = [m_platformDragData draggingPasteboard]; diff --git a/WebCore/platform/mac/LocalizedStringsMac.mm b/WebCore/platform/mac/LocalizedStringsMac.mm index 510249a..8b7df04 100644 --- a/WebCore/platform/mac/LocalizedStringsMac.mm +++ b/WebCore/platform/mac/LocalizedStringsMac.mm @@ -1,5 +1,5 @@ /* - * Copyright (C) 2003, 2006, 2009 Apple Computer, Inc. All rights reserved. + * Copyright (C) 2003, 2006, 2009, 2010 Apple Inc. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -26,813 +26,514 @@ #import "config.h" #import "LocalizedStrings.h" -#import "BlockExceptions.h" #import "IntSize.h" +#import "LocalizationStrategy.h" +#import "PlatformStrategies.h" #import "PlatformString.h" -#import "WebCoreViewFactory.h" namespace WebCore { String inputElementAltText() { - BEGIN_BLOCK_OBJC_EXCEPTIONS; - return [[WebCoreViewFactory sharedFactory] inputElementAltText]; - END_BLOCK_OBJC_EXCEPTIONS; - return String(); + return platformStrategies()->localizationStrategy()->inputElementAltText(); } String resetButtonDefaultLabel() { - BEGIN_BLOCK_OBJC_EXCEPTIONS; - return [[WebCoreViewFactory sharedFactory] resetButtonDefaultLabel]; - END_BLOCK_OBJC_EXCEPTIONS; - return String(); + return platformStrategies()->localizationStrategy()->resetButtonDefaultLabel(); } String searchableIndexIntroduction() { - BEGIN_BLOCK_OBJC_EXCEPTIONS; - return [[WebCoreViewFactory sharedFactory] searchableIndexIntroduction]; - END_BLOCK_OBJC_EXCEPTIONS; - return String(); + return platformStrategies()->localizationStrategy()->searchableIndexIntroduction(); } String submitButtonDefaultLabel() { - BEGIN_BLOCK_OBJC_EXCEPTIONS; - return [[WebCoreViewFactory sharedFactory] submitButtonDefaultLabel]; - END_BLOCK_OBJC_EXCEPTIONS; - return String(); + return platformStrategies()->localizationStrategy()->submitButtonDefaultLabel(); } String fileButtonChooseFileLabel() { - BEGIN_BLOCK_OBJC_EXCEPTIONS; - return [[WebCoreViewFactory sharedFactory] fileButtonChooseFileLabel]; - END_BLOCK_OBJC_EXCEPTIONS; - return String(); + return platformStrategies()->localizationStrategy()->fileButtonChooseFileLabel(); } String fileButtonNoFileSelectedLabel() { - BEGIN_BLOCK_OBJC_EXCEPTIONS; - return [[WebCoreViewFactory sharedFactory] fileButtonNoFileSelectedLabel]; - END_BLOCK_OBJC_EXCEPTIONS; - return String(); + return platformStrategies()->localizationStrategy()->fileButtonNoFileSelectedLabel(); } String copyImageUnknownFileLabel() { - BEGIN_BLOCK_OBJC_EXCEPTIONS; - return [[WebCoreViewFactory sharedFactory] copyImageUnknownFileLabel]; - END_BLOCK_OBJC_EXCEPTIONS; - return String(); + return platformStrategies()->localizationStrategy()->copyImageUnknownFileLabel(); } #if ENABLE(CONTEXT_MENUS) String contextMenuItemTagOpenLinkInNewWindow() { - BEGIN_BLOCK_OBJC_EXCEPTIONS; - return [[WebCoreViewFactory sharedFactory] contextMenuItemTagOpenLinkInNewWindow]; - END_BLOCK_OBJC_EXCEPTIONS; - return String(); + return platformStrategies()->localizationStrategy()->contextMenuItemTagOpenLinkInNewWindow(); } String contextMenuItemTagDownloadLinkToDisk() { - BEGIN_BLOCK_OBJC_EXCEPTIONS; - return [[WebCoreViewFactory sharedFactory] contextMenuItemTagDownloadLinkToDisk]; - END_BLOCK_OBJC_EXCEPTIONS; - return String(); + return platformStrategies()->localizationStrategy()->contextMenuItemTagDownloadLinkToDisk(); } String contextMenuItemTagCopyLinkToClipboard() { - BEGIN_BLOCK_OBJC_EXCEPTIONS; - return [[WebCoreViewFactory sharedFactory] contextMenuItemTagCopyLinkToClipboard]; - END_BLOCK_OBJC_EXCEPTIONS; - return String(); + return platformStrategies()->localizationStrategy()->contextMenuItemTagCopyLinkToClipboard(); } String contextMenuItemTagOpenImageInNewWindow() { - BEGIN_BLOCK_OBJC_EXCEPTIONS; - return [[WebCoreViewFactory sharedFactory] contextMenuItemTagOpenImageInNewWindow]; - END_BLOCK_OBJC_EXCEPTIONS; - return String(); + return platformStrategies()->localizationStrategy()->contextMenuItemTagOpenImageInNewWindow(); } String contextMenuItemTagDownloadImageToDisk() { - BEGIN_BLOCK_OBJC_EXCEPTIONS; - return [[WebCoreViewFactory sharedFactory] contextMenuItemTagDownloadImageToDisk]; - END_BLOCK_OBJC_EXCEPTIONS; - return String(); + return platformStrategies()->localizationStrategy()->contextMenuItemTagDownloadImageToDisk(); } String contextMenuItemTagCopyImageToClipboard() { - BEGIN_BLOCK_OBJC_EXCEPTIONS; - return [[WebCoreViewFactory sharedFactory] contextMenuItemTagCopyImageToClipboard]; - END_BLOCK_OBJC_EXCEPTIONS; - return String(); + return platformStrategies()->localizationStrategy()->contextMenuItemTagCopyImageToClipboard(); } String contextMenuItemTagOpenFrameInNewWindow() { - BEGIN_BLOCK_OBJC_EXCEPTIONS; - return [[WebCoreViewFactory sharedFactory] contextMenuItemTagOpenFrameInNewWindow]; - END_BLOCK_OBJC_EXCEPTIONS; - return String(); + return platformStrategies()->localizationStrategy()->contextMenuItemTagOpenFrameInNewWindow(); } String contextMenuItemTagCopy() { - BEGIN_BLOCK_OBJC_EXCEPTIONS; - return [[WebCoreViewFactory sharedFactory] contextMenuItemTagCopy]; - END_BLOCK_OBJC_EXCEPTIONS; - return String(); + return platformStrategies()->localizationStrategy()->contextMenuItemTagCopy(); } String contextMenuItemTagGoBack() { - BEGIN_BLOCK_OBJC_EXCEPTIONS; - return [[WebCoreViewFactory sharedFactory] contextMenuItemTagGoBack]; - END_BLOCK_OBJC_EXCEPTIONS; - return String(); + return platformStrategies()->localizationStrategy()->contextMenuItemTagGoBack(); } String contextMenuItemTagGoForward() { - BEGIN_BLOCK_OBJC_EXCEPTIONS; - return [[WebCoreViewFactory sharedFactory] contextMenuItemTagGoForward]; - END_BLOCK_OBJC_EXCEPTIONS; - return String(); + return platformStrategies()->localizationStrategy()->contextMenuItemTagGoForward(); } String contextMenuItemTagStop() { - BEGIN_BLOCK_OBJC_EXCEPTIONS; - return [[WebCoreViewFactory sharedFactory] contextMenuItemTagStop]; - END_BLOCK_OBJC_EXCEPTIONS; - return String(); + return platformStrategies()->localizationStrategy()->contextMenuItemTagStop(); } String contextMenuItemTagReload() { - BEGIN_BLOCK_OBJC_EXCEPTIONS; - return [[WebCoreViewFactory sharedFactory] contextMenuItemTagReload]; - END_BLOCK_OBJC_EXCEPTIONS; - return String(); + return platformStrategies()->localizationStrategy()->contextMenuItemTagReload(); } String contextMenuItemTagCut() { - BEGIN_BLOCK_OBJC_EXCEPTIONS; - return [[WebCoreViewFactory sharedFactory] contextMenuItemTagCut]; - END_BLOCK_OBJC_EXCEPTIONS; - return String(); + return platformStrategies()->localizationStrategy()->contextMenuItemTagCut(); } String contextMenuItemTagPaste() { - BEGIN_BLOCK_OBJC_EXCEPTIONS; - return [[WebCoreViewFactory sharedFactory] contextMenuItemTagPaste]; - END_BLOCK_OBJC_EXCEPTIONS; - return String(); + return platformStrategies()->localizationStrategy()->contextMenuItemTagPaste(); } String contextMenuItemTagNoGuessesFound() { - BEGIN_BLOCK_OBJC_EXCEPTIONS; - return [[WebCoreViewFactory sharedFactory] contextMenuItemTagNoGuessesFound]; - END_BLOCK_OBJC_EXCEPTIONS; - return String(); + return platformStrategies()->localizationStrategy()->contextMenuItemTagNoGuessesFound(); } String contextMenuItemTagIgnoreSpelling() { - BEGIN_BLOCK_OBJC_EXCEPTIONS; - return [[WebCoreViewFactory sharedFactory] contextMenuItemTagIgnoreSpelling]; - END_BLOCK_OBJC_EXCEPTIONS; - return String(); + return platformStrategies()->localizationStrategy()->contextMenuItemTagIgnoreSpelling(); } String contextMenuItemTagLearnSpelling() { - BEGIN_BLOCK_OBJC_EXCEPTIONS; - return [[WebCoreViewFactory sharedFactory] contextMenuItemTagLearnSpelling]; - END_BLOCK_OBJC_EXCEPTIONS; - return String(); + return platformStrategies()->localizationStrategy()->contextMenuItemTagLearnSpelling(); } String contextMenuItemTagSearchInSpotlight() { - BEGIN_BLOCK_OBJC_EXCEPTIONS; - return [[WebCoreViewFactory sharedFactory] contextMenuItemTagSearchInSpotlight]; - END_BLOCK_OBJC_EXCEPTIONS; - return String(); + return platformStrategies()->localizationStrategy()->contextMenuItemTagSearchInSpotlight(); } String contextMenuItemTagSearchWeb() { - BEGIN_BLOCK_OBJC_EXCEPTIONS; - return [[WebCoreViewFactory sharedFactory] contextMenuItemTagSearchWeb]; - END_BLOCK_OBJC_EXCEPTIONS; - return String(); + return platformStrategies()->localizationStrategy()->contextMenuItemTagSearchWeb(); } String contextMenuItemTagLookUpInDictionary() { - BEGIN_BLOCK_OBJC_EXCEPTIONS; - return [[WebCoreViewFactory sharedFactory] contextMenuItemTagLookUpInDictionary]; - END_BLOCK_OBJC_EXCEPTIONS; - return String(); + return platformStrategies()->localizationStrategy()->contextMenuItemTagLookUpInDictionary(); } String contextMenuItemTagOpenLink() { - BEGIN_BLOCK_OBJC_EXCEPTIONS; - return [[WebCoreViewFactory sharedFactory] contextMenuItemTagOpenLink]; - END_BLOCK_OBJC_EXCEPTIONS; - return String(); + return platformStrategies()->localizationStrategy()->contextMenuItemTagOpenLink(); } String contextMenuItemTagIgnoreGrammar() { - BEGIN_BLOCK_OBJC_EXCEPTIONS; - return [[WebCoreViewFactory sharedFactory] contextMenuItemTagIgnoreGrammar]; - END_BLOCK_OBJC_EXCEPTIONS; - return String(); + return platformStrategies()->localizationStrategy()->contextMenuItemTagIgnoreGrammar(); } String contextMenuItemTagSpellingMenu() { - BEGIN_BLOCK_OBJC_EXCEPTIONS; - return [[WebCoreViewFactory sharedFactory] contextMenuItemTagSpellingMenu]; - END_BLOCK_OBJC_EXCEPTIONS; - return String(); + return platformStrategies()->localizationStrategy()->contextMenuItemTagSpellingMenu(); } String contextMenuItemTagShowSpellingPanel(bool show) { - BEGIN_BLOCK_OBJC_EXCEPTIONS; - return [[WebCoreViewFactory sharedFactory] contextMenuItemTagShowSpellingPanel:show]; - END_BLOCK_OBJC_EXCEPTIONS; - return String(); + return platformStrategies()->localizationStrategy()->contextMenuItemTagShowSpellingPanel(show); } String contextMenuItemTagCheckSpelling() { - BEGIN_BLOCK_OBJC_EXCEPTIONS; - return [[WebCoreViewFactory sharedFactory] contextMenuItemTagCheckSpelling]; - END_BLOCK_OBJC_EXCEPTIONS; - return String(); + return platformStrategies()->localizationStrategy()->contextMenuItemTagCheckSpelling(); } String contextMenuItemTagCheckSpellingWhileTyping() { - BEGIN_BLOCK_OBJC_EXCEPTIONS; - return [[WebCoreViewFactory sharedFactory] contextMenuItemTagCheckSpellingWhileTyping]; - END_BLOCK_OBJC_EXCEPTIONS; - return String(); + return platformStrategies()->localizationStrategy()->contextMenuItemTagCheckSpellingWhileTyping(); } String contextMenuItemTagCheckGrammarWithSpelling() { - BEGIN_BLOCK_OBJC_EXCEPTIONS; - return [[WebCoreViewFactory sharedFactory] contextMenuItemTagCheckGrammarWithSpelling]; - END_BLOCK_OBJC_EXCEPTIONS; - return String(); + return platformStrategies()->localizationStrategy()->contextMenuItemTagCheckGrammarWithSpelling(); } String contextMenuItemTagFontMenu() { - BEGIN_BLOCK_OBJC_EXCEPTIONS; - return [[WebCoreViewFactory sharedFactory] contextMenuItemTagFontMenu]; - END_BLOCK_OBJC_EXCEPTIONS; - return String(); + return platformStrategies()->localizationStrategy()->contextMenuItemTagFontMenu(); } String contextMenuItemTagShowFonts() { - BEGIN_BLOCK_OBJC_EXCEPTIONS; - return [[WebCoreViewFactory sharedFactory] contextMenuItemTagShowFonts]; - END_BLOCK_OBJC_EXCEPTIONS; - return String(); + return platformStrategies()->localizationStrategy()->contextMenuItemTagShowFonts(); } String contextMenuItemTagBold() { - BEGIN_BLOCK_OBJC_EXCEPTIONS; - return [[WebCoreViewFactory sharedFactory] contextMenuItemTagBold]; - END_BLOCK_OBJC_EXCEPTIONS; - return String(); + return platformStrategies()->localizationStrategy()->contextMenuItemTagBold(); } String contextMenuItemTagItalic() { - BEGIN_BLOCK_OBJC_EXCEPTIONS; - return [[WebCoreViewFactory sharedFactory] contextMenuItemTagItalic]; - END_BLOCK_OBJC_EXCEPTIONS; - return String(); + return platformStrategies()->localizationStrategy()->contextMenuItemTagItalic(); } String contextMenuItemTagUnderline() { - BEGIN_BLOCK_OBJC_EXCEPTIONS; - return [[WebCoreViewFactory sharedFactory] contextMenuItemTagUnderline]; - END_BLOCK_OBJC_EXCEPTIONS; - return String(); + return platformStrategies()->localizationStrategy()->contextMenuItemTagUnderline(); } String contextMenuItemTagOutline() { - BEGIN_BLOCK_OBJC_EXCEPTIONS; - return [[WebCoreViewFactory sharedFactory] contextMenuItemTagOutline]; - END_BLOCK_OBJC_EXCEPTIONS; - return String(); + return platformStrategies()->localizationStrategy()->contextMenuItemTagOutline(); } String contextMenuItemTagStyles() { - BEGIN_BLOCK_OBJC_EXCEPTIONS; - return [[WebCoreViewFactory sharedFactory] contextMenuItemTagStyles]; - END_BLOCK_OBJC_EXCEPTIONS; - return String(); + return platformStrategies()->localizationStrategy()->contextMenuItemTagStyles(); } String contextMenuItemTagShowColors() { - BEGIN_BLOCK_OBJC_EXCEPTIONS; - return [[WebCoreViewFactory sharedFactory] contextMenuItemTagShowColors]; - END_BLOCK_OBJC_EXCEPTIONS; - return String(); + return platformStrategies()->localizationStrategy()->contextMenuItemTagShowColors(); } String contextMenuItemTagSpeechMenu() { - BEGIN_BLOCK_OBJC_EXCEPTIONS; - return [[WebCoreViewFactory sharedFactory] contextMenuItemTagSpeechMenu]; - END_BLOCK_OBJC_EXCEPTIONS; - return String(); + return platformStrategies()->localizationStrategy()->contextMenuItemTagSpeechMenu(); } String contextMenuItemTagStartSpeaking() { - BEGIN_BLOCK_OBJC_EXCEPTIONS; - return [[WebCoreViewFactory sharedFactory] contextMenuItemTagStartSpeaking]; - END_BLOCK_OBJC_EXCEPTIONS; - return String(); + return platformStrategies()->localizationStrategy()->contextMenuItemTagStartSpeaking(); } String contextMenuItemTagStopSpeaking() { - BEGIN_BLOCK_OBJC_EXCEPTIONS; - return [[WebCoreViewFactory sharedFactory] contextMenuItemTagStopSpeaking]; - END_BLOCK_OBJC_EXCEPTIONS; - return String(); + return platformStrategies()->localizationStrategy()->contextMenuItemTagStopSpeaking(); } String contextMenuItemTagWritingDirectionMenu() { - BEGIN_BLOCK_OBJC_EXCEPTIONS; - return [[WebCoreViewFactory sharedFactory] contextMenuItemTagWritingDirectionMenu]; - END_BLOCK_OBJC_EXCEPTIONS; - return String(); + return platformStrategies()->localizationStrategy()->contextMenuItemTagWritingDirectionMenu(); } String contextMenuItemTagTextDirectionMenu() { - BEGIN_BLOCK_OBJC_EXCEPTIONS; - return [[WebCoreViewFactory sharedFactory] contextMenuItemTagTextDirectionMenu]; - END_BLOCK_OBJC_EXCEPTIONS; - return String(); + return platformStrategies()->localizationStrategy()->contextMenuItemTagTextDirectionMenu(); } String contextMenuItemTagDefaultDirection() { - BEGIN_BLOCK_OBJC_EXCEPTIONS; - return [[WebCoreViewFactory sharedFactory] contextMenuItemTagDefaultDirection]; - END_BLOCK_OBJC_EXCEPTIONS; - return String(); + return platformStrategies()->localizationStrategy()->contextMenuItemTagDefaultDirection(); } String contextMenuItemTagLeftToRight() { - BEGIN_BLOCK_OBJC_EXCEPTIONS; - return [[WebCoreViewFactory sharedFactory] contextMenuItemTagLeftToRight]; - END_BLOCK_OBJC_EXCEPTIONS; - return String(); + return platformStrategies()->localizationStrategy()->contextMenuItemTagLeftToRight(); } String contextMenuItemTagRightToLeft() { - BEGIN_BLOCK_OBJC_EXCEPTIONS; - return [[WebCoreViewFactory sharedFactory] contextMenuItemTagRightToLeft]; - END_BLOCK_OBJC_EXCEPTIONS; - return String(); + return platformStrategies()->localizationStrategy()->contextMenuItemTagRightToLeft(); } String contextMenuItemTagCorrectSpellingAutomatically() { - BEGIN_BLOCK_OBJC_EXCEPTIONS; - return [[WebCoreViewFactory sharedFactory] contextMenuItemTagCorrectSpellingAutomatically]; - END_BLOCK_OBJC_EXCEPTIONS; - return String(); + return platformStrategies()->localizationStrategy()->contextMenuItemTagCorrectSpellingAutomatically(); } String contextMenuItemTagSubstitutionsMenu() { - BEGIN_BLOCK_OBJC_EXCEPTIONS; - return [[WebCoreViewFactory sharedFactory] contextMenuItemTagSubstitutionsMenu]; - END_BLOCK_OBJC_EXCEPTIONS; - return String(); + return platformStrategies()->localizationStrategy()->contextMenuItemTagSubstitutionsMenu(); } String contextMenuItemTagShowSubstitutions(bool show) { - BEGIN_BLOCK_OBJC_EXCEPTIONS; - return [[WebCoreViewFactory sharedFactory] contextMenuItemTagShowSubstitutions:show]; - END_BLOCK_OBJC_EXCEPTIONS; - return String(); + return platformStrategies()->localizationStrategy()->contextMenuItemTagShowSubstitutions(show); } String contextMenuItemTagSmartCopyPaste() { - BEGIN_BLOCK_OBJC_EXCEPTIONS; - return [[WebCoreViewFactory sharedFactory] contextMenuItemTagSmartCopyPaste]; - END_BLOCK_OBJC_EXCEPTIONS; - return String(); + return platformStrategies()->localizationStrategy()->contextMenuItemTagSmartCopyPaste(); } String contextMenuItemTagSmartQuotes() { - BEGIN_BLOCK_OBJC_EXCEPTIONS; - return [[WebCoreViewFactory sharedFactory] contextMenuItemTagSmartQuotes]; - END_BLOCK_OBJC_EXCEPTIONS; - return String(); + return platformStrategies()->localizationStrategy()->contextMenuItemTagSmartQuotes(); } String contextMenuItemTagSmartDashes() { - BEGIN_BLOCK_OBJC_EXCEPTIONS; - return [[WebCoreViewFactory sharedFactory] contextMenuItemTagSmartDashes]; - END_BLOCK_OBJC_EXCEPTIONS; - return String(); + return platformStrategies()->localizationStrategy()->contextMenuItemTagSmartDashes(); } String contextMenuItemTagSmartLinks() { - BEGIN_BLOCK_OBJC_EXCEPTIONS; - return [[WebCoreViewFactory sharedFactory] contextMenuItemTagSmartLinks]; - END_BLOCK_OBJC_EXCEPTIONS; - return String(); + return platformStrategies()->localizationStrategy()->contextMenuItemTagSmartLinks(); } String contextMenuItemTagTextReplacement() { - BEGIN_BLOCK_OBJC_EXCEPTIONS; - return [[WebCoreViewFactory sharedFactory] contextMenuItemTagTextReplacement]; - END_BLOCK_OBJC_EXCEPTIONS; - return String(); + return platformStrategies()->localizationStrategy()->contextMenuItemTagTextReplacement(); } String contextMenuItemTagTransformationsMenu() { - BEGIN_BLOCK_OBJC_EXCEPTIONS; - return [[WebCoreViewFactory sharedFactory] contextMenuItemTagTransformationsMenu]; - END_BLOCK_OBJC_EXCEPTIONS; - return String(); + return platformStrategies()->localizationStrategy()->contextMenuItemTagTransformationsMenu(); } String contextMenuItemTagMakeUpperCase() { - BEGIN_BLOCK_OBJC_EXCEPTIONS; - return [[WebCoreViewFactory sharedFactory] contextMenuItemTagMakeUpperCase]; - END_BLOCK_OBJC_EXCEPTIONS; - return String(); + return platformStrategies()->localizationStrategy()->contextMenuItemTagMakeUpperCase(); } String contextMenuItemTagMakeLowerCase() { - BEGIN_BLOCK_OBJC_EXCEPTIONS; - return [[WebCoreViewFactory sharedFactory] contextMenuItemTagMakeLowerCase]; - END_BLOCK_OBJC_EXCEPTIONS; - return String(); + return platformStrategies()->localizationStrategy()->contextMenuItemTagMakeLowerCase(); } String contextMenuItemTagCapitalize() { - BEGIN_BLOCK_OBJC_EXCEPTIONS; - return [[WebCoreViewFactory sharedFactory] contextMenuItemTagCapitalize]; - END_BLOCK_OBJC_EXCEPTIONS; - return String(); + return platformStrategies()->localizationStrategy()->contextMenuItemTagCapitalize(); } String contextMenuItemTagChangeBack(const String& replacedString) { - BEGIN_BLOCK_OBJC_EXCEPTIONS; - return [[WebCoreViewFactory sharedFactory] contextMenuItemTagChangeBack:replacedString]; - END_BLOCK_OBJC_EXCEPTIONS; - return replacedString; + return platformStrategies()->localizationStrategy()->contextMenuItemTagChangeBack(replacedString); } String contextMenuItemTagInspectElement() { - BEGIN_BLOCK_OBJC_EXCEPTIONS; - return [[WebCoreViewFactory sharedFactory] contextMenuItemTagInspectElement]; - END_BLOCK_OBJC_EXCEPTIONS; - return String(); + return platformStrategies()->localizationStrategy()->contextMenuItemTagInspectElement(); } + #endif // ENABLE(CONTEXT_MENUS) String searchMenuNoRecentSearchesText() { - BEGIN_BLOCK_OBJC_EXCEPTIONS; - return [[WebCoreViewFactory sharedFactory] searchMenuNoRecentSearchesText]; - END_BLOCK_OBJC_EXCEPTIONS; - return String(); + return platformStrategies()->localizationStrategy()->searchMenuNoRecentSearchesText(); } String searchMenuRecentSearchesText () { - BEGIN_BLOCK_OBJC_EXCEPTIONS; - return [[WebCoreViewFactory sharedFactory] searchMenuRecentSearchesText]; - END_BLOCK_OBJC_EXCEPTIONS; - return String(); + return platformStrategies()->localizationStrategy()->searchMenuRecentSearchesText (); } String searchMenuClearRecentSearchesText() { - BEGIN_BLOCK_OBJC_EXCEPTIONS; - return [[WebCoreViewFactory sharedFactory] searchMenuClearRecentSearchesText]; - END_BLOCK_OBJC_EXCEPTIONS; - return String(); + return platformStrategies()->localizationStrategy()->searchMenuClearRecentSearchesText(); } String AXWebAreaText() { - BEGIN_BLOCK_OBJC_EXCEPTIONS; - return [[WebCoreViewFactory sharedFactory] AXWebAreaText]; - END_BLOCK_OBJC_EXCEPTIONS; - return String(); + return platformStrategies()->localizationStrategy()->AXWebAreaText(); } String AXLinkText() { - BEGIN_BLOCK_OBJC_EXCEPTIONS; - return [[WebCoreViewFactory sharedFactory] AXLinkText]; - END_BLOCK_OBJC_EXCEPTIONS; - return String(); + return platformStrategies()->localizationStrategy()->AXLinkText(); } String AXListMarkerText() { - BEGIN_BLOCK_OBJC_EXCEPTIONS; - return [[WebCoreViewFactory sharedFactory] AXListMarkerText]; - END_BLOCK_OBJC_EXCEPTIONS; - return String(); + return platformStrategies()->localizationStrategy()->AXListMarkerText(); } String AXImageMapText() { - BEGIN_BLOCK_OBJC_EXCEPTIONS; - return [[WebCoreViewFactory sharedFactory] AXImageMapText]; - END_BLOCK_OBJC_EXCEPTIONS; - return String(); + return platformStrategies()->localizationStrategy()->AXImageMapText(); } String AXHeadingText() { - BEGIN_BLOCK_OBJC_EXCEPTIONS; - return [[WebCoreViewFactory sharedFactory] AXHeadingText]; - END_BLOCK_OBJC_EXCEPTIONS; - return String(); + return platformStrategies()->localizationStrategy()->AXHeadingText(); } String AXDefinitionListTermText() { - BEGIN_BLOCK_OBJC_EXCEPTIONS; - return [[WebCoreViewFactory sharedFactory] AXDefinitionListTermText]; - END_BLOCK_OBJC_EXCEPTIONS; - return String(); + return platformStrategies()->localizationStrategy()->AXDefinitionListTermText(); } - + String AXDefinitionListDefinitionText() { - BEGIN_BLOCK_OBJC_EXCEPTIONS; - return [[WebCoreViewFactory sharedFactory] AXDefinitionListDefinitionText]; - END_BLOCK_OBJC_EXCEPTIONS; - return String(); + return platformStrategies()->localizationStrategy()->AXDefinitionListDefinitionText(); } - + String AXARIAContentGroupText(const String& ariaType) { - BEGIN_BLOCK_OBJC_EXCEPTIONS; - return [[WebCoreViewFactory sharedFactory] AXARIAContentGroupText:ariaType]; - END_BLOCK_OBJC_EXCEPTIONS; - return String(); + return platformStrategies()->localizationStrategy()->AXARIAContentGroupText(ariaType); } String AXButtonActionVerb() { - BEGIN_BLOCK_OBJC_EXCEPTIONS; - return [[WebCoreViewFactory sharedFactory] AXButtonActionVerb]; - END_BLOCK_OBJC_EXCEPTIONS; - return String(); + return platformStrategies()->localizationStrategy()->AXButtonActionVerb(); } String AXRadioButtonActionVerb() { - BEGIN_BLOCK_OBJC_EXCEPTIONS; - return [[WebCoreViewFactory sharedFactory] AXRadioButtonActionVerb]; - END_BLOCK_OBJC_EXCEPTIONS; - return String(); + return platformStrategies()->localizationStrategy()->AXRadioButtonActionVerb(); } String AXTextFieldActionVerb() { - BEGIN_BLOCK_OBJC_EXCEPTIONS; - return [[WebCoreViewFactory sharedFactory] AXTextFieldActionVerb]; - END_BLOCK_OBJC_EXCEPTIONS; - return String(); + return platformStrategies()->localizationStrategy()->AXTextFieldActionVerb(); } String AXCheckedCheckBoxActionVerb() { - BEGIN_BLOCK_OBJC_EXCEPTIONS; - return [[WebCoreViewFactory sharedFactory] AXCheckedCheckBoxActionVerb]; - END_BLOCK_OBJC_EXCEPTIONS; - return String(); + return platformStrategies()->localizationStrategy()->AXCheckedCheckBoxActionVerb(); } String AXUncheckedCheckBoxActionVerb() { - BEGIN_BLOCK_OBJC_EXCEPTIONS; - return [[WebCoreViewFactory sharedFactory] AXUncheckedCheckBoxActionVerb]; - END_BLOCK_OBJC_EXCEPTIONS; - return String(); + return platformStrategies()->localizationStrategy()->AXUncheckedCheckBoxActionVerb(); } String AXLinkActionVerb() { - BEGIN_BLOCK_OBJC_EXCEPTIONS; - return [[WebCoreViewFactory sharedFactory] AXLinkActionVerb]; - END_BLOCK_OBJC_EXCEPTIONS; - return String(); + return platformStrategies()->localizationStrategy()->AXLinkActionVerb(); } String AXMenuListPopupActionVerb() { - BEGIN_BLOCK_OBJC_EXCEPTIONS; - return [[WebCoreViewFactory sharedFactory] AXMenuListPopupActionVerb]; - END_BLOCK_OBJC_EXCEPTIONS; - return String(); + return platformStrategies()->localizationStrategy()->AXMenuListPopupActionVerb(); } String AXMenuListActionVerb() { - BEGIN_BLOCK_OBJC_EXCEPTIONS; - return [[WebCoreViewFactory sharedFactory] AXMenuListActionVerb]; - END_BLOCK_OBJC_EXCEPTIONS; - return String(); + return platformStrategies()->localizationStrategy()->AXMenuListActionVerb(); } String missingPluginText() { - BEGIN_BLOCK_OBJC_EXCEPTIONS; - return [[WebCoreViewFactory sharedFactory] missingPluginText]; - END_BLOCK_OBJC_EXCEPTIONS; - return String(); + return platformStrategies()->localizationStrategy()->missingPluginText(); } String crashedPluginText() { - BEGIN_BLOCK_OBJC_EXCEPTIONS; - return [[WebCoreViewFactory sharedFactory] crashedPluginText]; - END_BLOCK_OBJC_EXCEPTIONS; - return String(); + return platformStrategies()->localizationStrategy()->crashedPluginText(); } String multipleFileUploadText(unsigned numberOfFiles) { - BEGIN_BLOCK_OBJC_EXCEPTIONS; - return [[WebCoreViewFactory sharedFactory] multipleFileUploadTextForNumberOfFiles:numberOfFiles]; - END_BLOCK_OBJC_EXCEPTIONS; - return String(); + return platformStrategies()->localizationStrategy()->multipleFileUploadText(numberOfFiles); } String unknownFileSizeText() { - BEGIN_BLOCK_OBJC_EXCEPTIONS; - return [[WebCoreViewFactory sharedFactory] unknownFileSizeText]; - END_BLOCK_OBJC_EXCEPTIONS; - return String(); + return platformStrategies()->localizationStrategy()->unknownFileSizeText(); } String imageTitle(const String& filename, const IntSize& size) { - BEGIN_BLOCK_OBJC_EXCEPTIONS; - return [[WebCoreViewFactory sharedFactory] imageTitleForFilename:filename width:size.width() height:size.height()]; - END_BLOCK_OBJC_EXCEPTIONS; - return String(); + return platformStrategies()->localizationStrategy()->imageTitle(filename, size); } String mediaElementLoadingStateText() { - BEGIN_BLOCK_OBJC_EXCEPTIONS; - return [[WebCoreViewFactory sharedFactory] mediaElementLoadingStateText]; - END_BLOCK_OBJC_EXCEPTIONS; - return String(); + return platformStrategies()->localizationStrategy()->mediaElementLoadingStateText(); } String mediaElementLiveBroadcastStateText() { - BEGIN_BLOCK_OBJC_EXCEPTIONS; - return [[WebCoreViewFactory sharedFactory] mediaElementLiveBroadcastStateText]; - END_BLOCK_OBJC_EXCEPTIONS; - return String(); + return platformStrategies()->localizationStrategy()->mediaElementLiveBroadcastStateText(); } String localizedMediaControlElementString(const String& controlName) { - BEGIN_BLOCK_OBJC_EXCEPTIONS; - return [[WebCoreViewFactory sharedFactory] localizedMediaControlElementString:controlName]; - END_BLOCK_OBJC_EXCEPTIONS; - return String(); + return platformStrategies()->localizationStrategy()->localizedMediaControlElementString(controlName); } String localizedMediaControlElementHelpText(const String& controlName) { - BEGIN_BLOCK_OBJC_EXCEPTIONS; - return [[WebCoreViewFactory sharedFactory] localizedMediaControlElementHelpText:controlName]; - END_BLOCK_OBJC_EXCEPTIONS; - return String(); + return platformStrategies()->localizationStrategy()->localizedMediaControlElementHelpText(controlName); } String localizedMediaTimeDescription(float time) { - BEGIN_BLOCK_OBJC_EXCEPTIONS; - return [[WebCoreViewFactory sharedFactory] localizedMediaTimeDescription:time]; - END_BLOCK_OBJC_EXCEPTIONS; - return String(); + return platformStrategies()->localizationStrategy()->localizedMediaTimeDescription(time); } String validationMessageValueMissingText() { - BEGIN_BLOCK_OBJC_EXCEPTIONS; - return [[WebCoreViewFactory sharedFactory] validationMessageValueMissingText]; - END_BLOCK_OBJC_EXCEPTIONS; - return String(); + return platformStrategies()->localizationStrategy()->validationMessageValueMissingText(); } String validationMessageTypeMismatchText() { - BEGIN_BLOCK_OBJC_EXCEPTIONS; - return [[WebCoreViewFactory sharedFactory] validationMessageTypeMismatchText]; - END_BLOCK_OBJC_EXCEPTIONS; - return String(); + return platformStrategies()->localizationStrategy()->validationMessageTypeMismatchText(); } String validationMessagePatternMismatchText() { - BEGIN_BLOCK_OBJC_EXCEPTIONS; - return [[WebCoreViewFactory sharedFactory] validationMessagePatternMismatchText]; - END_BLOCK_OBJC_EXCEPTIONS; - return String(); + return platformStrategies()->localizationStrategy()->validationMessagePatternMismatchText(); } String validationMessageTooLongText() { - BEGIN_BLOCK_OBJC_EXCEPTIONS; - return [[WebCoreViewFactory sharedFactory] validationMessageTooLongText]; - END_BLOCK_OBJC_EXCEPTIONS; - return String(); + return platformStrategies()->localizationStrategy()->validationMessageTooLongText(); } String validationMessageRangeUnderflowText() { - BEGIN_BLOCK_OBJC_EXCEPTIONS; - return [[WebCoreViewFactory sharedFactory] validationMessageRangeUnderflowText]; - END_BLOCK_OBJC_EXCEPTIONS; - return String(); + return platformStrategies()->localizationStrategy()->validationMessageRangeUnderflowText(); } String validationMessageRangeOverflowText() { - BEGIN_BLOCK_OBJC_EXCEPTIONS; - return [[WebCoreViewFactory sharedFactory] validationMessageRangeOverflowText]; - END_BLOCK_OBJC_EXCEPTIONS; - return String(); + return platformStrategies()->localizationStrategy()->validationMessageRangeOverflowText(); } String validationMessageStepMismatchText() { - BEGIN_BLOCK_OBJC_EXCEPTIONS; - return [[WebCoreViewFactory sharedFactory] validationMessageStepMismatchText]; - END_BLOCK_OBJC_EXCEPTIONS; - return String(); + return platformStrategies()->localizationStrategy()->validationMessageStepMismatchText(); } -} +} // namespace WebCore diff --git a/WebCore/platform/network/FormDataBuilder.cpp b/WebCore/platform/network/FormDataBuilder.cpp index fb78b08..da28fc2 100644 --- a/WebCore/platform/network/FormDataBuilder.cpp +++ b/WebCore/platform/network/FormDataBuilder.cpp @@ -25,7 +25,6 @@ #include "config.h" #include "FormDataBuilder.h" -#include "CSSHelper.h" #include "Document.h" #include "Frame.h" #include "FrameLoader.h" @@ -38,67 +37,6 @@ namespace WebCore { -FormDataBuilder::FormDataBuilder() - : m_isPostMethod(false) - , m_isMultiPartForm(false) - , m_encodingType("application/x-www-form-urlencoded") -{ -} - -FormDataBuilder::~FormDataBuilder() -{ -} - -void FormDataBuilder::parseAction(const String& action) -{ - // FIXME: Can we parse into a KURL? - m_action = deprecatedParseURL(action); -} - -void FormDataBuilder::parseEncodingType(const String& type) -{ - if (type.contains("multipart", false) || type.contains("form-data", false)) { - m_encodingType = "multipart/form-data"; - m_isMultiPartForm = true; - } else if (type.contains("text", false) || type.contains("plain", false)) { - m_encodingType = "text/plain"; - m_isMultiPartForm = false; - } else { - m_encodingType = "application/x-www-form-urlencoded"; - m_isMultiPartForm = false; - } -} - -void FormDataBuilder::parseMethodType(const String& type) -{ - if (equalIgnoringCase(type, "post")) - m_isPostMethod = true; - else if (equalIgnoringCase(type, "get")) - m_isPostMethod = false; -} - -TextEncoding FormDataBuilder::dataEncoding(Document* document) const -{ - String acceptCharset = m_acceptCharset; - acceptCharset.replace(',', ' '); - - Vector<String> charsets; - acceptCharset.split(' ', charsets); - - TextEncoding encoding; - - Vector<String>::const_iterator end = charsets.end(); - for (Vector<String>::const_iterator it = charsets.begin(); it != end; ++it) { - if ((encoding = TextEncoding(*it)).isValid()) - return encoding; - } - - if (Frame* frame = document->frame()) - return frame->loader()->writer()->encoding(); - - return Latin1Encoding(); -} - // Helper functions static inline void append(Vector<char>& buffer, char string) { @@ -140,6 +78,28 @@ static void appendQuotedString(Vector<char>& buffer, const CString& string) } } +TextEncoding FormDataBuilder::encodingFromAcceptCharset(const String& acceptCharset, Document* document) +{ + String normalizedAcceptCharset = acceptCharset; + normalizedAcceptCharset.replace(',', ' '); + + Vector<String> charsets; + normalizedAcceptCharset.split(' ', charsets); + + TextEncoding encoding; + + Vector<String>::const_iterator end = charsets.end(); + for (Vector<String>::const_iterator it = charsets.begin(); it != end; ++it) { + if ((encoding = TextEncoding(*it)).isValid()) + return encoding; + } + + if (Frame* frame = document->frame()) + return frame->loader()->writer()->encoding(); + + return Latin1Encoding(); +} + Vector<char> FormDataBuilder::generateUniqueBoundaryString() { Vector<char> boundary; diff --git a/WebCore/platform/network/FormDataBuilder.h b/WebCore/platform/network/FormDataBuilder.h index 559906e..26b90af 100644 --- a/WebCore/platform/network/FormDataBuilder.h +++ b/WebCore/platform/network/FormDataBuilder.h @@ -36,31 +36,7 @@ class TextEncoding; class FormDataBuilder : public Noncopyable { public: - FormDataBuilder(); - ~FormDataBuilder(); - - bool isPostMethod() const { return m_isPostMethod; } - void setIsPostMethod(bool value) { m_isPostMethod = value; } - - bool isMultiPartForm() const { return m_isMultiPartForm; } - void setIsMultiPartForm(bool value) { m_isMultiPartForm = value; } - - const String& action() const { return m_action; } - - const String& target() const { return m_target; } - void setTarget(const String& target) { m_target = target; } - - String encodingType() const { return m_encodingType; } - void setEncodingType(const String& value) { m_encodingType = value; } - - String acceptCharset() const { return m_acceptCharset; } - void setAcceptCharset(const String& value) { m_acceptCharset = value; } - - void parseAction(const String&); - void parseEncodingType(const String&); - void parseMethodType(const String&); - - TextEncoding dataEncoding(Document*) const; + static TextEncoding encodingFromAcceptCharset(const String& acceptCharset, Document* document); // Helper functions used by HTMLFormElement/WMLGoElement for multi-part form data static Vector<char> generateUniqueBoundaryString(); @@ -75,13 +51,7 @@ public: static void encodeStringAsFormData(Vector<char>&, const WTF::CString&); private: - bool m_isPostMethod; - bool m_isMultiPartForm; - - String m_action; - String m_target; - String m_encodingType; - String m_acceptCharset; + FormDataBuilder() {} }; } diff --git a/WebCore/platform/qt/ClipboardQt.cpp b/WebCore/platform/qt/ClipboardQt.cpp index 7d22349..6ca4830 100644 --- a/WebCore/platform/qt/ClipboardQt.cpp +++ b/WebCore/platform/qt/ClipboardQt.cpp @@ -31,6 +31,7 @@ #include "CSSHelper.h" #include "CachedImage.h" #include "Document.h" +#include "DragData.h" #include "Element.h" #include "FileList.h" #include "Frame.h" @@ -68,6 +69,11 @@ static bool isHtmlMimeType(const String& type) return type == "text/html" || type.startsWith("text/html;"); } +PassRefPtr<Clipboard> Clipboard::create(ClipboardAccessPolicy policy, DragData* dragData, Frame*) +{ + return ClipboardQt::create(policy, dragData->platformData()); +} + ClipboardQt::ClipboardQt(ClipboardAccessPolicy policy, const QMimeData* readableClipboard) : Clipboard(policy, true) , m_readableData(readableClipboard) diff --git a/WebCore/platform/qt/DragDataQt.cpp b/WebCore/platform/qt/DragDataQt.cpp index 808606d..4033123 100644 --- a/WebCore/platform/qt/DragDataQt.cpp +++ b/WebCore/platform/qt/DragDataQt.cpp @@ -26,7 +26,6 @@ #include "config.h" #include "DragData.h" -#include "ClipboardQt.h" #include "Document.h" #include "DocumentFragment.h" #include "markup.h" @@ -100,11 +99,6 @@ Color DragData::asColor() const return qvariant_cast<QColor>(m_platformDragData->colorData()); } -PassRefPtr<Clipboard> DragData::createClipboard(ClipboardAccessPolicy policy) const -{ - return ClipboardQt::create(policy, m_platformDragData); -} - bool DragData::containsCompatibleContent() const { if (!m_platformDragData) diff --git a/WebCore/platform/text/transcoder/FontTranscoder.cpp b/WebCore/platform/text/transcoder/FontTranscoder.cpp index 12678e8..8e2f33f 100644 --- a/WebCore/platform/text/transcoder/FontTranscoder.cpp +++ b/WebCore/platform/text/transcoder/FontTranscoder.cpp @@ -32,6 +32,7 @@ #include "FontTranscoder.h" #include "CharacterNames.h" +#include "FontDescription.h" #include "TextEncoding.h" namespace WebCore { @@ -59,8 +60,9 @@ FontTranscoder::FontTranscoder() m_converterTypes.add(AtomicString(unicodeNameMeiryo, sizeof(unicodeNameMeiryo) / sizeof(UChar)), BackslashToYenSign); } -FontTranscoder::ConverterType FontTranscoder::converterType(const AtomicString& fontFamily, const TextEncoding* encoding) const +FontTranscoder::ConverterType FontTranscoder::converterType(const FontDescription& fontDescription, const TextEncoding* encoding) const { + const AtomicString& fontFamily = fontDescription.family().family().string(); if (!fontFamily.isNull()) { HashMap<AtomicString, ConverterType>::const_iterator found = m_converterTypes.find(fontFamily); if (found != m_converterTypes.end()) @@ -68,17 +70,16 @@ FontTranscoder::ConverterType FontTranscoder::converterType(const AtomicString& } // IE's default fonts for Japanese encodings change backslashes into yen signs. - // FIXME: We don't need transcoding when the document explicitly - // specifies a font which doesn't change backslashes into yen signs. - if (encoding && encoding->backslashAsCurrencySymbol() != '\\') + // We emulate this behavior only when no font is explicitly specified. + if (encoding && encoding->backslashAsCurrencySymbol() != '\\' && !fontDescription.isSpecifiedFont()) return BackslashToYenSign; return NoConversion; } -void FontTranscoder::convert(String& text, const AtomicString& fontFamily, const TextEncoding* encoding) const +void FontTranscoder::convert(String& text, const FontDescription& fontDescription, const TextEncoding* encoding) const { - switch (converterType(fontFamily, encoding)) { + switch (converterType(fontDescription, encoding)) { case BackslashToYenSign: { // FIXME: TextEncoding.h has similar code. We need to factor them out. text.replace('\\', yenSign); @@ -90,9 +91,9 @@ void FontTranscoder::convert(String& text, const AtomicString& fontFamily, const } } -bool FontTranscoder::needsTranscoding(const AtomicString& fontFamily, const TextEncoding* encoding) const +bool FontTranscoder::needsTranscoding(const FontDescription& fontDescription, const TextEncoding* encoding) const { - ConverterType type = converterType(fontFamily, encoding); + ConverterType type = converterType(fontDescription, encoding); return type != NoConversion; } diff --git a/WebCore/platform/text/transcoder/FontTranscoder.h b/WebCore/platform/text/transcoder/FontTranscoder.h index f013453..1fdc936 100644 --- a/WebCore/platform/text/transcoder/FontTranscoder.h +++ b/WebCore/platform/text/transcoder/FontTranscoder.h @@ -37,12 +37,13 @@ namespace WebCore { +class FontDescription; class TextEncoding; class FontTranscoder : public Noncopyable { public: - void convert(String& text, const AtomicString& fontFamily, const TextEncoding* = 0) const; - bool needsTranscoding(const AtomicString& fontFamily, const TextEncoding* = 0) const; + void convert(String& text, const FontDescription&, const TextEncoding* = 0) const; + bool needsTranscoding(const FontDescription&, const TextEncoding* = 0) const; private: FontTranscoder(); @@ -52,7 +53,7 @@ private: NoConversion, BackslashToYenSign, }; - ConverterType converterType(const AtomicString& fontFamily, const TextEncoding*) const; + ConverterType converterType(const FontDescription&, const TextEncoding*) const; HashMap<AtomicString, ConverterType> m_converterTypes; diff --git a/WebCore/platform/win/BitmapInfo.cpp b/WebCore/platform/win/BitmapInfo.cpp index 9a2312c..514f722 100644 --- a/WebCore/platform/win/BitmapInfo.cpp +++ b/WebCore/platform/win/BitmapInfo.cpp @@ -1,6 +1,8 @@ /* * Copyright (C) 2009 Apple Inc. All Rights Reserved. * Copyright (C) 2009 Brent Fulgham + * Copyright (C) 2007-2009 Torch Mobile, Inc. All Rights Reserved. + * Copyright (C) 2010 Patrick Gansterer <paroga@paroga.com> * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -27,16 +29,19 @@ #include "config.h" #include "BitmapInfo.h" +#include <wtf/Assertions.h> + namespace WebCore { -BitmapInfo bitmapInfoForSize(int width, int height) +BitmapInfo bitmapInfoForSize(int width, int height, WORD bitCount) { + ASSERT_ARG(bitCount, bitCount == 16 || bitCount == 32); + BitmapInfo bitmapInfo; - bitmapInfo.bmiHeader.biSize = sizeof(BITMAPINFOHEADER); - bitmapInfo.bmiHeader.biWidth = width; + bitmapInfo.bmiHeader.biWidth = width; bitmapInfo.bmiHeader.biHeight = height; bitmapInfo.bmiHeader.biPlanes = 1; - bitmapInfo.bmiHeader.biBitCount = 32; + bitmapInfo.bmiHeader.biBitCount = bitCount; bitmapInfo.bmiHeader.biCompression = BI_RGB; bitmapInfo.bmiHeader.biSizeImage = 0; bitmapInfo.bmiHeader.biXPelsPerMeter = 0; @@ -53,14 +58,14 @@ BitmapInfo::BitmapInfo() bmiHeader.biSize = sizeof(BITMAPINFOHEADER); } -BitmapInfo BitmapInfo::create(const IntSize& size) +BitmapInfo BitmapInfo::create(const IntSize& size, WORD bitCount) { - return bitmapInfoForSize(size.width(), size.height()); + return bitmapInfoForSize(size.width(), size.height(), bitCount); } -BitmapInfo BitmapInfo::createBottomUp(const IntSize& size) +BitmapInfo BitmapInfo::createBottomUp(const IntSize& size, WORD bitCount) { - return bitmapInfoForSize(size.width(), -size.height()); + return bitmapInfoForSize(size.width(), -size.height(), bitCount); } } // namespace WebCore diff --git a/WebCore/platform/win/BitmapInfo.h b/WebCore/platform/win/BitmapInfo.h index 0127fdb..d1c3319 100644 --- a/WebCore/platform/win/BitmapInfo.h +++ b/WebCore/platform/win/BitmapInfo.h @@ -1,6 +1,8 @@ /* * Copyright (C) 2009 Apple Inc. All Rights Reserved. * Copyright (C) 2009 Brent Fulgham + * Copyright (C) 2007-2009 Torch Mobile, Inc. All Rights Reserved. + * Copyright (C) 2010 Patrick Gansterer <paroga@paroga.com> * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -27,17 +29,25 @@ #ifndef BitmapInfo_h #define BitmapInfo_h -#include <windows.h> #include "IntSize.h" +#include <windows.h> namespace WebCore { struct BitmapInfo : public BITMAPINFO { - BitmapInfo (); - static BitmapInfo create(const IntSize&); - static BitmapInfo createBottomUp(const IntSize&); -}; + BitmapInfo(); + static BitmapInfo create(const IntSize&, WORD bitCount = 32); + static BitmapInfo createBottomUp(const IntSize&, WORD bitCount = 32); + bool is16bit() const { return bmiHeader.biBitCount == 16; } + bool is32bit() const { return bmiHeader.biBitCount == 32; } + unsigned width() const { return abs(bmiHeader.biWidth); } + unsigned height() const { return abs(bmiHeader.biHeight); } + IntSize size() const { return IntSize(width(), height()); } + unsigned paddedWidth() const { return is16bit() ? (width() + 1) & ~0x1 : width(); } + unsigned numPixels() const { return paddedWidth() * height(); } + unsigned paddedBytesPerLine() const { return is16bit() ? paddedWidth() * 2 : width() * 4; } + unsigned bytesPerLine() const { return width() * bmiHeader.biBitCount / 8; }}; } // namespace WebCore #endif // BitmapInfo_h diff --git a/WebCore/platform/win/ClipboardUtilitiesWin.cpp b/WebCore/platform/win/ClipboardUtilitiesWin.cpp index e6af7ef..0130a70 100644 --- a/WebCore/platform/win/ClipboardUtilitiesWin.cpp +++ b/WebCore/platform/win/ClipboardUtilitiesWin.cpp @@ -31,23 +31,47 @@ #include "PlatformString.h" #include "TextEncoding.h" #include "markup.h" -#include <CoreFoundation/CoreFoundation.h> #include <shlwapi.h> #include <wininet.h> // for INTERNET_MAX_URL_LENGTH -#include <wtf/RetainPtr.h> #include <wtf/text/CString.h> +#if PLATFORM(CF) +#include <CoreFoundation/CoreFoundation.h> +#include <wtf/RetainPtr.h> +#endif + namespace WebCore { +#if PLATFORM(CF) FORMATETC* cfHDropFormat() { static FORMATETC urlFormat = {CF_HDROP, 0, DVASPECT_CONTENT, -1, TYMED_HGLOBAL}; return &urlFormat; } +static bool urlFromPath(CFStringRef path, String& url) +{ + if (!path) + return false; + + RetainPtr<CFURLRef> cfURL(AdoptCF, CFURLCreateWithFileSystemPath(0, path, kCFURLWindowsPathStyle, false)); + if (!cfURL) + return false; + + url = CFURLGetString(cfURL.get()); + + // Work around <rdar://problem/6708300>, where CFURLCreateWithFileSystemPath makes URLs with "localhost". + if (url.startsWith("file://localhost/")) + url.remove(7, 9); + + return true; +} +#endif + static bool getWebLocData(IDataObject* dataObject, String& url, String* title) { bool succeeded = false; +#if PLATFORM(CF) WCHAR filename[MAX_PATH]; WCHAR urlBuffer[INTERNET_MAX_URL_LENGTH]; @@ -55,8 +79,8 @@ static bool getWebLocData(IDataObject* dataObject, String& url, String* title) if (FAILED(dataObject->GetData(cfHDropFormat(), &medium))) return false; - HDROP hdrop = (HDROP)GlobalLock(medium.hGlobal); - + HDROP hdrop = static_cast<HDROP>(GlobalLock(medium.hGlobal)); + if (!hdrop) return false; @@ -81,6 +105,7 @@ exit: // Free up memory. DragFinish(hdrop); GlobalUnlock(medium.hGlobal); +#endif return succeeded; } @@ -113,9 +138,9 @@ HGLOBAL createGlobalData(const KURL& url, const String& title) HGLOBAL cbData = ::GlobalAlloc(GPTR, size * sizeof(UChar)); if (cbData) { - PWSTR buffer = (PWSTR)::GlobalLock(cbData); - swprintf_s(buffer, size, L"%s\n%s", mutableURL.charactersWithNullTermination(), mutableTitle.charactersWithNullTermination()); - ::GlobalUnlock(cbData); + PWSTR buffer = static_cast<PWSTR>(GlobalLock(cbData)); + _snwprintf(buffer, size, L"%s\n%s", mutableURL.charactersWithNullTermination(), mutableTitle.charactersWithNullTermination()); + GlobalUnlock(cbData); } return cbData; } @@ -125,10 +150,10 @@ HGLOBAL createGlobalData(const String& str) HGLOBAL globalData = ::GlobalAlloc(GPTR, (str.length() + 1) * sizeof(UChar)); if (!globalData) return 0; - UChar* buffer = static_cast<UChar*>(::GlobalLock(globalData)); + UChar* buffer = static_cast<UChar*>(GlobalLock(globalData)); memcpy(buffer, str.characters(), str.length() * sizeof(UChar)); buffer[str.length()] = 0; - ::GlobalUnlock(globalData); + GlobalUnlock(globalData); return globalData; } @@ -137,13 +162,30 @@ HGLOBAL createGlobalData(const Vector<char>& vector) HGLOBAL globalData = ::GlobalAlloc(GPTR, vector.size() + 1); if (!globalData) return 0; - char* buffer = static_cast<char*>(::GlobalLock(globalData)); + char* buffer = static_cast<char*>(GlobalLock(globalData)); memcpy(buffer, vector.data(), vector.size()); buffer[vector.size()] = 0; - ::GlobalUnlock(globalData); + GlobalUnlock(globalData); return globalData; } +static String getFullCFHTML(IDataObject* data, bool& success) +{ + STGMEDIUM store; + if (SUCCEEDED(data->GetData(htmlFormat(), &store))) { + // MS HTML Format parsing + char* data = static_cast<char*>(GlobalLock(store.hGlobal)); + SIZE_T dataSize = ::GlobalSize(store.hGlobal); + String cfhtml(UTF8Encoding().decode(data, dataSize)); + GlobalUnlock(store.hGlobal); + ReleaseStgMedium(&store); + success = true; + return cfhtml; + } + success = false; + return String(); +} + static void append(Vector<char>& vector, const char* string) { vector.append(string, strlen(string)); @@ -154,6 +196,17 @@ static void append(Vector<char>& vector, const CString& string) vector.append(string.data(), string.length()); } +// Find the markup between "<!--StartFragment -->" and "<!--EndFragment -->", accounting for browser quirks. +static String extractMarkupFromCFHTML(const String& cfhtml) +{ + unsigned markupStart = cfhtml.find("<html", 0, false); + unsigned tagStart = cfhtml.find("startfragment", markupStart, false); + unsigned fragmentStart = cfhtml.find('>', tagStart) + 1; + unsigned tagEnd = cfhtml.find("endfragment", fragmentStart, false); + unsigned fragmentEnd = cfhtml.reverseFind('<', tagEnd); + return cfhtml.substring(fragmentStart, fragmentEnd - fragmentStart).stripWhiteSpace(); +} + // Documentation for the CF_HTML format is available at http://msdn.microsoft.com/workshop/networking/clipboard/htmlclipboard.asp void markupToCFHTML(const String& markup, const String& srcURL, Vector<char>& result) { @@ -271,24 +324,6 @@ FORMATETC* smartPasteFormat() return &htmlFormat; } -static bool urlFromPath(CFStringRef path, String& url) -{ - if (!path) - return false; - - RetainPtr<CFURLRef> cfURL(AdoptCF, CFURLCreateWithFileSystemPath(0, path, kCFURLWindowsPathStyle, false)); - if (!cfURL) - return false; - - url = CFURLGetString(cfURL.get()); - - // Work around <rdar://problem/6708300>, where CFURLCreateWithFileSystemPath makes URLs with "localhost". - if (url.startsWith("file://localhost/")) - url.remove(7, 9); - - return true; -} - String getURL(IDataObject* dataObject, DragData::FilenameConversionPolicy filenamePolicy, bool& success, String* title) { STGMEDIUM store; @@ -298,22 +333,24 @@ String getURL(IDataObject* dataObject, DragData::FilenameConversionPolicy filena success = true; else if (SUCCEEDED(dataObject->GetData(urlWFormat(), &store))) { // URL using Unicode - UChar* data = (UChar*)GlobalLock(store.hGlobal); + UChar* data = static_cast<UChar*>(GlobalLock(store.hGlobal)); url = extractURL(String(data), title); - GlobalUnlock(store.hGlobal); + GlobalUnlock(store.hGlobal); ReleaseStgMedium(&store); success = true; } else if (SUCCEEDED(dataObject->GetData(urlFormat(), &store))) { // URL using ASCII - char* data = (char*)GlobalLock(store.hGlobal); + char* data = static_cast<char*>(GlobalLock(store.hGlobal)); url = extractURL(String(data), title); - GlobalUnlock(store.hGlobal); + GlobalUnlock(store.hGlobal); ReleaseStgMedium(&store); success = true; - } else if (filenamePolicy == DragData::ConvertFilenames) { + } +#if PLATFORM(CF) + else if (filenamePolicy == DragData::ConvertFilenames) { if (SUCCEEDED(dataObject->GetData(filenameWFormat(), &store))) { // file using unicode - wchar_t* data = (wchar_t*)GlobalLock(store.hGlobal); + wchar_t* data = static_cast<wchar_t*>(GlobalLock(store.hGlobal)); if (data && data[0] && (PathFileExists(data) || PathIsUNC(data))) { RetainPtr<CFStringRef> pathAsCFString(AdoptCF, CFStringCreateWithCharacters(kCFAllocatorDefault, (const UniChar*)data, wcslen(data))); if (urlFromPath(pathAsCFString.get(), url)) { @@ -326,7 +363,7 @@ String getURL(IDataObject* dataObject, DragData::FilenameConversionPolicy filena ReleaseStgMedium(&store); } else if (SUCCEEDED(dataObject->GetData(filenameFormat(), &store))) { // filename using ascii - char* data = (char*)GlobalLock(store.hGlobal); + char* data = static_cast<char*>(GlobalLock(store.hGlobal)); if (data && data[0] && (PathFileExistsA(data) || PathIsUNCA(data))) { RetainPtr<CFStringRef> pathAsCFString(AdoptCF, CFStringCreateWithCString(kCFAllocatorDefault, data, kCFStringEncodingASCII)); if (urlFromPath(pathAsCFString.get(), url)) { @@ -339,6 +376,7 @@ String getURL(IDataObject* dataObject, DragData::FilenameConversionPolicy filena ReleaseStgMedium(&store); } } +#endif return url; } @@ -349,14 +387,14 @@ String getPlainText(IDataObject* dataObject, bool& success) success = false; if (SUCCEEDED(dataObject->GetData(plainTextWFormat(), &store))) { // Unicode text - UChar* data = (UChar*)GlobalLock(store.hGlobal); + UChar* data = static_cast<UChar*>(GlobalLock(store.hGlobal)); text = String(data); GlobalUnlock(store.hGlobal); ReleaseStgMedium(&store); success = true; } else if (SUCCEEDED(dataObject->GetData(plainTextFormat(), &store))) { // ASCII text - char* data = (char*)GlobalLock(store.hGlobal); + char* data = static_cast<char*>(GlobalLock(store.hGlobal)); text = String(data); GlobalUnlock(store.hGlobal); ReleaseStgMedium(&store); @@ -386,6 +424,14 @@ String getTextHTML(IDataObject* data, bool& success) return html; } +String getCFHTML(IDataObject* data, bool& success) +{ + String cfhtml = getFullCFHTML(data, success); + if (success) + return extractMarkupFromCFHTML(cfhtml); + return String(); +} + PassRefPtr<DocumentFragment> fragmentFromFilenames(Document*, const IDataObject*) { // FIXME: We should be able to create fragments from files @@ -400,7 +446,7 @@ bool containsFilenames(const IDataObject*) // Convert a String containing CF_HTML formatted text to a DocumentFragment PassRefPtr<DocumentFragment> fragmentFromCFHTML(Document* doc, const String& cfhtml) -{ +{ // obtain baseURL if present String srcURLStr("sourceURL:"); String srcURL; @@ -413,38 +459,24 @@ PassRefPtr<DocumentFragment> fragmentFromCFHTML(Document* doc, const String& cfh srcURL = rawSrcURL.stripWhiteSpace(); } - // find the markup between "<!--StartFragment -->" and "<!--EndFragment -->", accounting for browser quirks - unsigned markupStart = cfhtml.find("<html", 0, false); - unsigned tagStart = cfhtml.find("startfragment", markupStart, false); - unsigned fragmentStart = cfhtml.find('>', tagStart) + 1; - unsigned tagEnd = cfhtml.find("endfragment", fragmentStart, false); - unsigned fragmentEnd = cfhtml.reverseFind('<', tagEnd); - String markup = cfhtml.substring(fragmentStart, fragmentEnd - fragmentStart).stripWhiteSpace(); - + String markup = extractMarkupFromCFHTML(cfhtml); return createFragmentFromMarkup(doc, markup, srcURL, FragmentScriptingNotAllowed); } - PassRefPtr<DocumentFragment> fragmentFromHTML(Document* doc, IDataObject* data) { if (!doc || !data) return 0; - STGMEDIUM store; - String html; - String srcURL; - if (SUCCEEDED(data->GetData(htmlFormat(), &store))) { - // MS HTML Format parsing - char* data = (char*)GlobalLock(store.hGlobal); - SIZE_T dataSize = ::GlobalSize(store.hGlobal); - String cfhtml(UTF8Encoding().decode(data, dataSize)); - GlobalUnlock(store.hGlobal); - ReleaseStgMedium(&store); + bool success = false; + String cfhtml = getFullCFHTML(data, success); + if (success) { if (PassRefPtr<DocumentFragment> fragment = fragmentFromCFHTML(doc, cfhtml)) return fragment; - } - bool success = false; - html = getTextHTML(data, success); + } + + String html = getTextHTML(data, success); + String srcURL; if (success) return createFragmentFromMarkup(doc, html, srcURL, FragmentScriptingNotAllowed); diff --git a/WebCore/platform/win/ClipboardUtilitiesWin.h b/WebCore/platform/win/ClipboardUtilitiesWin.h index 4ca46f9..fe01499 100644 --- a/WebCore/platform/win/ClipboardUtilitiesWin.h +++ b/WebCore/platform/win/ClipboardUtilitiesWin.h @@ -64,6 +64,7 @@ PassRefPtr<DocumentFragment> fragmentFromCFHTML(Document*, const String& cfhtml) String getURL(IDataObject*, DragData::FilenameConversionPolicy, bool& success, String* title = 0); String getPlainText(IDataObject*, bool& success); String getTextHTML(IDataObject*, bool& success); +String getCFHTML(IDataObject*, bool& success); } // namespace WebCore diff --git a/WebCore/platform/win/ClipboardWin.cpp b/WebCore/platform/win/ClipboardWin.cpp index 2cd6feb..6e026d6 100644 --- a/WebCore/platform/win/ClipboardWin.cpp +++ b/WebCore/platform/win/ClipboardWin.cpp @@ -70,7 +70,7 @@ static const char szShellDotUrlTemplate[] = "[InternetShortcut]\r\nURL=%s\r\n"; // We provide the IE clipboard types (URL and Text), and the clipboard types specified in the WHATWG Web Applications 1.0 draft // see http://www.whatwg.org/specs/web-apps/current-work/ Section 6.3.5.3 -enum ClipboardDataType { ClipboardDataTypeNone, ClipboardDataTypeURL, ClipboardDataTypeText }; +enum ClipboardDataType { ClipboardDataTypeNone, ClipboardDataTypeURL, ClipboardDataTypeText, ClipboardDataTypeTextHTML }; static ClipboardDataType clipboardTypeFromMIMEType(const String& type) { @@ -81,6 +81,8 @@ static ClipboardDataType clipboardTypeFromMIMEType(const String& type) return ClipboardDataTypeText; if (qType == "url" || qType == "text/uri-list") return ClipboardDataTypeURL; + if (qType == "text/html") + return ClipboardDataTypeTextHTML; return ClipboardDataTypeNone; } @@ -393,17 +395,24 @@ exit: return hr; } -ClipboardWin::ClipboardWin(bool isForDragging, IDataObject* dataObject, ClipboardAccessPolicy policy) +PassRefPtr<Clipboard> Clipboard::create(ClipboardAccessPolicy policy, DragData* dragData, Frame* frame) +{ + return ClipboardWin::create(true, dragData->platformData(), policy, frame); +} + +ClipboardWin::ClipboardWin(bool isForDragging, IDataObject* dataObject, ClipboardAccessPolicy policy, Frame* frame) : Clipboard(policy, isForDragging) , m_dataObject(dataObject) , m_writableDataObject(0) + , m_frame(frame) { } -ClipboardWin::ClipboardWin(bool isForDragging, WCDataObject* dataObject, ClipboardAccessPolicy policy) +ClipboardWin::ClipboardWin(bool isForDragging, WCDataObject* dataObject, ClipboardAccessPolicy policy, Frame* frame) : Clipboard(policy, isForDragging) , m_dataObject(dataObject) , m_writableDataObject(dataObject) + , m_frame(frame) { } @@ -498,6 +507,12 @@ String ClipboardWin::getData(const String& type, bool& success) const return getPlainText(m_dataObject.get(), success); if (dataType == ClipboardDataTypeURL) return getURL(m_dataObject.get(), DragData::DoNotConvertFilenames, success); + else if (dataType == ClipboardDataTypeTextHTML) { + String data = getTextHTML(m_dataObject.get(), success); + if (success) + return data; + return getCFHTML(m_dataObject.get(), success); + } return ""; } @@ -589,12 +604,13 @@ PassRefPtr<FileList> ClipboardWin::files() const if (!hdrop) return files.release(); + ScriptExecutionContext* scriptExecutionContext = m_frame->document()->scriptExecutionContext(); WCHAR filename[MAX_PATH]; UINT fileCount = DragQueryFileW(hdrop, 0xFFFFFFFF, 0, 0); for (UINT i = 0; i < fileCount; i++) { if (!DragQueryFileW(hdrop, i, filename, ARRAYSIZE(filename))) continue; - files->append(File::create(reinterpret_cast<UChar*>(filename))); + files->append(File::create(scriptExecutionContext, reinterpret_cast<UChar*>(filename))); } GlobalUnlock(medium.hGlobal); diff --git a/WebCore/platform/win/ClipboardWin.h b/WebCore/platform/win/ClipboardWin.h index 1b139ed..6a08087 100644 --- a/WebCore/platform/win/ClipboardWin.h +++ b/WebCore/platform/win/ClipboardWin.h @@ -35,19 +35,20 @@ struct IDataObject; namespace WebCore { class CachedImage; +class Frame; class IntPoint; class WCDataObject; // State available during IE's events for drag and drop and copy/paste class ClipboardWin : public Clipboard, public CachedResourceClient { public: - static PassRefPtr<ClipboardWin> create(bool isForDragging, IDataObject* dataObject, ClipboardAccessPolicy policy) + static PassRefPtr<ClipboardWin> create(bool isForDragging, IDataObject* dataObject, ClipboardAccessPolicy policy, Frame* frame) { - return adoptRef(new ClipboardWin(isForDragging, dataObject, policy)); + return adoptRef(new ClipboardWin(isForDragging, dataObject, policy, frame)); } - static PassRefPtr<ClipboardWin> create(bool isForDragging, WCDataObject* dataObject, ClipboardAccessPolicy policy) + static PassRefPtr<ClipboardWin> create(bool isForDragging, WCDataObject* dataObject, ClipboardAccessPolicy policy, Frame* frame) { - return adoptRef(new ClipboardWin(isForDragging, dataObject, policy)); + return adoptRef(new ClipboardWin(isForDragging, dataObject, policy, frame)); } ~ClipboardWin(); @@ -76,8 +77,8 @@ public: void setExternalDataObject(IDataObject *dataObject); private: - ClipboardWin(bool isForDragging, IDataObject*, ClipboardAccessPolicy); - ClipboardWin(bool isForDragging, WCDataObject*, ClipboardAccessPolicy); + ClipboardWin(bool isForDragging, IDataObject*, ClipboardAccessPolicy, Frame*); + ClipboardWin(bool isForDragging, WCDataObject*, ClipboardAccessPolicy, Frame*); void resetFromClipboard(); void setDragImage(CachedImage*, Node*, const IntPoint&); diff --git a/WebCore/platform/win/DragDataWin.cpp b/WebCore/platform/win/DragDataWin.cpp index 82e537e..05f9103 100644 --- a/WebCore/platform/win/DragDataWin.cpp +++ b/WebCore/platform/win/DragDataWin.cpp @@ -26,9 +26,7 @@ #include "config.h" #include "DragData.h" -#include "ClipboardWin.h" #include "ClipboardUtilitiesWin.h" -#include "ClipboardAccessPolicy.h" #include "DocumentFragment.h" #include "PlatformString.h" #include "Markup.h" @@ -39,11 +37,6 @@ namespace WebCore { -PassRefPtr<Clipboard> DragData::createClipboard(ClipboardAccessPolicy policy) const -{ - return ClipboardWin::create(true, m_platformDragData, policy); -} - bool DragData::containsURL(FilenameConversionPolicy filenamePolicy) const { return SUCCEEDED(m_platformDragData->QueryGetData(urlWFormat())) diff --git a/WebCore/platform/win/EditorWin.cpp b/WebCore/platform/win/EditorWin.cpp index 09abdbd..075827d 100644 --- a/WebCore/platform/win/EditorWin.cpp +++ b/WebCore/platform/win/EditorWin.cpp @@ -30,6 +30,7 @@ #include "ClipboardWin.h" #include "Document.h" #include "Element.h" +#include "Frame.h" #include "htmlediting.h" #include "TextIterator.h" #include "visible_units.h" @@ -38,13 +39,13 @@ namespace WebCore { -PassRefPtr<Clipboard> Editor::newGeneralClipboard(ClipboardAccessPolicy policy) +PassRefPtr<Clipboard> Editor::newGeneralClipboard(ClipboardAccessPolicy policy, Frame* frame) { COMPtr<IDataObject> clipboardData; if (!SUCCEEDED(OleGetClipboard(&clipboardData))) clipboardData = 0; - return ClipboardWin::create(false, clipboardData.get(), policy); + return ClipboardWin::create(false, clipboardData.get(), policy, frame); } } // namespace WebCore diff --git a/WebCore/platform/win/PasteboardWin.cpp b/WebCore/platform/win/PasteboardWin.cpp index 808c863..03ecd36 100644 --- a/WebCore/platform/win/PasteboardWin.cpp +++ b/WebCore/platform/win/PasteboardWin.cpp @@ -52,7 +52,6 @@ static UINT WebSmartPasteFormat = 0; static LRESULT CALLBACK PasteboardOwnerWndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam) { LRESULT lresult = 0; - LONG_PTR longPtr = GetWindowLongPtr(hWnd, 0); switch (message) { case WM_RENDERFORMAT: @@ -64,12 +63,14 @@ static LRESULT CALLBACK PasteboardOwnerWndProc(HWND hWnd, UINT message, WPARAM w // and now this application is about to quit, so it must put data on // the clipboard before it exits. break; - case WM_DRAWCLIPBOARD: - break; case WM_DESTROY: break; +#if !OS(WINCE) + case WM_DRAWCLIPBOARD: + break; case WM_CHANGECBCHAIN: break; +#endif default: lresult = DefWindowProc(hWnd, message, wParam, lParam); break; @@ -84,17 +85,21 @@ Pasteboard* Pasteboard::generalPasteboard() } Pasteboard::Pasteboard() -{ - // make a dummy HWND to be the Windows clipboard's owner - WNDCLASSEX wcex = {0}; - wcex.cbSize = sizeof(WNDCLASSEX); - wcex.lpfnWndProc = PasteboardOwnerWndProc; - wcex.hInstance = WebCore::instanceHandle(); - wcex.lpszClassName = L"PasteboardOwnerWindowClass"; - ::RegisterClassEx(&wcex); +{ + HWND hWndParent = 0; +#if !OS(WINCE) + hWndParent = HWND_MESSAGE; +#endif + + WNDCLASS wc; + memset(&wc, 0, sizeof(WNDCLASS)); + wc.lpfnWndProc = PasteboardOwnerWndProc; + wc.hInstance = WebCore::instanceHandle(); + wc.lpszClassName = L"PasteboardOwnerWindowClass"; + RegisterClass(&wc); m_owner = ::CreateWindow(L"PasteboardOwnerWindowClass", L"PasteboardOwnerWindow", 0, 0, 0, 0, 0, - HWND_MESSAGE, 0, 0, 0); + hWndParent, 0, 0, 0); HTMLClipboardFormat = ::RegisterClipboardFormat(L"HTML Format"); BookmarkClipboardFormat = ::RegisterClipboardFormat(L"UniformResourceLocatorW"); @@ -216,31 +221,34 @@ void Pasteboard::writeImage(Node* node, const KURL&, const String&) HDC dc = GetDC(0); HDC compatibleDC = CreateCompatibleDC(0); HDC sourceDC = CreateCompatibleDC(0); - HBITMAP resultBitmap = CreateCompatibleBitmap(dc, image->width(), image->height()); - HBITMAP oldBitmap = (HBITMAP)SelectObject(compatibleDC, resultBitmap); + OwnPtr<HBITMAP> resultBitmap(CreateCompatibleBitmap(dc, image->width(), image->height())); + HGDIOBJ oldBitmap = SelectObject(compatibleDC, resultBitmap.get()); BitmapInfo bmInfo = BitmapInfo::create(image->size()); HBITMAP coreBitmap = CreateDIBSection(dc, &bmInfo, DIB_RGB_COLORS, 0, 0, 0); - HBITMAP oldSource = (HBITMAP)SelectObject(sourceDC, coreBitmap); + HGDIOBJ oldSource = SelectObject(sourceDC, coreBitmap); image->getHBITMAP(coreBitmap); +#if !defined(NO_ALPHABLEND) BLENDFUNCTION bf = {AC_SRC_OVER, 0, 255, AC_SRC_ALPHA}; AlphaBlend(compatibleDC, 0, 0, image->width(), image->height(), sourceDC, 0, 0, image->width(), image->height(), bf); +#else + StretchBlt(compatibleDC, 0, 0, image->width(), image->height(), + sourceDC, 0, 0, image->width(), image->height(), SRCCOPY); +#endif - SelectObject(compatibleDC, oldBitmap); SelectObject(sourceDC, oldSource); - - DeleteObject(oldBitmap); - DeleteObject(oldSource); DeleteObject(coreBitmap); - ReleaseDC(0, dc); - DeleteDC(compatibleDC); + + SelectObject(compatibleDC, oldBitmap); DeleteDC(sourceDC); + DeleteDC(compatibleDC); + ReleaseDC(0, dc); if (::OpenClipboard(m_owner)) { - ::SetClipboardData(CF_BITMAP, resultBitmap); + ::SetClipboardData(CF_BITMAP, resultBitmap.leakPtr()); ::CloseClipboard(); } } @@ -255,9 +263,9 @@ String Pasteboard::plainText(Frame* frame) if (::IsClipboardFormatAvailable(CF_UNICODETEXT) && ::OpenClipboard(m_owner)) { HANDLE cbData = ::GetClipboardData(CF_UNICODETEXT); if (cbData) { - UChar* buffer = (UChar*)::GlobalLock(cbData); + UChar* buffer = static_cast<UChar*>(GlobalLock(cbData)); String fromClipboard(buffer); - ::GlobalUnlock(cbData); + GlobalUnlock(cbData); ::CloseClipboard(); return fromClipboard; } @@ -267,9 +275,9 @@ String Pasteboard::plainText(Frame* frame) if (::IsClipboardFormatAvailable(CF_TEXT) && ::OpenClipboard(m_owner)) { HANDLE cbData = ::GetClipboardData(CF_TEXT); if (cbData) { - char* buffer = (char*)::GlobalLock(cbData); + char* buffer = static_cast<char*>(GlobalLock(cbData)); String fromClipboard(buffer); - ::GlobalUnlock(cbData); + GlobalUnlock(cbData); ::CloseClipboard(); return fromClipboard; } @@ -288,8 +296,8 @@ PassRefPtr<DocumentFragment> Pasteboard::documentFragment(Frame* frame, PassRefP HANDLE cbData = ::GetClipboardData(HTMLClipboardFormat); if (cbData) { SIZE_T dataSize = ::GlobalSize(cbData); - String cfhtml(UTF8Encoding().decode((char*)::GlobalLock(cbData), dataSize)); - ::GlobalUnlock(cbData); + String cfhtml(UTF8Encoding().decode(static_cast<char*>(GlobalLock(cbData)), dataSize)); + GlobalUnlock(cbData); ::CloseClipboard(); PassRefPtr<DocumentFragment> fragment = fragmentFromCFHTML(frame->document(), cfhtml); @@ -304,9 +312,9 @@ PassRefPtr<DocumentFragment> Pasteboard::documentFragment(Frame* frame, PassRefP if (::OpenClipboard(m_owner)) { HANDLE cbData = ::GetClipboardData(CF_UNICODETEXT); if (cbData) { - UChar* buffer = (UChar*)GlobalLock(cbData); + UChar* buffer = static_cast<UChar*>(GlobalLock(cbData)); String str(buffer); - ::GlobalUnlock(cbData); + GlobalUnlock(cbData); ::CloseClipboard(); RefPtr<DocumentFragment> fragment = createFragmentFromText(context.get(), str); if (fragment) @@ -321,9 +329,9 @@ PassRefPtr<DocumentFragment> Pasteboard::documentFragment(Frame* frame, PassRefP if (::OpenClipboard(m_owner)) { HANDLE cbData = ::GetClipboardData(CF_TEXT); if (cbData) { - char* buffer = (char*)GlobalLock(cbData); + char* buffer = static_cast<char*>(GlobalLock(cbData)); String str(buffer); - ::GlobalUnlock(cbData); + GlobalUnlock(cbData); ::CloseClipboard(); RefPtr<DocumentFragment> fragment = createFragmentFromText(context.get(), str); if (fragment) diff --git a/WebCore/platform/win/PlatformScrollBarWin.cpp b/WebCore/platform/win/PlatformScrollBarWin.cpp deleted file mode 100644 index aa5333b..0000000 --- a/WebCore/platform/win/PlatformScrollBarWin.cpp +++ /dev/null @@ -1,43 +0,0 @@ -/* - * Copyright (C) 2007, 2008 Apple Inc. All rights reserved. - * Copyright (C) 2008 Brent Fulgham - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY - * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#include "config.h" -#include "PlatformScrollBar.h" - -#include "FrameView.h" -#include "ScrollbarClient.h" -#include "ScrollbarTheme.h" - -namespace WebCore { - -PlatformScrollbar::PlatformScrollbar(ScrollbarClient* client, ScrollbarOrientation orientation, ScrollbarControlSize size, - ScrollbarTheme* theme) - : Scrollbar(client, orientation, size, theme) -{ -} - -} - diff --git a/WebCore/platform/win/PopupMenuWin.cpp b/WebCore/platform/win/PopupMenuWin.cpp index 44141f2..4bc6dc7 100644 --- a/WebCore/platform/win/PopupMenuWin.cpp +++ b/WebCore/platform/win/PopupMenuWin.cpp @@ -199,6 +199,7 @@ void PopupMenu::show(const IntRect& r, FrameView* view, int index) break; // Steal mouse messages. +#if !OS(WINCE) case WM_NCMOUSEMOVE: case WM_NCLBUTTONDOWN: case WM_NCLBUTTONUP: @@ -209,6 +210,7 @@ void PopupMenu::show(const IntRect& r, FrameView* view, int index) case WM_NCMBUTTONDOWN: case WM_NCMBUTTONUP: case WM_NCMBUTTONDBLCLK: +#endif case WM_MOUSEWHEEL: msg.hwnd = m_popup; break; @@ -578,7 +580,7 @@ void PopupMenu::paint(const IntRect& damageRect, HDC hdc) } if (!m_bmp) { #if OS(WINCE) - BitmapInfo bitmapInfo(true, clientRect().width(), clientRect().height()); + BitmapInfo bitmapInfo = BitmapInfo::createBottomUp(clientRect().size(), 16); #else BitmapInfo bitmapInfo = BitmapInfo::createBottomUp(clientRect().size()); #endif @@ -774,9 +776,10 @@ LRESULT PopupMenu::wndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam LRESULT lResult = 0; switch (message) { +#if !OS(WINCE) case WM_MOUSEACTIVATE: return MA_NOACTIVATE; - +#endif case WM_SIZE: { if (!scrollbar()) break; diff --git a/WebCore/platform/wince/DragDataWince.cpp b/WebCore/platform/wince/DragDataWince.cpp index 5f2a7ba..73dd8a2 100644 --- a/WebCore/platform/wince/DragDataWince.cpp +++ b/WebCore/platform/wince/DragDataWince.cpp @@ -21,17 +21,11 @@ #include "config.h" #include "DragData.h" -#include "Clipboard.h" #include "DocumentFragment.h" #include "PlatformString.h" namespace WebCore { -PassRefPtr<Clipboard> DragData::createClipboard(ClipboardAccessPolicy policy) const -{ - return 0; -} - bool DragData::containsURL(FilenameConversionPolicy filenamePolicy) const { return false; diff --git a/WebCore/platform/wince/EditorWince.cpp b/WebCore/platform/wince/EditorWince.cpp index 02af780..71f4db9 100644 --- a/WebCore/platform/wince/EditorWince.cpp +++ b/WebCore/platform/wince/EditorWince.cpp @@ -35,7 +35,7 @@ namespace WebCore { -PassRefPtr<Clipboard> Editor::newGeneralClipboard(ClipboardAccessPolicy policy) +PassRefPtr<Clipboard> Editor::newGeneralClipboard(ClipboardAccessPolicy policy, Frame*) { return adoptRef(new ClipboardWince(policy, false)); } diff --git a/WebCore/platform/wx/ClipboardWx.cpp b/WebCore/platform/wx/ClipboardWx.cpp index 6100831..25bef55 100644 --- a/WebCore/platform/wx/ClipboardWx.cpp +++ b/WebCore/platform/wx/ClipboardWx.cpp @@ -37,6 +37,11 @@ namespace WebCore { +PassRefPtr<Clipboard> Clipboard::create(ClipboardAccessPolicy, DragData*, Frame*) +{ + return 0; +} + ClipboardWx::ClipboardWx(ClipboardAccessPolicy policy, bool forDragging) : Clipboard(policy, forDragging) { diff --git a/WebCore/platform/wx/DragDataWx.cpp b/WebCore/platform/wx/DragDataWx.cpp index 278f123..35e3753 100644 --- a/WebCore/platform/wx/DragDataWx.cpp +++ b/WebCore/platform/wx/DragDataWx.cpp @@ -26,7 +26,6 @@ #include "config.h" #include "DragData.h" -#include "Clipboard.h" #include "Document.h" #include "DocumentFragment.h" @@ -66,11 +65,6 @@ Color DragData::asColor() const return Color(); } -PassRefPtr<Clipboard> DragData::createClipboard(ClipboardAccessPolicy) const -{ - return 0; -} - bool DragData::containsCompatibleContent() const { return false; diff --git a/WebCore/platform/wx/MouseEventWx.cpp b/WebCore/platform/wx/MouseEventWx.cpp index 4f39598..8591ef5 100644 --- a/WebCore/platform/wx/MouseEventWx.cpp +++ b/WebCore/platform/wx/MouseEventWx.cpp @@ -37,7 +37,7 @@ PlatformMouseEvent::PlatformMouseEvent(const wxMouseEvent& event, const wxPoint& : m_position(event.GetPosition()) , m_globalPosition(globalPoint) , m_shiftKey(event.ShiftDown()) - , m_ctrlKey(event.CmdDown()) + , m_ctrlKey(event.CmdDown() || event.ControlDown()) , m_altKey(event.AltDown()) , m_metaKey(event.MetaDown()) // FIXME: We'll have to test other browsers { diff --git a/WebCore/plugins/PluginViewBase.h b/WebCore/plugins/PluginViewBase.h index 9d3f463..3c43c00 100644 --- a/WebCore/plugins/PluginViewBase.h +++ b/WebCore/plugins/PluginViewBase.h @@ -28,6 +28,12 @@ #include "Widget.h" #include "GraphicsLayer.h" +namespace JSC { + class ExecState; + class JSGlobalObject; + class JSObject; +} + namespace WebCore { // PluginViewBase is a widget that all plug-in views inherit from, both in Webkit and WebKit2. @@ -38,6 +44,8 @@ public: virtual PlatformLayer* platformLayer() const { return 0; } #endif + virtual JSC::JSObject* scriptObject(JSC::ExecState*, JSC::JSGlobalObject*) { return 0; } + protected: PluginViewBase(PlatformWidget widget) : Widget(widget) { } diff --git a/WebCore/plugins/win/PluginDatabaseWin.cpp b/WebCore/plugins/win/PluginDatabaseWin.cpp index 71bcdb5..5d86117 100644 --- a/WebCore/plugins/win/PluginDatabaseWin.cpp +++ b/WebCore/plugins/win/PluginDatabaseWin.cpp @@ -40,7 +40,9 @@ #if OS(WINCE) // WINCE doesn't support Registry Key Access Rights. The parameter should always be 0 +#ifndef KEY_ENUMERATE_SUB_KEYS #define KEY_ENUMERATE_SUB_KEYS 0 +#endif DWORD SHGetValue(HKEY hkey, LPCWSTR pszSubKey, LPCWSTR pszValue, LPDWORD pdwType, LPVOID pvData, LPDWORD pcbData) { diff --git a/WebCore/rendering/AutoTableLayout.cpp b/WebCore/rendering/AutoTableLayout.cpp index 1633d88..ea8b416 100644 --- a/WebCore/rendering/AutoTableLayout.cpp +++ b/WebCore/rendering/AutoTableLayout.cpp @@ -66,9 +66,9 @@ void AutoTableLayout::recalcColumn(int effCol) int numRows = section->numRows(); for (int i = 0; i < numRows; i++) { RenderTableSection::CellStruct current = section->cellAt(i, effCol); - RenderTableCell* cell = current.cell; + RenderTableCell* cell = current.primaryCell(); - bool cellHasContent = cell && (cell->firstChild() || cell->style()->hasBorder() || cell->style()->hasPadding()); + bool cellHasContent = cell && !current.inColSpan && (cell->firstChild() || cell->style()->hasBorder() || cell->style()->hasPadding()); if (cellHasContent) l.emptyCellsOnly = false; @@ -125,7 +125,7 @@ void AutoTableLayout::recalcColumn(int effCol) break; } } else { - if (cell && (!effCol || section->cellAt(i, effCol-1).cell != cell)) { + if (cell && (!effCol || section->primaryCellAt(i, effCol-1) != cell)) { // This spanning cell originates in this column. Ensure we have // a min/max width of at least 1px for this column now. l.minWidth = max(l.minWidth, cellHasContent ? 1 : 0); diff --git a/WebCore/rendering/HitTestRequest.h b/WebCore/rendering/HitTestRequest.h index 97d8680..745791a 100644 --- a/WebCore/rendering/HitTestRequest.h +++ b/WebCore/rendering/HitTestRequest.h @@ -35,7 +35,9 @@ public: SVGClipContent = 1 << 6 }; - HitTestRequest(int requestType) + typedef unsigned HitTestRequestType; + + HitTestRequest(HitTestRequestType requestType) : m_requestType(requestType) { } @@ -48,7 +50,7 @@ public: bool svgClipContent() const { return m_requestType & SVGClipContent; } private: - int m_requestType; + HitTestRequestType m_requestType; }; } // namespace WebCore diff --git a/WebCore/rendering/RenderBoxModelObject.cpp b/WebCore/rendering/RenderBoxModelObject.cpp index 077baeb..4ddd66b 100644 --- a/WebCore/rendering/RenderBoxModelObject.cpp +++ b/WebCore/rendering/RenderBoxModelObject.cpp @@ -1008,13 +1008,18 @@ void RenderBoxModelObject::paintBorder(GraphicsContext* graphicsContext, int tx, graphicsContext->addPath(roundedPath); } + bool upperLeftBorderStylesMatch = renderLeft && (topStyle == leftStyle) && (topColor == leftColor); + bool upperRightBorderStylesMatch = renderRight && (topStyle == rightStyle) && (topColor == rightColor) && (topStyle != OUTSET) && (topStyle != RIDGE) && (topStyle != INSET) && (topStyle != GROOVE); + bool lowerLeftBorderStylesMatch = renderLeft && (bottomStyle == leftStyle) && (bottomColor == leftColor) && (bottomStyle != OUTSET) && (bottomStyle != RIDGE) && (bottomStyle != INSET) && (bottomStyle != GROOVE); + bool lowerRightBorderStylesMatch = renderRight && (bottomStyle == rightStyle) && (bottomColor == rightColor); + if (renderTop) { int x = tx; int x2 = tx + w; if (renderRadii && borderWillArcInnerEdge(topLeft, topRight, style->borderLeftWidth(), style->borderRightWidth(), style->borderTopWidth())) { graphicsContext->save(); - clipBorderSidePolygon(graphicsContext, borderRect, topLeft, topRight, bottomLeft, bottomRight, BSTop, style); + clipBorderSidePolygon(graphicsContext, borderRect, topLeft, topRight, bottomLeft, bottomRight, BSTop, upperLeftBorderStylesMatch, upperRightBorderStylesMatch, style); float thickness = max(max(style->borderTopWidth(), style->borderLeftWidth()), style->borderRightWidth()); drawBoxSideFromPath(graphicsContext, borderRect, roundedPath, style->borderTopWidth(), thickness, BSTop, style, topColor, topStyle); graphicsContext->restore(); @@ -1035,7 +1040,7 @@ void RenderBoxModelObject::paintBorder(GraphicsContext* graphicsContext, int tx, if (renderRadii && borderWillArcInnerEdge(bottomLeft, bottomRight, style->borderLeftWidth(), style->borderRightWidth(), style->borderBottomWidth())) { graphicsContext->save(); - clipBorderSidePolygon(graphicsContext, borderRect, topLeft, topRight, bottomLeft, bottomRight, BSBottom, style); + clipBorderSidePolygon(graphicsContext, borderRect, topLeft, topRight, bottomLeft, bottomRight, BSBottom, lowerLeftBorderStylesMatch, lowerRightBorderStylesMatch, style); float thickness = max(max(style->borderBottomWidth(), style->borderLeftWidth()), style->borderRightWidth()); drawBoxSideFromPath(graphicsContext, borderRect, roundedPath, style->borderBottomWidth(), thickness, BSBottom, style, bottomColor, bottomStyle); graphicsContext->restore(); @@ -1058,7 +1063,7 @@ void RenderBoxModelObject::paintBorder(GraphicsContext* graphicsContext, int tx, if (renderRadii && borderWillArcInnerEdge(bottomLeft, topLeft, style->borderBottomWidth(), style->borderTopWidth(), style->borderLeftWidth())) { graphicsContext->save(); - clipBorderSidePolygon(graphicsContext, borderRect, topLeft, topRight, bottomLeft, bottomRight, BSLeft, style); + clipBorderSidePolygon(graphicsContext, borderRect, topLeft, topRight, bottomLeft, bottomRight, BSLeft, upperLeftBorderStylesMatch, lowerLeftBorderStylesMatch, style); float thickness = max(max(style->borderLeftWidth(), style->borderTopWidth()), style->borderBottomWidth()); drawBoxSideFromPath(graphicsContext, borderRect, roundedPath, style->borderLeftWidth(), thickness, BSLeft, style, leftColor, leftStyle); graphicsContext->restore(); @@ -1077,7 +1082,7 @@ void RenderBoxModelObject::paintBorder(GraphicsContext* graphicsContext, int tx, if (renderRight) { if (renderRadii && borderWillArcInnerEdge(bottomRight, topRight, style->borderBottomWidth(), style->borderTopWidth(), style->borderRightWidth())) { graphicsContext->save(); - clipBorderSidePolygon(graphicsContext, borderRect, topLeft, topRight, bottomLeft, bottomRight, BSRight, style); + clipBorderSidePolygon(graphicsContext, borderRect, topLeft, topRight, bottomLeft, bottomRight, BSRight, upperRightBorderStylesMatch, lowerRightBorderStylesMatch, style); float thickness = max(max(style->borderRightWidth(), style->borderTopWidth()), style->borderBottomWidth()); drawBoxSideFromPath(graphicsContext, borderRect, roundedPath, style->borderRightWidth(), thickness, BSRight, style, rightColor, rightStyle); graphicsContext->restore(); @@ -1455,7 +1460,7 @@ void RenderBoxModelObject::paintBorder(GraphicsContext* graphicsContext, int tx, } #endif -void RenderBoxModelObject::clipBorderSidePolygon(GraphicsContext* graphicsContext, const IntRect& box, const IntSize& topLeft, const IntSize& topRight, const IntSize& bottomLeft, const IntSize& bottomRight, const BoxSide side, const RenderStyle* style) +void RenderBoxModelObject::clipBorderSidePolygon(GraphicsContext* graphicsContext, const IntRect& box, const IntSize& topLeft, const IntSize& topRight, const IntSize& bottomLeft, const IntSize& bottomRight, const BoxSide side, bool firstEdgeMatches, bool secondEdgeMatches, const RenderStyle* style) { FloatPoint quad[4]; int tx = box.x(); @@ -1510,7 +1515,28 @@ void RenderBoxModelObject::clipBorderSidePolygon(GraphicsContext* graphicsContex break; } - graphicsContext->clipConvexPolygon(4, quad); + // If the border matches both of its adjacent sides, don't anti-alias the clip, and + // if neither side matches, anti-alias the clip. + if (firstEdgeMatches == secondEdgeMatches) { + graphicsContext->clipConvexPolygon(4, quad, !firstEdgeMatches); + return; + } + + FloatPoint firstQuad[4]; + firstQuad[0] = quad[0]; + firstQuad[1] = quad[1]; + firstQuad[2] = side == BSTop || side == BSBottom ? FloatPoint(quad[3].x(), quad[2].y()) + : firstQuad[2] = FloatPoint(quad[2].x(), quad[3].y()); + firstQuad[3] = quad[3]; + graphicsContext->clipConvexPolygon(4, firstQuad, !firstEdgeMatches); + + FloatPoint secondQuad[4]; + secondQuad[0] = quad[0]; + secondQuad[1] = side == BSTop || side == BSBottom ? FloatPoint(quad[0].x(), quad[1].y()) + : FloatPoint(quad[1].x(), quad[0].y()); + secondQuad[2] = quad[2]; + secondQuad[3] = quad[3]; + graphicsContext->clipConvexPolygon(4, secondQuad, !secondEdgeMatches); } void RenderBoxModelObject::paintBoxShadow(GraphicsContext* context, int tx, int ty, int w, int h, const RenderStyle* s, ShadowStyle shadowStyle, bool begin, bool end) diff --git a/WebCore/rendering/RenderBoxModelObject.h b/WebCore/rendering/RenderBoxModelObject.h index 45602f0..49d5f3d 100644 --- a/WebCore/rendering/RenderBoxModelObject.h +++ b/WebCore/rendering/RenderBoxModelObject.h @@ -115,7 +115,7 @@ private: IntSize calculateFillTileSize(const FillLayer*, IntSize scaledSize) const; - void clipBorderSidePolygon(GraphicsContext*, const IntRect&, const IntSize& topLeft, const IntSize& topRight, const IntSize& bottomLeft, const IntSize& bottomRight, const BoxSide side, const RenderStyle* style); + void clipBorderSidePolygon(GraphicsContext*, const IntRect&, const IntSize& topLeft, const IntSize& topRight, const IntSize& bottomLeft, const IntSize& bottomRight, const BoxSide side, bool firstEdgeMatches, bool secondEdgeMatches, const RenderStyle* style); friend class RenderView; diff --git a/WebCore/rendering/RenderInline.h b/WebCore/rendering/RenderInline.h index a719a50..71a8a89 100644 --- a/WebCore/rendering/RenderInline.h +++ b/WebCore/rendering/RenderInline.h @@ -74,6 +74,9 @@ public: int verticalPositionFromCache(bool firstLine) const; void invalidateVerticalPosition() { m_verticalPosition = PositionUndefined; } +protected: + virtual void styleDidChange(StyleDifference, const RenderStyle* oldStyle); + private: virtual RenderObjectChildList* virtualChildren() { return children(); } virtual const RenderObjectChildList* virtualChildren() const { return children(); } @@ -139,7 +142,6 @@ private: virtual void addDashboardRegions(Vector<DashboardRegionValue>&); #endif - virtual void styleDidChange(StyleDifference, const RenderStyle* oldStyle); virtual void updateBoxModelInfoFromStyle(); static RenderInline* cloneInline(RenderInline* src); diff --git a/WebCore/rendering/RenderLayer.cpp b/WebCore/rendering/RenderLayer.cpp index 368a1a7..756a9b3 100644 --- a/WebCore/rendering/RenderLayer.cpp +++ b/WebCore/rendering/RenderLayer.cpp @@ -1447,7 +1447,7 @@ void RenderLayer::scrollRectToVisible(const IntRect& rect, bool scrollToAnchor, newRect.setX(rect.x() - frameView->scrollX() + frameView->x()); newRect.setY(rect.y() - frameView->scrollY() + frameView->y()); } else { - IntRect viewRect = frameView->visibleContentRect(true); + IntRect viewRect = frameView->visibleContentRect(); IntRect r = getRectToExpose(viewRect, rect, alignX, alignY); frameView->setScrollPosition(r.location()); diff --git a/WebCore/rendering/RenderLayerBacking.cpp b/WebCore/rendering/RenderLayerBacking.cpp index 2bc6a88..d66dfc2 100644 --- a/WebCore/rendering/RenderLayerBacking.cpp +++ b/WebCore/rendering/RenderLayerBacking.cpp @@ -144,19 +144,14 @@ static bool hasNonZeroTransformOrigin(const RenderObject* renderer) || (style->transformOriginY().type() == Fixed && style->transformOriginY().value()); } -static RenderLayer* enclosingOverflowClipAncestor(RenderLayer* layer, bool& crossesTransform) +static bool layerOrAncestorIsTransformed(RenderLayer* layer) { - crossesTransform = false; - - for (RenderLayer* curr = layer->parent(); curr; curr = curr->parent()) { - if (curr->renderer()->hasOverflowClip()) - return curr; - + for (RenderLayer* curr = layer; curr; curr = curr->parent()) { if (curr->hasTransform()) - crossesTransform = true; + return true; } - return 0; + return false; } void RenderLayerBacking::updateCompositedBounds() @@ -164,38 +159,24 @@ void RenderLayerBacking::updateCompositedBounds() IntRect layerBounds = compositor()->calculateCompositedBounds(m_owningLayer, m_owningLayer); // Clip to the size of the document or enclosing overflow-scroll layer. - if (compositor()->compositingConsultsOverlap() && !m_owningLayer->hasTransform()) { - bool crossesTransform; - RenderLayer* overflowAncestor = enclosingOverflowClipAncestor(m_owningLayer, crossesTransform); - // If an ancestor is transformed, we can't currently compute the correct rect to intersect with. - // We'd need RenderObject::convertContainerToLocalQuad(), which doesn't yet exist. - if (!crossesTransform) { - IntRect clippingBounds; - RenderLayer* boundsRelativeLayer; - - if (overflowAncestor) { - RenderBox* overflowBox = toRenderBox(overflowAncestor->renderer()); - // If scrollbars are visible, then constrain the layer to the scrollable area, so we can avoid redraws - // on scrolling. Otherwise just clip to the visible area (it can still be scrolled via JS, but we'll come - // back through this code when the scroll offset changes). - if (overflowBox->scrollsOverflow()) - clippingBounds = IntRect(-overflowAncestor->scrollXOffset(), -overflowAncestor->scrollYOffset(), overflowBox->scrollWidth(), overflowBox->scrollHeight()); - else - clippingBounds = clipBox(overflowBox); - - boundsRelativeLayer = overflowAncestor; - } else { - RenderView* view = m_owningLayer->renderer()->view(); - clippingBounds = view->layoutOverflowRect(); - boundsRelativeLayer = view->layer(); - } - - int deltaX = 0; - int deltaY = 0; - m_owningLayer->convertToLayerCoords(boundsRelativeLayer, deltaX, deltaY); - clippingBounds.move(-deltaX, -deltaY); - layerBounds.intersect(clippingBounds); - } + // If this or an ancestor is transformed, we can't currently compute the correct rect to intersect with. + // We'd need RenderObject::convertContainerToLocalQuad(), which doesn't yet exist. + if (compositor()->compositingConsultsOverlap() && !layerOrAncestorIsTransformed(m_owningLayer)) { + RenderView* view = m_owningLayer->renderer()->view(); + RenderLayer* rootLayer = view->layer(); + + // Start by clipping to the view's bounds. + IntRect clippingBounds = view->layoutOverflowRect(); + + if (m_owningLayer != rootLayer) + clippingBounds.intersect(m_owningLayer->backgroundClipRect(rootLayer, true)); + + int deltaX = 0; + int deltaY = 0; + m_owningLayer->convertToLayerCoords(rootLayer, deltaX, deltaY); + clippingBounds.move(-deltaX, -deltaY); + + layerBounds.intersect(clippingBounds); } // If the element has a transform-origin that has fixed lengths, and the renderer has zero size, @@ -215,7 +196,7 @@ void RenderLayerBacking::updateAfterWidgetResize() { if (renderer()->isRenderIFrame()) { if (RenderLayerCompositor* innerCompositor = RenderLayerCompositor::iframeContentsCompositor(toRenderIFrame(renderer()))) - innerCompositor->updateContentLayerOffset(contentsBox().location()); + innerCompositor->frameViewDidChangeSize(contentsBox().location()); } } diff --git a/WebCore/rendering/RenderLayerCompositor.cpp b/WebCore/rendering/RenderLayerCompositor.cpp index f6e1442..3d16864 100644 --- a/WebCore/rendering/RenderLayerCompositor.cpp +++ b/WebCore/rendering/RenderLayerCompositor.cpp @@ -826,7 +826,7 @@ void RenderLayerCompositor::rebuildCompositingLayerTree(RenderLayer* layer, cons } } -void RenderLayerCompositor::updateContentLayerOffset(const IntPoint& contentsOffset) +void RenderLayerCompositor::frameViewDidChangeSize(const IntPoint& contentsOffset) { if (m_clipLayer) { FrameView* frameView = m_renderView->frameView(); @@ -838,7 +838,7 @@ void RenderLayerCompositor::updateContentLayerOffset(const IntPoint& contentsOff } } -void RenderLayerCompositor::updateContentLayerScrollPosition(const IntPoint& scrollPosition) +void RenderLayerCompositor::frameViewDidScroll(const IntPoint& scrollPosition) { if (m_scrollLayer) m_scrollLayer->setPosition(FloatPoint(-scrollPosition.x(), -scrollPosition.y())); @@ -1082,6 +1082,10 @@ bool RenderLayerCompositor::shouldPropagateCompositingToEnclosingIFrame() const // On non-Mac platforms, let compositing propagate for all iframes. return true; #else + // If we're viewless (i.e. WebKit2), we always propagate compositing. + if (!m_renderView->frameView()->platformWidget()) + return true; + // On Mac, only propagate compositing if the iframe is overlapped in the parent // document, or the parent is already compositing. RenderIFrame* iframeRenderer = toRenderIFrame(renderer); @@ -1345,6 +1349,20 @@ bool RenderLayerCompositor::needsContentsCompositingLayer(const RenderLayer* lay return (layer->m_negZOrderList && layer->m_negZOrderList->size() > 0); } +bool RenderLayerCompositor::requiresScrollLayer(RootLayerAttachment attachment) const +{ + if (attachment == RootLayerAttachedViaEnclosingIframe) + return true; + +#if PLATFORM(MAC) + // If we're viewless (i.e. WebKit2), we need to scroll ourselves. + // FIXME: eventually we should do this on other platforms too. + if (!m_renderView->frameView()->platformWidget()) + return true; +#endif + return false; +} + void RenderLayerCompositor::ensureRootPlatformLayer() { RootLayerAttachment expectedAttachment = shouldPropagateCompositingToEnclosingIFrame() ? RootLayerAttachedViaEnclosingIframe : RootLayerAttachedViaChromeClient; @@ -1363,10 +1381,7 @@ void RenderLayerCompositor::ensureRootPlatformLayer() m_rootPlatformLayer->setMasksToBounds(true); } - // The root layer does flipping if we need it on this platform. - m_rootPlatformLayer->setGeometryOrientation(expectedAttachment == RootLayerAttachedViaEnclosingIframe ? GraphicsLayer::CompositingCoordinatesTopDown : GraphicsLayer::compositingCoordinatesOrientation()); - - if (expectedAttachment == RootLayerAttachedViaEnclosingIframe) { + if (requiresScrollLayer(expectedAttachment)) { if (!m_clipLayer) { ASSERT(!m_scrollLayer); // Create a clipping layer if this is an iframe @@ -1384,17 +1399,24 @@ void RenderLayerCompositor::ensureRootPlatformLayer() m_clipLayer->addChild(m_scrollLayer.get()); m_scrollLayer->addChild(m_rootPlatformLayer.get()); - updateContentLayerScrollPosition(m_renderView->frameView()->scrollPosition()); + frameViewDidChangeSize(); + frameViewDidScroll(m_renderView->frameView()->scrollPosition()); + } + } else { + if (m_clipLayer) { + m_clipLayer->removeAllChildren(); + m_clipLayer->removeFromParent(); + m_clipLayer = 0; + + m_scrollLayer->removeAllChildren(); + m_scrollLayer = 0; } - } else if (m_clipLayer) { - m_clipLayer->removeAllChildren(); - m_clipLayer->removeFromParent(); - m_clipLayer = 0; - - m_scrollLayer->removeAllChildren(); - m_scrollLayer = 0; } + // The root layer does geometry flipping if we need it. + m_rootPlatformLayer->setGeometryOrientation(expectedAttachment == RootLayerAttachedViaEnclosingIframe + ? GraphicsLayer::CompositingCoordinatesTopDown : GraphicsLayer::compositingCoordinatesOrientation()); + // Check to see if we have to change the attachment if (m_rootLayerAttachment != RootLayerUnattached) detachRootPlatformLayer(); @@ -1434,7 +1456,7 @@ void RenderLayerCompositor::attachRootPlatformLayer(RootLayerAttachment attachme if (!page) return; - page->chrome()->client()->attachRootGraphicsLayer(frame, m_rootPlatformLayer.get()); + page->chrome()->client()->attachRootGraphicsLayer(frame, rootPlatformLayer()); break; } case RootLayerAttachedViaEnclosingIframe: { diff --git a/WebCore/rendering/RenderLayerCompositor.h b/WebCore/rendering/RenderLayerCompositor.h index 10516ad..aa27003 100644 --- a/WebCore/rendering/RenderLayerCompositor.h +++ b/WebCore/rendering/RenderLayerCompositor.h @@ -158,8 +158,8 @@ public: static bool parentIFrameContentLayers(RenderIFrame*); // Update the geometry of the layers used for clipping and scrolling in frames. - void updateContentLayerOffset(const IntPoint& contentsOffset); - void updateContentLayerScrollPosition(const IntPoint&); + void frameViewDidChangeSize(const IntPoint& contentsOffset = IntPoint()); + void frameViewDidScroll(const IntPoint& = IntPoint()); private: // Whether the given RL needs a compositing layer. @@ -214,11 +214,16 @@ private: bool requiresCompositingForIFrame(RenderObject*) const; bool requiresCompositingWhenDescendantsAreCompositing(RenderObject*) const; +<<<<<<< HEAD #if PLATFORM(ANDROID) // Whether we are on a mobile site bool requiresCompositingForMobileSites(const RenderLayer* layer) const; #endif +======= + bool requiresScrollLayer(RootLayerAttachment) const; + +>>>>>>> webkit.org at r64264 private: RenderView* m_renderView; OwnPtr<GraphicsLayer> m_rootPlatformLayer; diff --git a/WebCore/rendering/RenderMediaControlsChromium.cpp b/WebCore/rendering/RenderMediaControlsChromium.cpp index 98fdc7b..ab650da 100644 --- a/WebCore/rendering/RenderMediaControlsChromium.cpp +++ b/WebCore/rendering/RenderMediaControlsChromium.cpp @@ -96,7 +96,7 @@ static bool paintMediaPlayButton(RenderObject* object, const PaintInfo& paintInf if (!hasSource(mediaElement)) return paintMediaButton(paintInfo.context, rect, mediaPlayDisabled); - return paintMediaButton(paintInfo.context, rect, mediaElement->paused() ? mediaPlay : mediaPause); + return paintMediaButton(paintInfo.context, rect, mediaElement->canPlay() ? mediaPlay : mediaPause); } static Image* getMediaSliderThumb() diff --git a/WebCore/rendering/RenderMenuList.cpp b/WebCore/rendering/RenderMenuList.cpp index 177921c..ff16e7e 100644 --- a/WebCore/rendering/RenderMenuList.cpp +++ b/WebCore/rendering/RenderMenuList.cpp @@ -354,6 +354,11 @@ String RenderMenuList::itemLabel(unsigned) const return String(); } +String RenderMenuList::itemIcon(unsigned) const +{ + return String(); +} + String RenderMenuList::itemAccessibilityText(unsigned listIndex) const { // Allow the accessible name be changed if necessary. diff --git a/WebCore/rendering/RenderMenuList.h b/WebCore/rendering/RenderMenuList.h index d72e1a9..aef8d4f 100644 --- a/WebCore/rendering/RenderMenuList.h +++ b/WebCore/rendering/RenderMenuList.h @@ -83,6 +83,7 @@ private: // PopupMenuClient methods virtual String itemText(unsigned listIndex) const; virtual String itemLabel(unsigned listIndex) const; + virtual String itemIcon(unsigned listIndex) const; virtual String itemToolTip(unsigned listIndex) const; virtual String itemAccessibilityText(unsigned listIndex) const; virtual bool itemIsEnabled(unsigned listIndex) const; diff --git a/WebCore/rendering/RenderSVGAllInOne.cpp b/WebCore/rendering/RenderSVGAllInOne.cpp index da86f84..fa5709e 100644 --- a/WebCore/rendering/RenderSVGAllInOne.cpp +++ b/WebCore/rendering/RenderSVGAllInOne.cpp @@ -35,6 +35,7 @@ #include "RenderSVGModelObject.cpp" #include "RenderSVGResource.cpp" #include "RenderSVGResourceClipper.cpp" +#include "RenderSVGResourceContainer.cpp" #include "RenderSVGResourceFilter.cpp" #include "RenderSVGResourceGradient.cpp" #include "RenderSVGResourceLinearGradient.cpp" @@ -57,6 +58,9 @@ #include "SVGMarkerLayoutInfo.cpp" #include "SVGRenderSupport.cpp" #include "SVGRenderTreeAsText.cpp" +#include "SVGResources.cpp" +#include "SVGResourcesCache.cpp" +#include "SVGResourcesCycleSolver.cpp" #include "SVGRootInlineBox.cpp" #include "SVGShadowTreeElements.cpp" #include "SVGTextChunkLayoutInfo.cpp" diff --git a/WebCore/rendering/RenderSVGHiddenContainer.h b/WebCore/rendering/RenderSVGHiddenContainer.h index c446f11..297a738 100644 --- a/WebCore/rendering/RenderSVGHiddenContainer.h +++ b/WebCore/rendering/RenderSVGHiddenContainer.h @@ -37,11 +37,10 @@ namespace WebCore { public: RenderSVGHiddenContainer(SVGStyledElement*); - private: - virtual bool isSVGHiddenContainer() const { return true; } - virtual const char* renderName() const { return "RenderSVGHiddenContainer"; } + private: + virtual bool isSVGHiddenContainer() const { return true; } virtual bool requiresLayer() const { return false; } virtual void layout(); diff --git a/WebCore/rendering/RenderSVGResourceContainer.cpp b/WebCore/rendering/RenderSVGResourceContainer.cpp new file mode 100644 index 0000000..3707797 --- /dev/null +++ b/WebCore/rendering/RenderSVGResourceContainer.cpp @@ -0,0 +1,131 @@ +/* + * Copyright (C) Research In Motion Limited 2010. All rights reserved. + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Library General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public License + * along with this library; see the file COPYING.LIB. If not, write to + * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + * Boston, MA 02110-1301, USA. + * + */ + +#include "config.h" + +#if ENABLE(SVG) +#include "RenderSVGResourceContainer.h" + +#include "RenderSVGShadowTreeRootContainer.h" +#include "SVGStyledTransformableElement.h" + +namespace WebCore { + +RenderSVGResourceContainer::RenderSVGResourceContainer(SVGStyledElement* node) + : RenderSVGHiddenContainer(node) + , RenderSVGResource() + , m_id(node->hasID() ? node->getIdAttribute() : nullAtom) +{ + ASSERT(node->document()); + node->document()->accessSVGExtensions()->addResource(m_id, this); +} + +RenderSVGResourceContainer::~RenderSVGResourceContainer() +{ + ASSERT(node()); + ASSERT(node()->document()); + node()->document()->accessSVGExtensions()->removeResource(m_id); +} + +void RenderSVGResourceContainer::idChanged() +{ + ASSERT(node()); + ASSERT(node()->document()); + SVGDocumentExtensions* extensions = node()->document()->accessSVGExtensions(); + + // Remove old id, that is guaranteed to be present in cache + extensions->removeResource(m_id); + m_id = static_cast<Element*>(node())->getIdAttribute(); + + // It's possible that an element is referencing us with the new id, and has to be notified that we're existing now + if (extensions->isPendingResource(m_id)) { + OwnPtr<HashSet<SVGStyledElement*> > clients(extensions->removePendingResource(m_id)); + if (clients->isEmpty()) + return; + + HashSet<SVGStyledElement*>::const_iterator it = clients->begin(); + const HashSet<SVGStyledElement*>::const_iterator end = clients->end(); + + for (; it != end; ++it) { + if (RenderObject* renderer = (*it)->renderer()) + renderer->setNeedsLayout(true); + } + } + + // Recache us with the new id + extensions->addResource(m_id, this); +} + +AffineTransform RenderSVGResourceContainer::transformOnNonScalingStroke(RenderObject* object, const AffineTransform& resourceTransform) +{ + if (!object->isRenderPath()) + return resourceTransform; + + SVGStyledTransformableElement* element = static_cast<SVGStyledTransformableElement*>(object->node()); + AffineTransform transform = resourceTransform; + transform.multiply(element->getScreenCTM()); + return transform; +} + +bool RenderSVGResourceContainer::containsCyclicReference(const Node* startNode) const +{ + ASSERT(startNode->document()); + + for (Node* node = startNode->firstChild(); node; node = node->nextSibling()) { + if (!node->isSVGElement()) + continue; + + RenderObject* renderer = node->renderer(); + if (!renderer) + continue; + + RenderStyle* style = renderer->style(); + if (!style) + continue; + + const SVGRenderStyle* svgStyle = style->svgStyle(); + ASSERT(svgStyle); + + // Let the class inheriting from us decide whether the child element references ourselves. + if (childElementReferencesResource(svgStyle, m_id)) + return true; + + // Dive into shadow tree to check for cycles there. + if (node->hasTagName(SVGNames::useTag)) { + ASSERT(renderer->isSVGShadowTreeRootContainer()); + if (Node* shadowRoot = static_cast<RenderSVGShadowTreeRootContainer*>(renderer)->rootElement()) { + if (containsCyclicReference(shadowRoot)) + return true; + } + + } + + if (node->hasChildNodes()) { + if (containsCyclicReference(node)) + return true; + } + } + + return false; +} + +} + +#endif diff --git a/WebCore/rendering/RenderSVGResourceContainer.h b/WebCore/rendering/RenderSVGResourceContainer.h index 5f1c828..d57b1db 100644 --- a/WebCore/rendering/RenderSVGResourceContainer.h +++ b/WebCore/rendering/RenderSVGResourceContainer.h @@ -33,50 +33,10 @@ namespace WebCore { class RenderSVGResourceContainer : public RenderSVGHiddenContainer, public RenderSVGResource { public: - RenderSVGResourceContainer(SVGStyledElement* node) - : RenderSVGHiddenContainer(node) - , RenderSVGResource() - , m_id(node->hasID() ? node->getIdAttribute() : nullAtom) - { - ASSERT(node->document()); - node->document()->accessSVGExtensions()->addResource(m_id, this); - } - - virtual ~RenderSVGResourceContainer() - { - ASSERT(node()); - ASSERT(node()->document()); - node()->document()->accessSVGExtensions()->removeResource(m_id); - } - - void idChanged() - { - ASSERT(node()); - ASSERT(node()->document()); - SVGDocumentExtensions* extensions = node()->document()->accessSVGExtensions(); - - // Remove old id, that is guaranteed to be present in cache - extensions->removeResource(m_id); - m_id = static_cast<Element*>(node())->getIdAttribute(); - - // It's possible that an element is referencing us with the new id, and has to be notified that we're existing now - if (extensions->isPendingResource(m_id)) { - OwnPtr<HashSet<SVGStyledElement*> > clients(extensions->removePendingResource(m_id)); - if (clients->isEmpty()) - return; - - HashSet<SVGStyledElement*>::const_iterator it = clients->begin(); - const HashSet<SVGStyledElement*>::const_iterator end = clients->end(); - - for (; it != end; ++it) { - if (RenderObject* renderer = (*it)->renderer()) - renderer->setNeedsLayout(true); - } - } - - // Recache us with the new id - extensions->addResource(m_id, this); - } + RenderSVGResourceContainer(SVGStyledElement*); + virtual ~RenderSVGResourceContainer(); + + void idChanged(); virtual bool isSVGResourceContainer() const { return true; } virtual bool drawsContents() { return false; } @@ -84,58 +44,16 @@ public: virtual RenderSVGResourceContainer* toRenderSVGResourceContainer() { return this; } virtual bool childElementReferencesResource(const SVGRenderStyle*, const String&) const { return false; } - static AffineTransform transformOnNonScalingStroke(RenderObject* object, const AffineTransform resourceTransform) - { - if (!object->isRenderPath()) - return resourceTransform; - - SVGStyledTransformableElement* element = static_cast<SVGStyledTransformableElement*>(object->node()); - AffineTransform transform = resourceTransform; - transform.multiply(element->getScreenCTM()); - return transform; - } - - bool containsCyclicReference(const Node* startNode) const - { - ASSERT(startNode->document()); - - for (Node* node = startNode->firstChild(); node; node = node->nextSibling()) { - if (!node->isSVGElement()) - continue; - - RenderObject* renderer = node->renderer(); - if (!renderer) - continue; - - RenderStyle* style = renderer->style(); - if (!style) - continue; - - const SVGRenderStyle* svgStyle = style->svgStyle(); - ASSERT(svgStyle); - - // Let the class inheriting from us decide whether the child element references ourselves. - if (childElementReferencesResource(svgStyle, m_id)) - return true; - - // Dive into shadow tree to check for cycles there. - if (node->hasTagName(SVGNames::useTag)) { - ASSERT(renderer->isSVGShadowTreeRootContainer()); - if (Node* shadowRoot = static_cast<RenderSVGShadowTreeRootContainer*>(renderer)->rootElement()) { - if (containsCyclicReference(shadowRoot)) - return true; - } - - } - - if (node->hasChildNodes()) { - if (containsCyclicReference(node)) - return true; - } - } - - return false; - } + static AffineTransform transformOnNonScalingStroke(RenderObject*, const AffineTransform& resourceTransform); + + bool containsCyclicReference(const Node* startNode) const; + +private: + friend class SVGResourcesCache; + + // FIXME: No-ops for now, until follow-up patch on bug 43031 lands. + void addClient(RenderObject*) { } + void removeClient(RenderObject*) { } private: AtomicString m_id; diff --git a/WebCore/rendering/RenderTable.cpp b/WebCore/rendering/RenderTable.cpp index 52fc326..6359c09 100644 --- a/WebCore/rendering/RenderTable.cpp +++ b/WebCore/rendering/RenderTable.cpp @@ -618,7 +618,7 @@ void RenderTable::splitColumn(int pos, int firstSpan) // change width of all rows. for (RenderObject* child = firstChild(); child; child = child->nextSibling()) { if (child->isTableSection()) - toRenderTableSection(child)->splitColumn(pos, oldSize + 1); + toRenderTableSection(child)->splitColumn(pos, firstSpan); } m_columnPos.grow(numEffCols() + 1); @@ -812,12 +812,12 @@ int RenderTable::calcBorderLeft() const const RenderTableSection::CellStruct& cs = firstNonEmptySection->cellAt(0, leftmostColumn); - if (cs.cell) { - const BorderValue& cb = cs.cell->style()->borderLeft(); + if (cs.hasCells()) { + const BorderValue& cb = cs.primaryCell()->style()->borderLeft(); if (cb.style() == BHIDDEN) return 0; - const BorderValue& rb = cs.cell->parent()->style()->borderLeft(); + const BorderValue& rb = cs.primaryCell()->parent()->style()->borderLeft(); if (rb.style() == BHIDDEN) return 0; @@ -871,12 +871,12 @@ int RenderTable::calcBorderRight() const const RenderTableSection::CellStruct& cs = firstNonEmptySection->cellAt(0, rightmostColumn); - if (cs.cell) { - const BorderValue& cb = cs.cell->style()->borderRight(); + if (cs.hasCells()) { + const BorderValue& cb = cs.primaryCell()->style()->borderRight(); if (cb.style() == BHIDDEN) return 0; - const BorderValue& rb = cs.cell->parent()->style()->borderRight(); + const BorderValue& rb = cs.primaryCell()->parent()->style()->borderRight(); if (rb.style() == BHIDDEN) return 0; @@ -1081,13 +1081,8 @@ RenderTableCell* RenderTable::cellAbove(const RenderTableCell* cell) const // Look up the cell in the section's grid, which requires effective col index if (section) { int effCol = colToEffCol(cell->col()); - RenderTableSection::CellStruct aboveCell; - // If we hit a span back up to a real cell. - do { - aboveCell = section->cellAt(rAbove, effCol); - effCol--; - } while (!aboveCell.cell && aboveCell.inColSpan && effCol >= 0); - return aboveCell.cell; + RenderTableSection::CellStruct& aboveCell = section->cellAt(rAbove, effCol); + return aboveCell.primaryCell(); } else return 0; } @@ -1113,13 +1108,8 @@ RenderTableCell* RenderTable::cellBelow(const RenderTableCell* cell) const // Look up the cell in the section's grid, which requires effective col index if (section) { int effCol = colToEffCol(cell->col()); - RenderTableSection::CellStruct belowCell; - // If we hit a colspan back up to a real cell. - do { - belowCell = section->cellAt(rBelow, effCol); - effCol--; - } while (!belowCell.cell && belowCell.inColSpan && effCol >= 0); - return belowCell.cell; + RenderTableSection::CellStruct& belowCell = section->cellAt(rBelow, effCol); + return belowCell.primaryCell(); } else return 0; } @@ -1134,12 +1124,8 @@ RenderTableCell* RenderTable::cellBefore(const RenderTableCell* cell) const return 0; // If we hit a colspan back up to a real cell. - RenderTableSection::CellStruct prevCell; - do { - prevCell = section->cellAt(cell->row(), effCol - 1); - effCol--; - } while (!prevCell.cell && prevCell.inColSpan && effCol >= 0); - return prevCell.cell; + RenderTableSection::CellStruct& prevCell = section->cellAt(cell->row(), effCol - 1); + return prevCell.primaryCell(); } RenderTableCell* RenderTable::cellAfter(const RenderTableCell* cell) const @@ -1149,7 +1135,7 @@ RenderTableCell* RenderTable::cellAfter(const RenderTableCell* cell) const int effCol = colToEffCol(cell->col() + cell->colSpan()); if (effCol >= numEffCols()) return 0; - return cell->section()->cellAt(cell->row(), effCol).cell; + return cell->section()->primaryCellAt(cell->row(), effCol); } RenderBlock* RenderTable::firstLineBlock() const diff --git a/WebCore/rendering/RenderTableSection.cpp b/WebCore/rendering/RenderTableSection.cpp index fcb6c59..dcaa2f5 100644 --- a/WebCore/rendering/RenderTableSection.cpp +++ b/WebCore/rendering/RenderTableSection.cpp @@ -37,6 +37,7 @@ #include "RenderTableRow.h" #include "RenderView.h" #include <limits> +#include <wtf/HashSet.h> #include <wtf/Vector.h> #ifdef ANDROID_LAYOUT #include "Frame.h" @@ -68,9 +69,10 @@ RenderTableSection::RenderTableSection(Node* node) , m_outerBorderBottom(0) , m_needsCellRecalc(false) , m_hasOverflowingCell(false) + , m_hasMultipleCellLevels(false) { // init RenderObject attributes - setInline(false); // our object is not Inline + setInline(false); // our object is not Inline } RenderTableSection::~RenderTableSection() @@ -166,12 +168,8 @@ bool RenderTableSection::ensureRows(int numRows) } m_gridRows = numRows; int nCols = max(1, table()->numEffCols()); - CellStruct emptyCellStruct; - emptyCellStruct.cell = 0; - emptyCellStruct.inColSpan = false; for (int r = nRows; r < numRows; r++) { m_grid[r].row = new Row(nCols); - m_grid[r].row->fill(emptyCellStruct); m_grid[r].rowRenderer = 0; m_grid[r].baseline = 0; m_grid[r].height = Length(); @@ -194,8 +192,7 @@ void RenderTableSection::addCell(RenderTableCell* cell, RenderTableRow* row) // <TR><TD>1 <TD rowspan="2">2 <TD>3 <TD>4 // <TR><TD colspan="2">5 // </TABLE> - - while (m_cCol < nCols && (cellAt(m_cRow, m_cCol).cell || cellAt(m_cRow, m_cCol).inColSpan)) + while (m_cCol < nCols && (cellAt(m_cRow, m_cCol).hasCells() || cellAt(m_cRow, m_cCol).inColSpan)) m_cCol++; if (rSpan == 1) { @@ -229,31 +226,30 @@ void RenderTableSection::addCell(RenderTableCell* cell, RenderTableRow* row) int col = m_cCol; // tell the cell where it is - CellStruct currentCell; - currentCell.cell = cell; - currentCell.inColSpan = false; + bool inColSpan = false; while (cSpan) { int currentSpan; if (m_cCol >= nCols) { table()->appendColumn(cSpan); currentSpan = cSpan; } else { - if (cSpan < static_cast<int>(columns[m_cCol].span)) + if (cSpan < (int)columns[m_cCol].span) table()->splitColumn(m_cCol, cSpan); currentSpan = columns[m_cCol].span; } - for (int r = 0; r < rSpan; r++) { CellStruct& c = cellAt(m_cRow + r, m_cCol); - if (!c.cell) - c.cell = currentCell.cell; - if (currentCell.inColSpan) + ASSERT(cell); + c.cells.append(cell); + // If cells overlap then we take the slow path for painting. + if (c.cells.size() > 1) + m_hasMultipleCellLevels = true; + if (inColSpan) c.inColSpan = true; } m_cCol++; cSpan -= currentSpan; - currentCell.cell = 0; - currentCell.inColSpan = true; + inColSpan = true; } cell->setRow(m_cRow); cell->setCol(table()->effColToCol(col)); @@ -279,14 +275,14 @@ void RenderTableSection::setCellWidths() Row& row = *m_grid[i].row; int cols = row.size(); for (int j = 0; j < cols; j++) { - CellStruct current = row[j]; - RenderTableCell* cell = current.cell; - - if (!cell) - continue; + CellStruct& current = row[j]; + RenderTableCell* cell = current.primaryCell(); + if (!cell || current.inColSpan) + continue; int endCol = j; int cspan = cell->colSpan(); while (cspan && endCol < cols) { + ASSERT(endCol < (int)table()->columns().size()); cspan -= table()->columns()[endCol].span; endCol++; } @@ -321,7 +317,7 @@ void RenderTableSection::setCellWidths() } } - statePusher.pop(); // only pops if we pushed + statePusher.pop(); // only pops if we pushed } int RenderTableSection::calcRowHeight() @@ -364,11 +360,13 @@ int RenderTableSection::calcRowHeight() int totalCols = row->size(); for (int c = 0; c < totalCols; c++) { - CellStruct current = cellAt(r, c); - cell = current.cell; + CellStruct& current = cellAt(r, c); + cell = current.primaryCell(); + if (!cell || current.inColSpan) continue; - if (r < m_gridRows - 1 && cellAt(r + 1, c).cell == cell) + + if ((cell->row() + cell->rowSpan() - 1) > r) continue; int indx = max(r - cell->rowSpan() + 1, 0); @@ -410,7 +408,7 @@ int RenderTableSection::calcRowHeight() } } - //do we have baseline aligned elements? + // do we have baseline aligned elements? if (baseline) { // increase rowheight if baseline requires m_rowPos[r + 1] = max(m_rowPos[r + 1], baseline + bdesc + (m_grid[r].rowRenderer ? spacing : 0)); @@ -564,7 +562,7 @@ int RenderTableSection::layoutRows(int toAdd) int add = 0; int prev = m_rowPos[0]; for (int r = 0; r < totalRows; r++) { - //weight with the original height + // weight with the original height add += dh * (m_rowPos[r + 1] - prev) / tot; prev = m_rowPos[r + 1]; m_rowPos[r + 1] += add; @@ -587,16 +585,14 @@ int RenderTableSection::layoutRows(int toAdd) } for (int c = 0; c < nEffCols; c++) { - RenderTableCell* cell = cellAt(r, c).cell; - - if (!cell) - continue; - if (r < totalRows - 1 && cell == cellAt(r + 1, c).cell) - continue; + CellStruct& cs = cellAt(r, c); + RenderTableCell* cell = cs.primaryCell(); - rindx = max(0, r - cell->rowSpan() + 1); + if (!cell || cs.inColSpan) + continue; - rHeight = m_rowPos[r + 1] - m_rowPos[rindx] - vspacing; + rindx = cell->row(); + rHeight = m_rowPos[rindx + cell->rowSpan()] - m_rowPos[rindx] - vspacing; // Force percent height children to lay themselves out again. // This will cause these children to grow to fill the cell. @@ -612,8 +608,8 @@ int RenderTableSection::layoutRows(int toAdd) // match the behavior perfectly, but we'll continue to refine it as we discover new // bugs. :) bool cellChildrenFlex = false; - bool flexAllChildren = cell->style()->height().isFixed() || - (!table()->style()->height().isAuto() && rHeight != cell->height()); + bool flexAllChildren = cell->style()->height().isFixed() + || (!table()->style()->height().isAuto() && rHeight != cell->height()); for (RenderObject* o = cell->firstChild(); o; o = o->nextSibling()) { if (!o->isText() && o->style()->height().isPercent() && (flexAllChildren || o->isReplaced() || (o->isBox() && toRenderBox(o)->scrollsOverflow()))) { @@ -706,9 +702,9 @@ int RenderTableSection::layoutRows(int toAdd) IntRect oldCellRect(cell->x(), cell->y() , cell->width(), cell->height()); - if (style()->direction() == RTL) { + if (style()->direction() == RTL) cell->setLocation(table()->columnPositions()[nEffCols] - table()->columnPositions()[table()->colToEffCol(cell->col() + cell->colSpan())] + hspacing, m_rowPos[rindx]); - } else + else cell->setLocation(table()->columnPositions()[c] + hspacing, m_rowPos[rindx]); // If the cell moved, we have to repaint it as well as any floating/positioned @@ -730,10 +726,11 @@ int RenderTableSection::layoutRows(int toAdd) // Now that our height has been determined, add in overflow from cells. for (int r = 0; r < totalRows; r++) { for (int c = 0; c < nEffCols; c++) { - RenderTableCell* cell = cellAt(r, c).cell; - if (!cell) + CellStruct& cs = cellAt(r, c); + RenderTableCell* cell = cs.primaryCell(); + if (!cell || cs.inColSpan) continue; - if (r < totalRows - 1 && cell == cellAt(r + 1, c).cell) + if (r < totalRows - 1 && cell == primaryCellAt(r + 1, c)) continue; addOverflowFromChild(cell); m_hasOverflowingCell |= cell->hasVisibleOverflow(); @@ -821,17 +818,16 @@ int RenderTableSection::calcOuterBorderTop() const bool allHidden = true; for (int c = 0; c < totalCols; c++) { const CellStruct& current = cellAt(0, c); - if (current.inColSpan || !current.cell) + if (current.inColSpan || !current.hasCells()) continue; - const BorderValue& cb = current.cell->style()->borderTop(); + const BorderValue& cb = current.primaryCell()->style()->borderTop(); // FIXME: Don't repeat for the same col group RenderTableCol* colGroup = table()->colElement(c); if (colGroup) { const BorderValue& gb = colGroup->style()->borderTop(); if (gb.style() == BHIDDEN || cb.style() == BHIDDEN) continue; - else - allHidden = false; + allHidden = false; if (gb.style() > BHIDDEN && gb.width() > borderWidth) borderWidth = gb.width(); if (cb.style() > BHIDDEN && cb.width() > borderWidth) @@ -839,8 +835,7 @@ int RenderTableSection::calcOuterBorderTop() const } else { if (cb.style() == BHIDDEN) continue; - else - allHidden = false; + allHidden = false; if (cb.style() > BHIDDEN && cb.width() > borderWidth) borderWidth = cb.width(); } @@ -874,17 +869,16 @@ int RenderTableSection::calcOuterBorderBottom() const bool allHidden = true; for (int c = 0; c < totalCols; c++) { const CellStruct& current = cellAt(m_gridRows - 1, c); - if (current.inColSpan || !current.cell) + if (current.inColSpan || !current.hasCells()) continue; - const BorderValue& cb = current.cell->style()->borderBottom(); + const BorderValue& cb = current.primaryCell()->style()->borderBottom(); // FIXME: Don't repeat for the same col group RenderTableCol* colGroup = table()->colElement(c); if (colGroup) { const BorderValue& gb = colGroup->style()->borderBottom(); if (gb.style() == BHIDDEN || cb.style() == BHIDDEN) continue; - else - allHidden = false; + allHidden = false; if (gb.style() > BHIDDEN && gb.width() > borderWidth) borderWidth = gb.width(); if (cb.style() > BHIDDEN && cb.width() > borderWidth) @@ -892,8 +886,7 @@ int RenderTableSection::calcOuterBorderBottom() const } else { if (cb.style() == BHIDDEN) continue; - else - allHidden = false; + allHidden = false; if (cb.style() > BHIDDEN && cb.width() > borderWidth) borderWidth = cb.width(); } @@ -931,15 +924,14 @@ int RenderTableSection::calcOuterBorderLeft(bool rtl) const bool allHidden = true; for (int r = 0; r < m_gridRows; r++) { const CellStruct& current = cellAt(r, leftmostColumn); - if (!current.cell) + if (!current.hasCells()) continue; // FIXME: Don't repeat for the same cell - const BorderValue& cb = current.cell->style()->borderLeft(); - const BorderValue& rb = current.cell->parent()->style()->borderLeft(); + const BorderValue& cb = current.primaryCell()->style()->borderLeft(); + const BorderValue& rb = current.primaryCell()->parent()->style()->borderLeft(); if (cb.style() == BHIDDEN || rb.style() == BHIDDEN) continue; - else - allHidden = false; + allHidden = false; if (cb.style() > BHIDDEN && cb.width() > borderWidth) borderWidth = cb.width(); if (rb.style() > BHIDDEN && rb.width() > borderWidth) @@ -978,15 +970,14 @@ int RenderTableSection::calcOuterBorderRight(bool rtl) const bool allHidden = true; for (int r = 0; r < m_gridRows; r++) { const CellStruct& current = cellAt(r, rightmostColumn); - if (!current.cell) + if (!current.hasCells()) continue; // FIXME: Don't repeat for the same cell - const BorderValue& cb = current.cell->style()->borderRight(); - const BorderValue& rb = current.cell->parent()->style()->borderRight(); + const BorderValue& cb = current.primaryCell()->style()->borderRight(); + const BorderValue& rb = current.primaryCell()->parent()->style()->borderRight(); if (cb.style() == BHIDDEN || rb.style() == BHIDDEN) continue; - else - allHidden = false; + allHidden = false; if (cb.style() > BHIDDEN && cb.width() > borderWidth) borderWidth = cb.width(); if (rb.style() > BHIDDEN && rb.width() > borderWidth) @@ -1019,7 +1010,8 @@ int RenderTableSection::firstLineBoxBaseline() const firstLineBaseline = -1; Row* firstRow = m_grid[0].row; for (size_t i = 0; i < firstRow->size(); ++i) { - RenderTableCell* cell = firstRow->at(i).cell; + CellStruct& cs = firstRow->at(i); + RenderTableCell* cell = cs.primaryCell(); if (cell) firstLineBaseline = max(firstLineBaseline, cell->y() + cell->paddingTop() + cell->borderTop() + cell->contentHeight()); } @@ -1051,6 +1043,45 @@ void RenderTableSection::paint(PaintInfo& paintInfo, int tx, int ty) popContentsClip(paintInfo, phase, tx, ty); } +static inline bool compareCellPositions(RenderTableCell* elem1, RenderTableCell* elem2) +{ + return elem1->row() < elem2->row(); +} + +void RenderTableSection::paintCell(RenderTableCell* cell, PaintInfo& paintInfo, int tx, int ty) +{ + PaintPhase paintPhase = paintInfo.phase; + RenderTableRow* row = toRenderTableRow(cell->parent()); + + if (paintPhase == PaintPhaseBlockBackground || paintPhase == PaintPhaseChildBlockBackground) { + // We need to handle painting a stack of backgrounds. This stack (from bottom to top) consists of + // the column group, column, row group, row, and then the cell. + RenderObject* col = table()->colElement(cell->col()); + RenderObject* colGroup = 0; + if (col && col->parent()->style()->display() == TABLE_COLUMN_GROUP) + colGroup = col->parent(); + + // Column groups and columns first. + // FIXME: Columns and column groups do not currently support opacity, and they are being painted "too late" in + // the stack, since we have already opened a transparency layer (potentially) for the table row group. + // Note that we deliberately ignore whether or not the cell has a layer, since these backgrounds paint "behind" the + // cell. + cell->paintBackgroundsBehindCell(paintInfo, tx, ty, colGroup); + cell->paintBackgroundsBehindCell(paintInfo, tx, ty, col); + + // Paint the row group next. + cell->paintBackgroundsBehindCell(paintInfo, tx, ty, this); + + // Paint the row next, but only if it doesn't have a layer. If a row has a layer, it will be responsible for + // painting the row background for the cell. + if (!row->hasSelfPaintingLayer()) + cell->paintBackgroundsBehindCell(paintInfo, tx, ty, row); + } + if ((!cell->hasSelfPaintingLayer() && !row->hasSelfPaintingLayer()) || paintInfo.phase == PaintPhaseCollapsedTableBorders) + cell->paint(paintInfo, tx, ty); + +} + void RenderTableSection::paintObject(PaintInfo& paintInfo, int tx, int ty) { // Check which rows and cols are visible and only paint these. @@ -1120,57 +1151,50 @@ void RenderTableSection::paintObject(PaintInfo& paintInfo, int tx, int ty) if (!endcol && tx + table()->columnPositions()[0] - table()->outerBorderLeft() <= y + w + os) endcol++; } +<<<<<<< HEAD #ifdef ANDROID_LAYOUT } #endif +======= +>>>>>>> webkit.org at r64264 if (startcol < endcol) { - // draw the cells - for (unsigned r = startrow; r < endrow; r++) { - unsigned c = startcol; - // since a cell can be -1 (indicating a colspan) we might have to search backwards to include it - while (c && cellAt(r, c).inColSpan) - c--; - for (; c < endcol; c++) { - CellStruct current = cellAt(r, c); - RenderTableCell* cell = current.cell; - - // Cells must always paint in the order in which they appear taking into account - // their upper left originating row/column. For cells with rowspans, avoid repainting - // if we've already seen the cell. - if (!cell || (r > startrow && (cellAt(r - 1, c).cell == cell))) - continue; - - RenderTableRow* row = toRenderTableRow(cell->parent()); - - if (paintPhase == PaintPhaseBlockBackground || paintPhase == PaintPhaseChildBlockBackground) { - // We need to handle painting a stack of backgrounds. This stack (from bottom to top) consists of - // the column group, column, row group, row, and then the cell. - RenderObject* col = table()->colElement(c); - RenderObject* colGroup = 0; - if (col && col->parent()->style()->display() == TABLE_COLUMN_GROUP) - colGroup = col->parent(); - - // Column groups and columns first. - // FIXME: Columns and column groups do not currently support opacity, and they are being painted "too late" in - // the stack, since we have already opened a transparency layer (potentially) for the table row group. - // Note that we deliberately ignore whether or not the cell has a layer, since these backgrounds paint "behind" the - // cell. - cell->paintBackgroundsBehindCell(paintInfo, tx, ty, colGroup); - cell->paintBackgroundsBehindCell(paintInfo, tx, ty, col); - - // Paint the row group next. - cell->paintBackgroundsBehindCell(paintInfo, tx, ty, this); - - // Paint the row next, but only if it doesn't have a layer. If a row has a layer, it will be responsible for - // painting the row background for the cell. - if (!row->hasSelfPaintingLayer()) - cell->paintBackgroundsBehindCell(paintInfo, tx, ty, row); + if (!m_hasMultipleCellLevels) { + // Draw the dirty cells in the order that they appear. + for (unsigned r = startrow; r < endrow; r++) { + for (unsigned c = startcol; c < endcol; c++) { + CellStruct& current = cellAt(r, c); + RenderTableCell* cell = current.primaryCell(); + if (!cell || (r > startrow && primaryCellAt(r - 1, c) == cell) || (c > startcol && primaryCellAt(r, c - 1) == cell)) + continue; + paintCell(cell, paintInfo, tx, ty); + } + } + } else { + // Draw the cells in the correct paint order. + Vector<RenderTableCell*> cells; + HashSet<RenderTableCell*> spanningCells; + for (unsigned r = startrow; r < endrow; r++) { + for (unsigned c = startcol; c < endcol; c++) { + CellStruct& current = cellAt(r, c); + if (!current.hasCells()) + continue; + for (unsigned i = 0; i < current.cells.size(); ++i) { + if (current.cells[i]->rowSpan() > 1 || current.cells[i]->colSpan() > 1) { + if (spanningCells.contains(current.cells[i])) + continue; + spanningCells.add(current.cells[i]); + } + cells.append(current.cells[i]); + } } - - if ((!cell->hasSelfPaintingLayer() && !row->hasSelfPaintingLayer()) || paintInfo.phase == PaintPhaseCollapsedTableBorders) - cell->paint(paintInfo, tx, ty); } + // Sort the dirty cells by paint order. + std::stable_sort(cells.begin(), cells.end(), compareCellPositions); + int size = cells.size(); + // Paint the cells. + for (int i = 0; i < size; ++i) + paintCell(cells[i], paintInfo, tx, ty); } } } @@ -1223,7 +1247,7 @@ int RenderTableSection::numColumns() const for (int r = 0; r < m_gridRows; ++r) { for (int c = result; c < table()->numEffCols(); ++c) { const CellStruct& cell = cellAt(r, c); - if (cell.cell || cell.inColSpan) + if (cell.hasCells() || cell.inColSpan) result = c; } } @@ -1233,24 +1257,29 @@ int RenderTableSection::numColumns() const void RenderTableSection::appendColumn(int pos) { - for (int row = 0; row < m_gridRows; ++row) { + for (int row = 0; row < m_gridRows; ++row) m_grid[row].row->resize(pos + 1); - CellStruct& c = cellAt(row, pos); - c.cell = 0; - c.inColSpan = false; - } } -void RenderTableSection::splitColumn(int pos, int newSize) +void RenderTableSection::splitColumn(int pos, int first) { if (m_cCol > pos) m_cCol++; for (int row = 0; row < m_gridRows; ++row) { - m_grid[row].row->resize(newSize); Row& r = *m_grid[row].row; - memmove(r.data() + pos + 1, r.data() + pos, (newSize - 1 - pos) * sizeof(CellStruct)); - r[pos + 1].cell = 0; - r[pos + 1].inColSpan = r[pos].inColSpan || r[pos].cell; + r.insert(pos + 1, CellStruct()); + if (r[pos].hasCells()) { + r[pos + 1].cells.append(r[pos].cells); + RenderTableCell* cell = r[pos].primaryCell(); + ASSERT(cell); + int colleft = cell->colSpan() - r[pos].inColSpan; + if (first > colleft) + r[pos + 1].inColSpan = 0; + else + r[pos + 1].inColSpan = first + r[pos].inColSpan; + } else { + r[pos + 1].inColSpan = 0; + } } } @@ -1279,7 +1308,6 @@ bool RenderTableSection::nodeAtPoint(const HitTestRequest& request, HitTestResul return true; } } - return false; } diff --git a/WebCore/rendering/RenderTableSection.h b/WebCore/rendering/RenderTableSection.h index 9f6d5ea..6d2f752 100644 --- a/WebCore/rendering/RenderTableSection.h +++ b/WebCore/rendering/RenderTableSection.h @@ -54,8 +54,23 @@ public: RenderTable* table() const { return toRenderTable(parent()); } struct CellStruct { - RenderTableCell* cell; + Vector<RenderTableCell*, 1> cells; bool inColSpan; // true for columns after the first in a colspan + + CellStruct(): + inColSpan(false) {} + + RenderTableCell* primaryCell() + { + return hasCells() ? cells[cells.size() - 1] : 0; + } + + const RenderTableCell* primaryCell() const + { + return hasCells() ? cells[cells.size() - 1] : 0; + } + + bool hasCells() const { return cells.size() > 0; } }; typedef Vector<CellStruct> Row; @@ -69,9 +84,14 @@ public: CellStruct& cellAt(int row, int col) { return (*m_grid[row].row)[col]; } const CellStruct& cellAt(int row, int col) const { return (*m_grid[row].row)[col]; } + RenderTableCell* primaryCellAt(int row, int col) + { + CellStruct& c = (*m_grid[row].row)[col]; + return c.primaryCell(); + } void appendColumn(int pos); - void splitColumn(int pos, int newSize); + void splitColumn(int pos, int first); int calcOuterBorderTop() const; int calcOuterBorderBottom() const; @@ -121,6 +141,7 @@ private: virtual int leftmostPosition(bool includeOverflowInterior, bool includeSelf) const; virtual void paint(PaintInfo&, int tx, int ty); + virtual void paintCell(RenderTableCell*, PaintInfo&, int tx, int ty); virtual void paintObject(PaintInfo&, int tx, int ty); virtual void imageChanged(WrappedImagePtr, const IntRect* = 0); @@ -150,6 +171,8 @@ private: bool m_needsCellRecalc; bool m_hasOverflowingCell; + + bool m_hasMultipleCellLevels; }; inline RenderTableSection* toRenderTableSection(RenderObject* object) diff --git a/WebCore/rendering/RenderText.cpp b/WebCore/rendering/RenderText.cpp index c70ac58..bd050d8 100644 --- a/WebCore/rendering/RenderText.cpp +++ b/WebCore/rendering/RenderText.cpp @@ -140,9 +140,8 @@ bool RenderText::isWordBreak() const void RenderText::updateNeedsTranscoding() { - const AtomicString& fontFamily = style()->font().family().family(); const TextEncoding* encoding = document()->decoder() ? &document()->decoder()->encoding() : 0; - m_needsTranscoding = fontTranscoder().needsTranscoding(fontFamily, encoding); + m_needsTranscoding = fontTranscoder().needsTranscoding(style()->font().fontDescription(), encoding); } void RenderText::styleDidChange(StyleDifference diff, const RenderStyle* oldStyle) @@ -1044,9 +1043,8 @@ void RenderText::setTextInternal(PassRefPtr<StringImpl> text) ASSERT(text); m_text = text; if (m_needsTranscoding) { - const AtomicString& fontFamily = style()->font().family().family(); const TextEncoding* encoding = document()->decoder() ? &document()->decoder()->encoding() : 0; - fontTranscoder().convert(m_text, fontFamily, encoding); + fontTranscoder().convert(m_text, style()->font().fontDescription(), encoding); } ASSERT(m_text); diff --git a/WebCore/rendering/RenderTextControlSingleLine.cpp b/WebCore/rendering/RenderTextControlSingleLine.cpp index 71d5a86..5b57513 100644 --- a/WebCore/rendering/RenderTextControlSingleLine.cpp +++ b/WebCore/rendering/RenderTextControlSingleLine.cpp @@ -920,6 +920,11 @@ String RenderTextControlSingleLine::itemLabel(unsigned) const return String(); } +String RenderTextControlSingleLine::itemIcon(unsigned) const +{ + return String(); +} + bool RenderTextControlSingleLine::itemIsEnabled(unsigned listIndex) const { if (!listIndex || itemIsSeparator(listIndex)) diff --git a/WebCore/rendering/RenderTextControlSingleLine.h b/WebCore/rendering/RenderTextControlSingleLine.h index 92ecadd..8c7e844 100644 --- a/WebCore/rendering/RenderTextControlSingleLine.h +++ b/WebCore/rendering/RenderTextControlSingleLine.h @@ -117,6 +117,7 @@ private: virtual void selectionCleared() {} virtual String itemText(unsigned listIndex) const; virtual String itemLabel(unsigned listIndex) const; + virtual String itemIcon(unsigned listIndex) const; virtual String itemToolTip(unsigned) const { return String(); } virtual String itemAccessibilityText(unsigned) const { return String(); } virtual bool itemIsEnabled(unsigned listIndex) const; diff --git a/WebCore/rendering/SVGResources.cpp b/WebCore/rendering/SVGResources.cpp new file mode 100644 index 0000000..de23ce1 --- /dev/null +++ b/WebCore/rendering/SVGResources.cpp @@ -0,0 +1,360 @@ +/* + Copyright (C) Research In Motion Limited 2010. All rights reserved. + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public + License as published by the Free Software Foundation; either + version 2 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public License + aint with this library; see the file COPYING.LIB. If not, write to + the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +#include "config.h" +#include "SVGResources.h" + +#if ENABLE(SVG) +#include "RenderSVGResourceClipper.h" +#include "RenderSVGResourceFilter.h" +#include "RenderSVGResourceMarker.h" +#include "RenderSVGResourceMasker.h" +#include "SVGPaint.h" +#include "SVGRenderStyle.h" +#include "SVGURIReference.h" + +namespace WebCore { + +SVGResources::SVGResources() + : m_clipper(0) +#if ENABLE(FILTERS) + , m_filter(0) +#endif + , m_markerStart(0) + , m_markerMid(0) + , m_markerEnd(0) + , m_masker(0) + , m_fill(0) + , m_stroke(0) +{ +} + +static inline RenderSVGResourceContainer* paintingResourceFromSVGPaint(Document* document, SVGPaint* paint, AtomicString& id, bool& hasPendingResource) +{ + ASSERT(paint); + + SVGPaint::SVGPaintType paintType = paint->paintType(); + if (paintType != SVGPaint::SVG_PAINTTYPE_URI && paintType != SVGPaint::SVG_PAINTTYPE_URI_RGBCOLOR) + return 0; + + id = SVGURIReference::getTarget(paint->uri()); + if (RenderSVGResourceContainer* container = getRenderSVGResourceContainerById(document, id)) + return container; + + hasPendingResource = true; + return 0; +} + +static inline void registerPendingResource(SVGDocumentExtensions* extensions, const AtomicString& id, Node* node) +{ + ASSERT(node); + if (!node->isSVGElement()) + return; + + SVGElement* svgElement = static_cast<SVGElement*>(node); + if (!svgElement->isStyled()) + return; + + extensions->addPendingResource(id, static_cast<SVGStyledElement*>(svgElement)); +} + +bool SVGResources::buildCachedResources(const RenderObject* object, const SVGRenderStyle* style) +{ + ASSERT(object); + ASSERT(style); + + Node* node = object->node(); + ASSERT(node); + + Document* document = object->document(); + ASSERT(document); + + SVGDocumentExtensions* extensions = document->accessSVGExtensions(); + ASSERT(extensions); + + bool foundResources = false; + if (style->hasClipper()) { + AtomicString id(style->clipperResource()); + m_clipper = getRenderSVGResourceById<RenderSVGResourceClipper>(document, id); + if (m_clipper) + foundResources = true; + else + registerPendingResource(extensions, id, node); + } + + if (style->hasMasker()) { + AtomicString id(style->maskerResource()); + m_masker = getRenderSVGResourceById<RenderSVGResourceMasker>(document, id); + if (m_masker) + foundResources = true; + else + registerPendingResource(extensions, id, node); + } + +#if ENABLE(FILTERS) + if (style->hasFilter()) { + AtomicString id(style->filterResource()); + m_filter = getRenderSVGResourceById<RenderSVGResourceFilter>(document, id); + if (m_filter) + foundResources = true; + else + registerPendingResource(extensions, id, node); + } +#endif + + if (style->hasMarkers()) { + AtomicString markerStartId(style->markerStartResource()); + m_markerStart = getRenderSVGResourceById<RenderSVGResourceMarker>(document, markerStartId); + if (m_markerStart) + foundResources = true; + else + registerPendingResource(extensions, markerStartId, node); + + AtomicString markerMidId(style->markerMidResource()); + m_markerMid = getRenderSVGResourceById<RenderSVGResourceMarker>(document, markerMidId); + if (m_markerMid) + foundResources = true; + else + registerPendingResource(extensions, markerMidId, node); + + AtomicString markerEndId(style->markerEndResource()); + m_markerEnd = getRenderSVGResourceById<RenderSVGResourceMarker>(document, markerEndId); + if (m_markerEnd) + foundResources = true; + else + registerPendingResource(extensions, markerEndId, node); + } + + if (style->hasFill()) { + bool hasPendingResource = false; + AtomicString id; + m_fill = paintingResourceFromSVGPaint(document, style->fillPaint(), id, hasPendingResource); + if (m_fill) + foundResources = true; + else if (hasPendingResource) + registerPendingResource(extensions, id, node); + } + + if (style->hasStroke()) { + bool hasPendingResource = false; + AtomicString id; + m_stroke = paintingResourceFromSVGPaint(document, style->strokePaint(), id, hasPendingResource); + if (m_stroke) + foundResources = true; + else if (hasPendingResource) + registerPendingResource(extensions, id, node); + } + + return foundResources; +} + +void SVGResources::invalidateClient(RenderObject* object) const +{ + // Ordinary resources + if (m_clipper) + m_clipper->invalidateClient(object); +#if ENABLE(FILTERS) + if (m_filter) + m_filter->invalidateClient(object); +#endif + if (m_masker) + m_masker->invalidateClient(object); + if (m_markerStart) + m_markerStart->invalidateClient(object); + if (m_markerMid) + m_markerMid->invalidateClient(object); + if (m_markerEnd) + m_markerEnd->invalidateClient(object); + + // Paint servers + if (m_fill) + m_fill->invalidateClient(object); + if (m_stroke) + m_stroke->invalidateClient(object); +} + +void SVGResources::resourceDestroyed(RenderSVGResourceContainer* resource) +{ + ASSERT(resource); + + switch (resource->resourceType()) { + case MaskerResourceType: + if (m_masker == resource) { + m_masker->invalidateClients(); + m_masker = 0; + } + break; + case MarkerResourceType: + if (m_markerStart == resource) { + m_markerStart->invalidateClients(); + m_markerStart = 0; + } + + if (m_markerMid == resource) { + m_markerMid->invalidateClients(); + m_markerMid = 0; + } + + if (m_markerEnd == resource) { + m_markerEnd->invalidateClients(); + m_markerEnd = 0; + } + break; + case PatternResourceType: + case LinearGradientResourceType: + case RadialGradientResourceType: + if (m_fill == resource) { + m_fill->invalidateClients(); + m_fill = 0; + } + + if (m_stroke == resource) { + m_stroke->invalidateClients(); + m_stroke = 0; + } + break; +#if ENABLE(FILTERS) + case FilterResourceType: + if (m_filter == resource) { + m_filter->invalidateClients(); + m_filter = 0; + } + break; +#endif + case ClipperResourceType: + if (m_clipper == resource) { + m_clipper->invalidateClients(); + m_clipper = 0; + } + break; + case SolidColorResourceType: + ASSERT_NOT_REACHED(); + } +} + +void SVGResources::buildSetOfResources(HashSet<RenderSVGResourceContainer*>& set) +{ + // Ordinary resources + if (m_clipper) + set.add(m_clipper); +#if ENABLE(FILTERS) + if (m_filter) + set.add(m_filter); +#endif + if (m_markerStart) + set.add(m_markerStart); + if (m_markerMid) + set.add(m_markerMid); + if (m_markerEnd) + set.add(m_markerEnd); + if (m_masker) + set.add(m_masker); + + // Paint servers + if (m_fill) + set.add(m_fill); + if (m_stroke) + set.add(m_stroke); +} + +void SVGResources::resetClipper() +{ + ASSERT(m_clipper); + m_clipper = 0; +} + +#if ENABLE(FILTERS) +void SVGResources::resetFilter() +{ + ASSERT(m_filter); + m_filter = 0; +} +#endif + +void SVGResources::resetMarkerStart() +{ + ASSERT(m_markerStart); + m_markerStart = 0; +} + +void SVGResources::resetMarkerMid() +{ + ASSERT(m_markerMid); + m_markerMid = 0; +} + +void SVGResources::resetMarkerEnd() +{ + ASSERT(m_markerEnd); + m_markerEnd = 0; +} + +void SVGResources::resetMasker() +{ + ASSERT(m_masker); + m_masker = 0; +} + +void SVGResources::resetFill() +{ + ASSERT(m_fill); + m_fill = 0; +} + +void SVGResources::resetStroke() +{ + ASSERT(m_stroke); + m_stroke = 0; +} + +#ifndef NDEBUG +void SVGResources::dump(const RenderObject* object) +{ + ASSERT(object); + ASSERT(object->node()); + + fprintf(stderr, "-> this=%p, SVGResources(renderer=%p, node=%p)\n", this, object, object->node()); + fprintf(stderr, " | DOM Tree:\n"); + object->node()->showTreeForThis(); + + fprintf(stderr, "\n | List of resources:\n"); + if (m_clipper) + fprintf(stderr, " |-> Clipper : %p (node=%p)\n", m_clipper, m_clipper->node()); +#if ENABLE(FILTERS) + if (m_filter) + fprintf(stderr, " |-> Filter : %p (node=%p)\n", m_filter, m_filter->node()); +#endif + if (m_markerStart) + fprintf(stderr, " |-> MarkerStart: %p (node=%p)\n", m_markerStart, m_markerStart->node()); + if (m_markerMid) + fprintf(stderr, " |-> MarkerMid : %p (node=%p)\n", m_markerMid, m_markerMid->node()); + if (m_markerEnd) + fprintf(stderr, " |-> MarkerEnd : %p (node=%p)\n", m_markerEnd, m_markerEnd->node()); + if (m_masker) + fprintf(stderr, " |-> Masker : %p (node=%p)\n", m_masker, m_masker->node()); + if (m_fill) + fprintf(stderr, " |-> Fill : %p (node=%p)\n", m_fill, m_fill->node()); + if (m_stroke) + fprintf(stderr, " |-> Stroke : %p (node=%p)\n", m_stroke, m_stroke->node()); +} +#endif + +} + +#endif diff --git a/WebCore/rendering/SVGResources.h b/WebCore/rendering/SVGResources.h new file mode 100644 index 0000000..57a4140 --- /dev/null +++ b/WebCore/rendering/SVGResources.h @@ -0,0 +1,103 @@ +/* + Copyright (C) Research In Motion Limited 2010. All rights reserved. + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public + License as published by the Free Software Foundation; either + version 2 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public License + aint with this library; see the file COPYING.LIB. If not, write to + the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +#ifndef SVGResources_h +#define SVGResources_h + +#if ENABLE(SVG) +#include <wtf/HashSet.h> +#include <wtf/Noncopyable.h> + +namespace WebCore { + +class Document; +class RenderObject; +class RenderSVGResourceClipper; +class RenderSVGResourceContainer; +class RenderSVGResourceFilter; +class RenderSVGResourceMarker; +class RenderSVGResourceMasker; +class SVGRenderStyle; + +// Holds a set of resources associated with a RenderObject +class SVGResources { +public: + SVGResources(); + + bool buildCachedResources(const RenderObject*, const SVGRenderStyle*); + + // Ordinary resources + RenderSVGResourceClipper* clipper() const { return m_clipper; } +#if ENABLE(FILTERS) + RenderSVGResourceFilter* filter() const { return m_filter; } +#endif + RenderSVGResourceMarker* markerStart() const { return m_markerStart; } + RenderSVGResourceMarker* markerMid() const { return m_markerMid; } + RenderSVGResourceMarker* markerEnd() const { return m_markerEnd; } + RenderSVGResourceMasker* masker() const { return m_masker; } + + // Paint servers + RenderSVGResourceContainer* fill() const { return m_fill; } + RenderSVGResourceContainer* stroke() const { return m_stroke; } + + void buildSetOfResources(HashSet<RenderSVGResourceContainer*>&); + + // Methods operating on all cached resources + void invalidateClient(RenderObject*) const; + void resourceDestroyed(RenderSVGResourceContainer*); + +#ifndef NDEBUG + void dump(const RenderObject*); +#endif + +private: + friend class SVGResourcesCycleSolver; + + // Only used by SVGResourcesCache cycle detection logic + void resetClipper(); +#if ENABLE(FILTERS) + void resetFilter(); +#endif + void resetMarkerStart(); + void resetMarkerMid(); + void resetMarkerEnd(); + void resetMasker(); + void resetFill(); + void resetStroke(); + +private: + // Ordinary resources + RenderSVGResourceClipper* m_clipper; +#if ENABLE(FILTERS) + RenderSVGResourceFilter* m_filter; +#endif + RenderSVGResourceMarker* m_markerStart; + RenderSVGResourceMarker* m_markerMid; + RenderSVGResourceMarker* m_markerEnd; + RenderSVGResourceMasker* m_masker; + + // Paint servers + RenderSVGResourceContainer* m_fill; + RenderSVGResourceContainer* m_stroke; +}; + +} + +#endif +#endif diff --git a/WebCore/rendering/SVGResourcesCache.cpp b/WebCore/rendering/SVGResourcesCache.cpp new file mode 100644 index 0000000..46586cc --- /dev/null +++ b/WebCore/rendering/SVGResourcesCache.cpp @@ -0,0 +1,179 @@ +/* + Copyright (C) Research In Motion Limited 2010. All rights reserved. + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public + License as published by the Free Software Foundation; either + version 2 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public License + aint with this library; see the file COPYING.LIB. If not, write to + the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +#include "config.h" +#include "SVGResourcesCache.h" + +#if ENABLE(SVG) +#include "RenderSVGResourceContainer.h" +#include "SVGDocumentExtensions.h" +#include "SVGResources.h" +#include "SVGResourcesCycleSolver.h" + +namespace WebCore { + +SVGResourcesCache::SVGResourcesCache() +{ +} + +SVGResourcesCache::~SVGResourcesCache() +{ + if (m_cache.isEmpty()) + return; + + deleteAllValues(m_cache); + m_cache.clear(); +} + +void SVGResourcesCache::addResourcesFromRenderObject(RenderObject* object, const RenderStyle* style) +{ + ASSERT(object); + ASSERT(style); + ASSERT(!m_cache.contains(object)); + + const SVGRenderStyle* svgStyle = style->svgStyle(); + ASSERT(svgStyle); + + // Build a list of all resources associated with the passed RenderObject + SVGResources* resources = new SVGResources; + if (!resources->buildCachedResources(object, svgStyle)) { + delete resources; + return; + } + + // Put object in cache. + m_cache.set(object, resources); + + // Run cycle-detection _afterwards_, so self-references can be caught as well. + SVGResourcesCycleSolver solver(object, resources); + solver.resolveCycles(); + + // Walk resources and register the render object at each resources. + HashSet<RenderSVGResourceContainer*> resourceSet; + resources->buildSetOfResources(resourceSet); + + HashSet<RenderSVGResourceContainer*>::iterator end = resourceSet.end(); + for (HashSet<RenderSVGResourceContainer*>::iterator it = resourceSet.begin(); it != end; ++it) + (*it)->addClient(object); +} + +void SVGResourcesCache::removeResourcesFromRenderObject(RenderObject* object) +{ + if (!m_cache.contains(object)) + return; + + SVGResources* resources = m_cache.get(object); + + // Walk resources and register the render object at each resources. + HashSet<RenderSVGResourceContainer*> resourceSet; + resources->buildSetOfResources(resourceSet); + + HashSet<RenderSVGResourceContainer*>::iterator end = resourceSet.end(); + for (HashSet<RenderSVGResourceContainer*>::iterator it = resourceSet.begin(); it != end; ++it) + (*it)->removeClient(object); + + delete m_cache.take(object); +} + +static inline SVGResourcesCache* resourcesCacheFromRenderObject(RenderObject* renderer) +{ + Document* document = renderer->document(); + ASSERT(document); + + SVGDocumentExtensions* extensions = document->accessSVGExtensions(); + ASSERT(extensions); + + SVGResourcesCache* cache = extensions->resourcesCache(); + ASSERT(cache); + + return cache; +} + +SVGResources* SVGResourcesCache::cachedResourcesForRenderObject(RenderObject* renderer) +{ + ASSERT(renderer); + SVGResourcesCache* cache = resourcesCacheFromRenderObject(renderer); + if (!cache->m_cache.contains(renderer)) + return 0; + + return cache->m_cache.get(renderer); +} + +void SVGResourcesCache::clientLayoutChanged(RenderObject* object) +{ + SVGResources* resources = SVGResourcesCache::cachedResourcesForRenderObject(object); + if (!resources) + return; + + resources->invalidateClient(object); +} + +void SVGResourcesCache::clientStyleChanged(RenderObject* renderer, StyleDifference diff, const RenderStyle* newStyle) +{ + ASSERT(renderer); + if (diff == StyleDifferenceEqual) + return; + + clientUpdatedFromElement(renderer, newStyle); + + // Invalidate resources in ancestor chain, if needed. + RenderObject* parent = renderer->parent(); + while (parent) { + if (parent->isSVGResourceContainer()) { + parent->toRenderSVGResourceContainer()->invalidateClients(); + break; + } + + parent = parent->parent(); + } +} + +void SVGResourcesCache::clientUpdatedFromElement(RenderObject* renderer, const RenderStyle* newStyle) +{ + ASSERT(renderer); + ASSERT(renderer->parent()); + + SVGResourcesCache* cache = resourcesCacheFromRenderObject(renderer); + cache->removeResourcesFromRenderObject(renderer); + cache->addResourcesFromRenderObject(renderer, newStyle); +} + +void SVGResourcesCache::clientDestroyed(RenderObject* renderer) +{ + ASSERT(renderer); + SVGResourcesCache* cache = resourcesCacheFromRenderObject(renderer); + cache->removeResourcesFromRenderObject(renderer); +} + +void SVGResourcesCache::resourceDestroyed(RenderSVGResourceContainer* resource) +{ + ASSERT(resource); + SVGResourcesCache* cache = resourcesCacheFromRenderObject(resource); + + // The resource itself may have clients, that need to be notified. + cache->removeResourcesFromRenderObject(resource); + + HashMap<RenderObject*, SVGResources*>::iterator end = cache->m_cache.end(); + for (HashMap<RenderObject*, SVGResources*>::iterator it = cache->m_cache.begin(); it != end; ++it) + it->second->resourceDestroyed(resource); +} + +} + +#endif diff --git a/WebCore/rendering/SVGResourcesCache.h b/WebCore/rendering/SVGResourcesCache.h new file mode 100644 index 0000000..4a61570 --- /dev/null +++ b/WebCore/rendering/SVGResourcesCache.h @@ -0,0 +1,65 @@ +/* + Copyright (C) Research In Motion Limited 2010. All rights reserved. + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public + License as published by the Free Software Foundation; either + version 2 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public License + aint with this library; see the file COPYING.LIB. If not, write to + the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +#ifndef SVGResourcesCache_h +#define SVGResourcesCache_h + +#if ENABLE(SVG) +#include "RenderStyleConstants.h" +#include <wtf/HashMap.h> + +namespace WebCore { + +class RenderObject; +class RenderStyle; +class RenderSVGResourceContainer; +class SVGResources; + +class SVGResourcesCache : public Noncopyable { +public: + SVGResourcesCache(); + ~SVGResourcesCache(); + + void addResourcesFromRenderObject(RenderObject*, const RenderStyle*); + void removeResourcesFromRenderObject(RenderObject*); + static SVGResources* cachedResourcesForRenderObject(RenderObject*); + + // Called from all SVG renderers destroy() methods - except for RenderSVGResourceContainer. + static void clientDestroyed(RenderObject*); + + // Called from all SVG renderers layout() methods. + static void clientLayoutChanged(RenderObject*); + + // Called from all SVG renderers styleDidChange() methods. + static void clientStyleChanged(RenderObject*, StyleDifference, const RenderStyle* newStyle); + + // Called from all SVG renderers updateFromElement() methods. + static void clientUpdatedFromElement(RenderObject*, const RenderStyle* newStyle); + + // Called from RenderSVGResourceContainer::destroy(). + static void resourceDestroyed(RenderSVGResourceContainer*); + +private: + HashMap<RenderObject*, SVGResources*> m_cache; +}; + +} + +#endif +#endif diff --git a/WebCore/rendering/SVGResourcesCycleSolver.cpp b/WebCore/rendering/SVGResourcesCycleSolver.cpp new file mode 100644 index 0000000..838758b --- /dev/null +++ b/WebCore/rendering/SVGResourcesCycleSolver.cpp @@ -0,0 +1,296 @@ +/* + Copyright (C) Research In Motion Limited 2010. All rights reserved. + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public + License as published by the Free Software Foundation; either + version 2 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public License + aint with this library; see the file COPYING.LIB. If not, write to + the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +#include "config.h" +#include "SVGResourcesCycleSolver.h" + +// Set to a value > 0, to debug the resource cache. +#define DEBUG_CYCLE_DETECTION 0 + +#if ENABLE(SVG) +#include "RenderSVGResourceClipper.h" +#include "RenderSVGResourceFilter.h" +#include "RenderSVGResourceMarker.h" +#include "RenderSVGResourceMasker.h" +#include "SVGFilterElement.h" +#include "SVGGradientElement.h" +#include "SVGPatternElement.h" +#include "SVGResources.h" +#include "SVGResourcesCache.h" + +namespace WebCore { + +SVGResourcesCycleSolver::SVGResourcesCycleSolver(RenderObject* renderer, SVGResources* resources) + : m_renderer(renderer) + , m_resources(resources) +{ + ASSERT(m_renderer); + ASSERT(m_resources); +} + +SVGResourcesCycleSolver::~SVGResourcesCycleSolver() +{ +} + +bool SVGResourcesCycleSolver::resourceContainsCycles(RenderObject* renderer) const +{ + ASSERT(renderer); + + // First operate on the resources of the given renderer. + // <marker id="a"> <path marker-start="url(#b)"/> ... + // <marker id="b" marker-start="url(#a)"/> + if (SVGResources* resources = SVGResourcesCache::cachedResourcesForRenderObject(renderer)) { + HashSet<RenderSVGResourceContainer*> resourceSet; + resources->buildSetOfResources(resourceSet); + + // Walk all resources and check wheter they reference any resource contained in the resources set. + HashSet<RenderSVGResourceContainer*>::iterator end = resourceSet.end(); + for (HashSet<RenderSVGResourceContainer*>::iterator it = resourceSet.begin(); it != end; ++it) { + if (m_allResources.contains(*it)) + return true; + } + } + + // Then operate on the child resources of the given renderer. + // <marker id="a"> <path marker-start="url(#b)"/> ... + // <marker id="b"> <path marker-start="url(#a)"/> ... + for (RenderObject* child = renderer->firstChild(); child; child = child->nextSibling()) { + SVGResources* childResources = SVGResourcesCache::cachedResourcesForRenderObject(child); + if (!childResources) + continue; + + // A child of the given 'resource' contains resources. + HashSet<RenderSVGResourceContainer*> childSet; + childResources->buildSetOfResources(childSet); + + // Walk all child resources and check wheter they reference any resource contained in the resources set. + HashSet<RenderSVGResourceContainer*>::iterator end = childSet.end(); + for (HashSet<RenderSVGResourceContainer*>::iterator it = childSet.begin(); it != end; ++it) { + if (m_allResources.contains(*it)) + return true; + } + + // Walk children recursively, stop immediately if we found a cycle + if (resourceContainsCycles(child)) + return true; + } + + return false; +} + +static inline String targetReferenceFromResource(SVGElement* element, bool& isValid) +{ + String target; + if (element->hasTagName(SVGNames::patternTag)) + target = static_cast<SVGPatternElement*>(element)->href(); + else if (element->hasTagName(SVGNames::linearGradientTag) || element->hasTagName(SVGNames::radialGradientTag)) + target = static_cast<SVGGradientElement*>(element)->href(); + else if (element->hasTagName(SVGNames::filterTag)) + target = static_cast<SVGFilterElement*>(element)->href(); + else { + isValid = false; + return target; + } + + return SVGURIReference::getTarget(target); +} + +static inline void setFollowLinkForChainableResource(SVGElement*, bool) +{ + // FIXME: Enable once the follow-up patch for bug 43031 lands +} + +bool SVGResourcesCycleSolver::chainableResourceContainsCycles(RenderSVGResourceContainer* container) const +{ + ASSERT(container); + ASSERT(container->node()); + ASSERT(container->node()->isSVGElement()); + + // Chainable resources cycle detection is performed in the DOM tree. + SVGElement* element = static_cast<SVGElement*>(container->node()); + ASSERT(element); + + HashSet<SVGElement*> processedObjects; + + bool isValid = true; + String target = targetReferenceFromResource(element, isValid); + ASSERT(isValid); + + SVGElement* previousElement = element; + while (!target.isEmpty()) { + Node* targetNode = element->document()->getElementById(target); + if (!targetNode || !targetNode->isSVGElement()) + break; + + // Catch cylic chaining, otherwhise we'll run into an infinite loop here. + // <pattern id="foo" xlink:href="#bar"/> <pattern id="bar xlink:href="#foo"/> + SVGElement* targetElement = static_cast<SVGElement*>(targetNode); + + bool followLink = true; + if (processedObjects.contains(targetElement) || targetElement == element) + followLink = false; + + setFollowLinkForChainableResource(previousElement, followLink); + if (!followLink) + return false; + + previousElement = targetElement; + processedObjects.add(targetElement); + target = targetReferenceFromResource(targetElement, isValid); + if (!isValid) + break; + } + + // Couldn't find any direct cycle in the xlink:href chain, maybe there's an indirect one. + // <pattern id="foo" xlink:href="#bar"/> <pattern id="bar"> <rect fill="url(#foo)"... + HashSet<SVGElement*>::iterator end = processedObjects.end(); + for (HashSet<SVGElement*>::iterator it = processedObjects.begin(); it != end; ++it) { + RenderObject* renderer = (*it)->renderer(); + if (!renderer) + continue; + ASSERT(renderer->isSVGResourceContainer()); + if (m_allResources.contains(renderer->toRenderSVGResourceContainer())) + return true; + } + + return false; +} + +void SVGResourcesCycleSolver::resolveCycles() +{ + ASSERT(m_allResources.isEmpty()); + +#if DEBUG_CYCLE_DETECTION > 0 + fprintf(stderr, "\nBefore cycle detection:\n"); + m_resources->dump(m_renderer); +#endif + + // Stash all resources into a HashSet for the ease of traversing. + HashSet<RenderSVGResourceContainer*> localResources; + m_resources->buildSetOfResources(localResources); + ASSERT(!localResources.isEmpty()); + + // Add all parent resource containers to the HashSet. + HashSet<RenderSVGResourceContainer*> parentResources; + RenderObject* parent = m_renderer->parent(); + while (parent) { + if (parent->isSVGResourceContainer()) + parentResources.add(parent->toRenderSVGResourceContainer()); + parent = parent->parent(); + } + +#if DEBUG_CYCLE_DETECTION > 0 + fprintf(stderr, "\nDetecting wheter any resources references any of following objects:\n"); + { + fprintf(stderr, "Local resources:\n"); + HashSet<RenderSVGResourceContainer*>::iterator end = localResources.end(); + for (HashSet<RenderSVGResourceContainer*>::iterator it = localResources.begin(); it != end; ++it) + fprintf(stderr, "|> %s: object=%p (node=%p)\n", (*it)->renderName(), *it, (*it)->node()); + + fprintf(stderr, "Parent resources:\n"); + end = parentResources.end(); + for (HashSet<RenderSVGResourceContainer*>::iterator it = parentResources.begin(); it != end; ++it) + fprintf(stderr, "|> %s: object=%p (node=%p)\n", (*it)->renderName(), *it, (*it)->node()); + } +#endif + + // Build combined set of local and parent resources. + m_allResources = localResources; + HashSet<RenderSVGResourceContainer*>::iterator end = parentResources.end(); + for (HashSet<RenderSVGResourceContainer*>::iterator it = parentResources.begin(); it != end; ++it) + m_allResources.add(*it); + + ASSERT(!m_allResources.isEmpty()); + + // The job of this function is to determine wheter any of the 'resources' associated with the given 'renderer' + // references us (or wheter any of its kids references us) -> that's a cycle, we need to find and break it. + end = localResources.end(); + for (HashSet<RenderSVGResourceContainer*>::iterator it = localResources.begin(); it != end; ++it) { + RenderSVGResourceContainer* resource = *it; + + // Special handling for resources that can be chained using xlink:href - need to detect cycles as well! + switch (resource->resourceType()) { + case PatternResourceType: + case LinearGradientResourceType: + case RadialGradientResourceType: + case FilterResourceType: + if (chainableResourceContainsCycles(resource)) { + breakCycle(resource); + continue; + } + break; + default: + break; + } + + if (parentResources.contains(resource) || resourceContainsCycles(resource)) + breakCycle(resource); + } + +#if DEBUG_CYCLE_DETECTION > 0 + fprintf(stderr, "\nAfter cycle detection:\n"); + m_resources->dump(m_renderer); +#endif + + m_allResources.clear(); +} + +void SVGResourcesCycleSolver::breakCycle(RenderSVGResourceContainer* resourceLeadingToCycle) +{ + ASSERT(resourceLeadingToCycle); + switch (resourceLeadingToCycle->resourceType()) { + case MaskerResourceType: + ASSERT(resourceLeadingToCycle == m_resources->masker()); + m_resources->resetMasker(); + break; + case MarkerResourceType: + ASSERT(resourceLeadingToCycle == m_resources->markerStart() || resourceLeadingToCycle == m_resources->markerMid() || resourceLeadingToCycle == m_resources->markerEnd()); + if (m_resources->markerStart() == resourceLeadingToCycle) + m_resources->resetMarkerStart(); + if (m_resources->markerMid() == resourceLeadingToCycle) + m_resources->resetMarkerMid(); + if (m_resources->markerEnd() == resourceLeadingToCycle) + m_resources->resetMarkerEnd(); + break; + case PatternResourceType: + case LinearGradientResourceType: + case RadialGradientResourceType: + ASSERT(resourceLeadingToCycle == m_resources->fill() || resourceLeadingToCycle == m_resources->stroke()); + if (m_resources->fill() == resourceLeadingToCycle) + m_resources->resetFill(); + if (m_resources->stroke() == resourceLeadingToCycle) + m_resources->resetStroke(); + break; + case FilterResourceType: + ASSERT(resourceLeadingToCycle == m_resources->filter()); + m_resources->resetFilter(); + break; + case ClipperResourceType: + ASSERT(resourceLeadingToCycle == m_resources->clipper()); + m_resources->resetClipper(); + break; + case SolidColorResourceType: + ASSERT_NOT_REACHED(); + break; + } +} + +} + +#endif diff --git a/WebCore/rendering/SVGResourcesCycleSolver.h b/WebCore/rendering/SVGResourcesCycleSolver.h new file mode 100644 index 0000000..1f49354 --- /dev/null +++ b/WebCore/rendering/SVGResourcesCycleSolver.h @@ -0,0 +1,52 @@ +/* + Copyright (C) Research In Motion Limited 2010. All rights reserved. + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public + License as published by the Free Software Foundation; either + version 2 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public License + aint with this library; see the file COPYING.LIB. If not, write to + the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +#ifndef SVGResourcesCycleSolver_h +#define SVGResourcesCycleSolver_h + +#if ENABLE(SVG) +#include <wtf/HashSet.h> + +namespace WebCore { + +class RenderObject; +class RenderSVGResourceContainer; +class SVGResources; + +class SVGResourcesCycleSolver : public Noncopyable { +public: + SVGResourcesCycleSolver(RenderObject*, SVGResources*); + ~SVGResourcesCycleSolver(); + + void resolveCycles(); + +private: + bool resourceContainsCycles(RenderObject*) const; + bool chainableResourceContainsCycles(RenderSVGResourceContainer*) const; + void breakCycle(RenderSVGResourceContainer*); + + RenderObject* m_renderer; + SVGResources* m_resources; + HashSet<RenderSVGResourceContainer*> m_allResources; +}; + +} + +#endif +#endif diff --git a/WebCore/rendering/TextControlInnerElements.cpp b/WebCore/rendering/TextControlInnerElements.cpp index 24e1d74..b29876a 100644 --- a/WebCore/rendering/TextControlInnerElements.cpp +++ b/WebCore/rendering/TextControlInnerElements.cpp @@ -232,7 +232,13 @@ void SearchFieldCancelButtonElement::defaultEventHandler(Event* event) m_capturing = false; } if (hovered()) { + RefPtr<HTMLInputElement> protector(input); + String oldValue = input->value(); input->setValue(""); + if (!oldValue.isEmpty()) { + toRenderTextControl(input->renderer())->setChangedSinceLastChangeEvent(true); + input->dispatchEvent(Event::create(eventNames().inputEvent, true, false)); + } input->onSearch(); event->setDefaultHandled(); } @@ -374,7 +380,7 @@ void InputFieldSpeechButtonElement::defaultEventHandler(Event* event) m_capturing = false; } if (hovered()) { - speechInput()->startRecognition(); + speechInput()->startRecognition(this); event->setDefaultHandled(); } } @@ -386,17 +392,20 @@ void InputFieldSpeechButtonElement::defaultEventHandler(Event* event) SpeechInput* InputFieldSpeechButtonElement::speechInput() { - if (!m_speechInput) - m_speechInput.set(new SpeechInput(document()->page()->speechInputClient(), this)); - return m_speechInput.get(); + return document()->page()->speechInput(); } -void InputFieldSpeechButtonElement::recordingComplete() +void InputFieldSpeechButtonElement::didCompleteRecording() { // FIXME: Add UI feedback here to indicate that audio recording stopped and recognition is // in progress. } +void InputFieldSpeechButtonElement::didCompleteRecognition() +{ + // FIXME: Add UI feedback here to indicate that audio recognition has ended. +} + void InputFieldSpeechButtonElement::setRecognitionResult(const String& result) { HTMLInputElement* input = static_cast<HTMLInputElement*>(shadowAncestorNode()); diff --git a/WebCore/rendering/TextControlInnerElements.h b/WebCore/rendering/TextControlInnerElements.h index 68d6ff4..ed38221 100644 --- a/WebCore/rendering/TextControlInnerElements.h +++ b/WebCore/rendering/TextControlInnerElements.h @@ -124,7 +124,8 @@ public: virtual void defaultEventHandler(Event*); // SpeechInputListener methods. - void recordingComplete(); + void didCompleteRecording(); + void didCompleteRecognition(); void setRecognitionResult(const String& result); private: @@ -133,7 +134,6 @@ private: SpeechInput* speechInput(); bool m_capturing; - OwnPtr<SpeechInput> m_speechInput; }; #endif // ENABLE(INPUT_SPEECH) diff --git a/WebCore/rendering/break_lines.cpp b/WebCore/rendering/break_lines.cpp index 4b6c0aa..307fb6f 100644 --- a/WebCore/rendering/break_lines.cpp +++ b/WebCore/rendering/break_lines.cpp @@ -38,45 +38,94 @@ namespace WebCore { static inline bool isBreakableSpace(UChar ch, bool treatNoBreakSpaceAsBreak) { switch (ch) { - case ' ': - case '\n': - case '\t': - return true; - case noBreakSpace: - return treatNoBreakSpaceAsBreak; - default: - return false; + case ' ': + case '\n': + case '\t': + return true; + case noBreakSpace: + return treatNoBreakSpaceAsBreak; + default: + return false; } } -// This differs from the Unicode algorithm only in that Unicode does not break -// between a question mark and a vertical line (U+007C). -static const unsigned char internetExplorerLineBreaksAfterQuestionMarkTable[0x80] = { - 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1, // \t - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 0, 0, 1, 1, 1, 1, 0, 1, 0, 1, 1, 0, 1, 0, 0, // ! " ' ) , . / - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 1, 1, 1, 0, // : ; ? - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 1, // ] - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 1 // } +static const UChar asciiLineBreakTableFirstChar = '!'; +static const UChar asciiLineBreakTableLastChar = 127; + +// Pack 8 bits into one byte +#define B(a, b, c, d, e, f, g, h) \ + ((a) | ((b) << 1) | ((c) << 2) | ((d) << 3) | ((e) << 4) | ((f) << 5) | ((g) << 6) | ((h) << 7)) + +// Line breaking table row for each digit (0-9) +#define DI { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 } + +// Line breaking table row for ascii letters (a-z A-Z) +#define AL { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 } + +#define F 0xFF + +// Line breaking table for printable ASCII characters. Line breaking opportunities in this table are as below: +// - before openning punctuations such as '(', '<', '[', '{' after certain characters (compatible with Firefox 3.6); +// - after '-' and '?' (backward-compatible, and compatible with Internet Explorer). +// Please refer to <https://bugs.webkit.org/show_bug.cgi?id=37698> for line breaking matrixes of different browsers +// and the ICU standard. +static const unsigned char asciiLineBreakTable[][(asciiLineBreakTableLastChar - asciiLineBreakTableFirstChar) / 8 + 1] = { + // ! " # $ % & ' ( ) * + , - . / 0 1-8 9 : ; < = > ? @ A-X Y Z [ \ ] ^ _ ` a-x y z { | } ~ DEL + { B(0, 0, 0, 0, 0, 0, 0, 1), B(0, 0, 0, 0, 0, 0, 0, 0), 0, B(0, 0, 0, 1, 0, 0, 0, 0), 0, 0, 0, B(0, 0, 1, 0, 0, 0, 0, 0), 0, 0, 0, B(0, 0, 1, 0, 0, 0, 0, 0) }, // ! + { B(0, 0, 0, 0, 0, 0, 0, 1), B(0, 0, 0, 0, 0, 0, 0, 0), 0, B(0, 0, 0, 1, 0, 0, 0, 0), 0, 0, 0, B(0, 0, 1, 0, 0, 0, 0, 0), 0, 0, 0, B(0, 0, 1, 0, 0, 0, 0, 0) }, // " + { B(0, 0, 0, 0, 0, 0, 0, 1), B(0, 0, 0, 0, 0, 0, 0, 0), 0, B(0, 0, 0, 1, 0, 0, 0, 0), 0, 0, 0, B(0, 0, 1, 0, 0, 0, 0, 0), 0, 0, 0, B(0, 0, 1, 0, 0, 0, 0, 0) }, // # + { B(0, 0, 0, 0, 0, 0, 0, 0), B(0, 0, 0, 0, 0, 0, 0, 0), 0, B(0, 0, 0, 0, 0, 0, 0, 0), 0, 0, 0, B(0, 0, 0, 0, 0, 0, 0, 0), 0, 0, 0, B(0, 0, 0, 0, 0, 0, 0, 0) }, // $ + { B(0, 0, 0, 0, 0, 0, 0, 1), B(0, 0, 0, 0, 0, 0, 0, 0), 0, B(0, 0, 0, 1, 0, 0, 0, 0), 0, 0, 0, B(0, 0, 1, 0, 0, 0, 0, 0), 0, 0, 0, B(0, 0, 1, 0, 0, 0, 0, 0) }, // % + { B(0, 0, 0, 0, 0, 0, 0, 1), B(0, 0, 0, 0, 0, 0, 0, 0), 0, B(0, 0, 0, 1, 0, 0, 0, 0), 0, 0, 0, B(0, 0, 1, 0, 0, 0, 0, 0), 0, 0, 0, B(0, 0, 1, 0, 0, 0, 0, 0) }, // & + { B(0, 0, 0, 0, 0, 0, 0, 0), B(0, 0, 0, 0, 0, 0, 0, 0), 0, B(0, 0, 0, 0, 0, 0, 0, 0), 0, 0, 0, B(0, 0, 0, 0, 0, 0, 0, 0), 0, 0, 0, B(0, 0, 0, 0, 0, 0, 0, 0) }, // ' + { B(0, 0, 0, 0, 0, 0, 0, 0), B(0, 0, 0, 0, 0, 0, 0, 0), 0, B(0, 0, 0, 0, 0, 0, 0, 0), 0, 0, 0, B(0, 0, 0, 0, 0, 0, 0, 0), 0, 0, 0, B(0, 0, 0, 0, 0, 0, 0, 0) }, // ( + { B(0, 0, 0, 0, 0, 0, 0, 1), B(0, 0, 0, 0, 0, 0, 0, 0), 0, B(0, 0, 0, 1, 0, 0, 0, 0), 0, 0, 0, B(0, 0, 1, 0, 0, 0, 0, 0), 0, 0, 0, B(0, 0, 1, 0, 0, 0, 0, 0) }, // ) + { B(0, 0, 0, 0, 0, 0, 0, 1), B(0, 0, 0, 0, 0, 0, 0, 0), 0, B(0, 0, 0, 1, 0, 0, 0, 0), 0, 0, 0, B(0, 0, 1, 0, 0, 0, 0, 0), 0, 0, 0, B(0, 0, 1, 0, 0, 0, 0, 0) }, // * + { B(0, 0, 0, 0, 0, 0, 0, 1), B(0, 0, 0, 0, 0, 0, 0, 0), 0, B(0, 0, 0, 1, 0, 0, 0, 0), 0, 0, 0, B(0, 0, 1, 0, 0, 0, 0, 0), 0, 0, 0, B(0, 0, 1, 0, 0, 0, 0, 0) }, // + + { B(0, 0, 0, 0, 0, 0, 0, 1), B(0, 0, 0, 0, 0, 0, 0, 0), 0, B(0, 0, 0, 1, 0, 0, 0, 0), 0, 0, 0, B(0, 0, 1, 0, 0, 0, 0, 0), 0, 0, 0, B(0, 0, 1, 0, 0, 0, 0, 0) }, // , + { B(1, 1, 1, 1, 1, 1, 1, 1), B(1, 1, 1, 1, 1, 1, 1, 1), F, B(1, 1, 1, 1, 1, 1, 1, 1), F, F, F, B(1, 1, 1, 1, 1, 1, 1, 1), F, F, F, B(1, 1, 1, 1, 1, 1, 1, 1) }, // - + { B(0, 0, 0, 0, 0, 0, 0, 1), B(0, 0, 0, 0, 0, 0, 0, 0), 0, B(0, 0, 0, 1, 0, 0, 0, 0), 0, 0, 0, B(0, 0, 1, 0, 0, 0, 0, 0), 0, 0, 0, B(0, 0, 1, 0, 0, 0, 0, 0) }, // . + { B(0, 0, 0, 0, 0, 0, 0, 0), B(0, 0, 0, 0, 0, 0, 0, 0), 0, B(0, 0, 0, 0, 0, 0, 0, 0), 0, 0, 0, B(0, 0, 0, 0, 0, 0, 0, 0), 0, 0, 0, B(0, 0, 0, 0, 0, 0, 0, 0) }, // / + DI, DI, DI, DI, DI, DI, DI, DI, DI, DI, // 0-9 + { B(0, 0, 0, 0, 0, 0, 0, 1), B(0, 0, 0, 0, 0, 0, 0, 0), 0, B(0, 0, 0, 1, 0, 0, 0, 0), 0, 0, 0, B(0, 0, 1, 0, 0, 0, 0, 0), 0, 0, 0, B(0, 0, 1, 0, 0, 0, 0, 0) }, // : + { B(0, 0, 0, 0, 0, 0, 0, 1), B(0, 0, 0, 0, 0, 0, 0, 0), 0, B(0, 0, 0, 1, 0, 0, 0, 0), 0, 0, 0, B(0, 0, 1, 0, 0, 0, 0, 0), 0, 0, 0, B(0, 0, 1, 0, 0, 0, 0, 0) }, // ; + { B(0, 0, 0, 0, 0, 0, 0, 0), B(0, 0, 0, 0, 0, 0, 0, 0), 0, B(0, 0, 0, 0, 0, 0, 0, 0), 0, 0, 0, B(0, 0, 0, 0, 0, 0, 0, 0), 0, 0, 0, B(0, 0, 0, 0, 0, 0, 0, 0) }, // < + { B(0, 0, 0, 0, 0, 0, 0, 1), B(0, 0, 0, 0, 0, 0, 0, 0), 0, B(0, 0, 0, 1, 0, 0, 0, 0), 0, 0, 0, B(0, 0, 1, 0, 0, 0, 0, 0), 0, 0, 0, B(0, 0, 1, 0, 0, 0, 0, 0) }, // = + { B(0, 0, 0, 0, 0, 0, 0, 1), B(0, 0, 0, 0, 0, 0, 0, 0), 0, B(0, 0, 0, 1, 0, 0, 0, 0), 0, 0, 0, B(0, 0, 1, 0, 0, 0, 0, 0), 0, 0, 0, B(0, 0, 1, 0, 0, 0, 0, 0) }, // > + { B(0, 0, 1, 1, 1, 1, 0, 1), B(0, 1, 1, 0, 1, 0, 0, 1), F, B(1, 0, 0, 1, 1, 1, 0, 1), F, F, F, B(1, 1, 1, 1, 0, 1, 1, 1), F, F, F, B(1, 1, 1, 1, 0, 1, 1, 0) }, // ? + { B(0, 0, 0, 0, 0, 0, 0, 0), B(0, 0, 0, 0, 0, 0, 0, 0), 0, B(0, 0, 0, 0, 0, 0, 0, 0), 0, 0, 0, B(0, 0, 0, 0, 0, 0, 0, 0), 0, 0, 0, B(0, 0, 0, 0, 0, 0, 0, 0) }, // @ + AL, AL, AL, AL, AL, AL, AL, AL, AL, AL, AL, AL, AL, AL, AL, AL, AL, AL, AL, AL, AL, AL, AL, AL, AL, AL, // A-Z + { B(0, 0, 0, 0, 0, 0, 0, 0), B(0, 0, 0, 0, 0, 0, 0, 0), 0, B(0, 0, 0, 0, 0, 0, 0, 0), 0, 0, 0, B(0, 0, 0, 0, 0, 0, 0, 0), 0, 0, 0, B(0, 0, 0, 0, 0, 0, 0, 0) }, // [ + { B(0, 0, 0, 0, 0, 0, 0, 1), B(0, 0, 0, 0, 0, 0, 0, 0), 0, B(0, 0, 0, 1, 0, 0, 0, 0), 0, 0, 0, B(0, 0, 1, 0, 0, 0, 0, 0), 0, 0, 0, B(0, 0, 1, 0, 0, 0, 0, 0) }, // '\' + { B(0, 0, 0, 0, 0, 0, 0, 1), B(0, 0, 0, 0, 0, 0, 0, 0), 0, B(0, 0, 0, 1, 0, 0, 0, 0), 0, 0, 0, B(0, 0, 1, 0, 0, 0, 0, 0), 0, 0, 0, B(0, 0, 1, 0, 0, 0, 0, 0) }, // ] + { B(0, 0, 0, 0, 0, 0, 0, 0), B(0, 0, 0, 0, 0, 0, 0, 0), 0, B(0, 0, 0, 0, 0, 0, 0, 0), 0, 0, 0, B(0, 0, 0, 0, 0, 0, 0, 0), 0, 0, 0, B(0, 0, 0, 0, 0, 0, 0, 0) }, // ^ + { B(0, 0, 0, 0, 0, 0, 0, 0), B(0, 0, 0, 0, 0, 0, 0, 0), 0, B(0, 0, 0, 0, 0, 0, 0, 0), 0, 0, 0, B(0, 0, 0, 0, 0, 0, 0, 0), 0, 0, 0, B(0, 0, 0, 0, 0, 0, 0, 0) }, // _ + { B(0, 0, 0, 0, 0, 0, 0, 0), B(0, 0, 0, 0, 0, 0, 0, 0), 0, B(0, 0, 0, 0, 0, 0, 0, 0), 0, 0, 0, B(0, 0, 0, 0, 0, 0, 0, 0), 0, 0, 0, B(0, 0, 0, 0, 0, 0, 0, 0) }, // ` + AL, AL, AL, AL, AL, AL, AL, AL, AL, AL, AL, AL, AL, AL, AL, AL, AL, AL, AL, AL, AL, AL, AL, AL, AL, AL, // a-z + { B(0, 0, 0, 0, 0, 0, 0, 0), B(0, 0, 0, 0, 0, 0, 0, 0), 0, B(0, 0, 0, 0, 0, 0, 0, 0), 0, 0, 0, B(0, 0, 0, 0, 0, 0, 0, 0), 0, 0, 0, B(0, 0, 0, 0, 0, 0, 0, 0) }, // { + { B(0, 0, 0, 0, 0, 0, 0, 1), B(0, 0, 0, 0, 0, 0, 0, 0), 0, B(0, 0, 0, 1, 0, 0, 0, 0), 0, 0, 0, B(0, 0, 1, 0, 0, 0, 0, 0), 0, 0, 0, B(0, 0, 1, 0, 0, 0, 0, 0) }, // | + { B(0, 0, 0, 0, 0, 0, 0, 1), B(0, 0, 0, 0, 0, 0, 0, 0), 0, B(0, 0, 0, 1, 0, 0, 0, 0), 0, 0, 0, B(0, 0, 1, 0, 0, 0, 0, 0), 0, 0, 0, B(0, 0, 1, 0, 0, 0, 0, 0) }, // } + { B(0, 0, 0, 0, 0, 0, 0, 1), B(0, 0, 0, 0, 0, 0, 0, 0), 0, B(0, 0, 0, 1, 0, 0, 0, 0), 0, 0, 0, B(0, 0, 1, 0, 0, 0, 0, 0), 0, 0, 0, B(0, 0, 1, 0, 0, 0, 0, 0) }, // ~ + { B(0, 0, 0, 0, 0, 0, 0, 0), B(0, 0, 0, 0, 0, 0, 0, 0), 0, B(0, 0, 0, 0, 0, 0, 0, 0), 0, 0, 0, B(0, 0, 0, 0, 0, 0, 0, 0), 0, 0, 0, B(0, 0, 0, 0, 0, 0, 0, 0) }, // DEL }; -static const size_t internetExplorerLineBreaksAfterQuestionMarkTableSize = sizeof(internetExplorerLineBreaksAfterQuestionMarkTable) / sizeof(*internetExplorerLineBreaksAfterQuestionMarkTable); +#undef B +#undef F +#undef DI +#undef AL + +COMPILE_ASSERT(sizeof(asciiLineBreakTable) / sizeof(asciiLineBreakTable[0]) == asciiLineBreakTableLastChar - asciiLineBreakTableFirstChar + 1, + TestLineBreakTableConsistency); static inline bool shouldBreakAfter(UChar ch, UChar nextCh) { switch (ch) { - // For a question mark preceding a non-ASCII characters, defer to the Unicode algorithm by returning false. - // For ASCII characters, use a lookup table for enhanced speed and for compatibility with Internet Explorer. - case '?': - return nextCh < internetExplorerLineBreaksAfterQuestionMarkTableSize && internetExplorerLineBreaksAfterQuestionMarkTable[nextCh]; - // Internet Explorer always allows breaking after a hyphen. - case '-': - case softHyphen: + case ideographicComma: + case ideographicFullStop: // FIXME: cases for ideographicComma and ideographicFullStop are a workaround for an issue in Unicode 5.0 // which is likely to be resolved in Unicode 5.1 <http://bugs.webkit.org/show_bug.cgi?id=17411>. // We may want to remove or conditionalize this workaround at some point. +<<<<<<< HEAD case ideographicComma: case ideographicFullStop: #ifdef ANDROID_LAYOUT @@ -86,12 +135,26 @@ static inline bool shouldBreakAfter(UChar ch, UChar nextCh) return true; default: return false; +======= + return true; + default: + // If both ch and nextCh are ASCII characters, use a lookup table for enhanced speed and for compatibility + // with other browsers (see comments for asciiLineBreakTable for details). + if (ch >= asciiLineBreakTableFirstChar && ch <= asciiLineBreakTableLastChar + && nextCh >= asciiLineBreakTableFirstChar && nextCh <= asciiLineBreakTableLastChar) { + const unsigned char* tableRow = asciiLineBreakTable[ch - asciiLineBreakTableFirstChar]; + int nextChIndex = nextCh - asciiLineBreakTableFirstChar; + return tableRow[nextChIndex / 8] & (1 << (nextChIndex % 8)); + } + // Otherwise defer to the Unicode algorithm by returning false. + return false; +>>>>>>> webkit.org at r64264 } } static inline bool needsLineBreakIterator(UChar ch) { - return ch > 0x7F && ch != noBreakSpace; + return ch > asciiLineBreakTableLastChar && ch != noBreakSpace; } #if PLATFORM(MAC) && defined(BUILDING_ON_TIGER) diff --git a/WebCore/storage/DatabaseAuthorizer.cpp b/WebCore/storage/DatabaseAuthorizer.cpp index 17abebd..79e47d4 100644 --- a/WebCore/storage/DatabaseAuthorizer.cpp +++ b/WebCore/storage/DatabaseAuthorizer.cpp @@ -29,7 +29,6 @@ #include "config.h" #include "DatabaseAuthorizer.h" -#if ENABLE(DATABASE) #include "PlatformString.h" #include <wtf/PassRefPtr.h> @@ -420,5 +419,3 @@ int DatabaseAuthorizer::updateDeletesBasedOnTableName(const String& tableName) } } // namespace WebCore - -#endif // ENABLE(DATABASE) diff --git a/WebCore/storage/IDBDatabaseImpl.cpp b/WebCore/storage/IDBDatabaseImpl.cpp index 712830a..162efab 100644 --- a/WebCore/storage/IDBDatabaseImpl.cpp +++ b/WebCore/storage/IDBDatabaseImpl.cpp @@ -68,7 +68,7 @@ void IDBDatabaseImpl::createObjectStore(const String& name, const String& keyPat PassRefPtr<IDBObjectStore> IDBDatabaseImpl::objectStore(const String& name, unsigned short mode) { // FIXME: If no transaction is running, this should implicitly start one. - ASSERT(!mode); // FIXME: Handle non-standard modes. + ASSERT_UNUSED(mode, !mode); // FIXME: Handle non-standard modes. return m_objectStores.get(name); } diff --git a/WebCore/storage/IDBKeyRange.cpp b/WebCore/storage/IDBKeyRange.cpp index 9f22fc8..dfcae19 100644 --- a/WebCore/storage/IDBKeyRange.cpp +++ b/WebCore/storage/IDBKeyRange.cpp @@ -26,20 +26,42 @@ #include "config.h" #include "IDBKeyRange.h" -#include "IDBAny.h" -#include "SerializedScriptValue.h" +#include "IDBKey.h" #if ENABLE(INDEXED_DATABASE) namespace WebCore { -IDBKeyRange::IDBKeyRange(PassRefPtr<SerializedScriptValue> left, PassRefPtr<SerializedScriptValue> right, unsigned short flags) +IDBKeyRange::IDBKeyRange(PassRefPtr<IDBKey> left, PassRefPtr<IDBKey> right, unsigned short flags) : m_left(left) , m_right(right) , m_flags(flags) { } +PassRefPtr<IDBKeyRange> IDBKeyRange::only(PassRefPtr<IDBKey> prpValue) +{ + RefPtr<IDBKey> value = prpValue; + return IDBKeyRange::create(value, value, IDBKeyRange::SINGLE); +} + +PassRefPtr<IDBKeyRange> IDBKeyRange::leftBound(PassRefPtr<IDBKey> bound, bool open) +{ + return IDBKeyRange::create(bound, IDBKey::create(), open ? IDBKeyRange::LEFT_OPEN : IDBKeyRange::LEFT_BOUND); +} + +PassRefPtr<IDBKeyRange> IDBKeyRange::rightBound(PassRefPtr<IDBKey> bound, bool open) +{ + return IDBKeyRange::create(IDBKey::create(), bound, open ? IDBKeyRange::RIGHT_OPEN : IDBKeyRange::RIGHT_BOUND); +} + +PassRefPtr<IDBKeyRange> IDBKeyRange::bound(PassRefPtr<IDBKey> left, PassRefPtr<IDBKey> right, bool openLeft, bool openRight) +{ + unsigned short flags = openLeft ? IDBKeyRange::LEFT_OPEN : IDBKeyRange::LEFT_BOUND; + flags |= openRight ? IDBKeyRange::RIGHT_OPEN : IDBKeyRange::RIGHT_BOUND; + return IDBKeyRange::create(left, right, flags); +} + } // namespace WebCore #endif // ENABLE(INDEXED_DATABASE) diff --git a/WebCore/storage/IDBKeyRange.h b/WebCore/storage/IDBKeyRange.h index 52239e4..9ce07af 100644 --- a/WebCore/storage/IDBKeyRange.h +++ b/WebCore/storage/IDBKeyRange.h @@ -28,8 +28,7 @@ #if ENABLE(INDEXED_DATABASE) -#include "IDBAny.h" -#include "SerializedScriptValue.h" +#include "IDBKey.h" #include <wtf/PassRefPtr.h> #include <wtf/RefCounted.h> @@ -46,22 +45,26 @@ public: RIGHT_BOUND = 8, }; - static PassRefPtr<IDBKeyRange> create(PassRefPtr<SerializedScriptValue> left, PassRefPtr<SerializedScriptValue> right, unsigned short flags) + static PassRefPtr<IDBKeyRange> create(PassRefPtr<IDBKey> left, PassRefPtr<IDBKey> right, unsigned short flags) { return adoptRef(new IDBKeyRange(left, right, flags)); } ~IDBKeyRange() { } - PassRefPtr<IDBAny> left() const { return IDBAny::create(m_left.get()); } - PassRefPtr<IDBAny> right() const { return IDBAny::create(m_right.get()); } + PassRefPtr<IDBKey> left() const { return m_left; } + PassRefPtr<IDBKey> right() const { return m_right; } unsigned short flags() const { return m_flags; } + static PassRefPtr<IDBKeyRange> only(PassRefPtr<IDBKey> value); + static PassRefPtr<IDBKeyRange> leftBound(PassRefPtr<IDBKey> bound, bool open = false); + static PassRefPtr<IDBKeyRange> rightBound(PassRefPtr<IDBKey> bound, bool open = false); + static PassRefPtr<IDBKeyRange> bound(PassRefPtr<IDBKey> left, PassRefPtr<IDBKey> right, bool openLeft = false, bool openRight = false); private: - IDBKeyRange(PassRefPtr<SerializedScriptValue> left, PassRefPtr<SerializedScriptValue> right, unsigned short flags); + IDBKeyRange(PassRefPtr<IDBKey> left, PassRefPtr<IDBKey> right, unsigned short flags); - RefPtr<SerializedScriptValue> m_left; - RefPtr<SerializedScriptValue> m_right; + RefPtr<IDBKey> m_left; + RefPtr<IDBKey> m_right; unsigned short m_flags; }; diff --git a/WebCore/storage/IDBKeyRange.idl b/WebCore/storage/IDBKeyRange.idl index 05f6505..6daaec1 100644 --- a/WebCore/storage/IDBKeyRange.idl +++ b/WebCore/storage/IDBKeyRange.idl @@ -35,9 +35,14 @@ module storage { const unsigned short LEFT_BOUND = 4; const unsigned short RIGHT_BOUND = 8; - readonly attribute IDBAny left; - readonly attribute IDBAny right; + readonly attribute IDBKey left; + readonly attribute IDBKey right; readonly attribute unsigned short flags; + + IDBKeyRange only(in IDBKey value); + IDBKeyRange leftBound(in IDBKey bound, in [Optional] boolean open); + IDBKeyRange rightBound(in IDBKey bound, in [Optional] boolean open); + IDBKeyRange bound(in IDBKey left, in IDBKey right, in [Optional] boolean openLeft, in [Optional] boolean openRight); }; } diff --git a/WebCore/storage/IndexedDatabaseRequest.cpp b/WebCore/storage/IndexedDatabaseRequest.cpp index 45ae1bd..c1c5515 100644 --- a/WebCore/storage/IndexedDatabaseRequest.cpp +++ b/WebCore/storage/IndexedDatabaseRequest.cpp @@ -68,29 +68,6 @@ PassRefPtr<IDBRequest> IndexedDatabaseRequest::open(ScriptExecutionContext* cont return request; } -PassRefPtr<IDBKeyRange> IndexedDatabaseRequest::makeSingleKeyRange(PassRefPtr<SerializedScriptValue> prpValue) -{ - RefPtr<SerializedScriptValue> value = prpValue; - return IDBKeyRange::create(value, value, IDBKeyRange::SINGLE); -} - -PassRefPtr<IDBKeyRange> IndexedDatabaseRequest::makeLeftBoundKeyRange(PassRefPtr<SerializedScriptValue> bound, bool open) -{ - return IDBKeyRange::create(bound, SerializedScriptValue::create(), open ? IDBKeyRange::LEFT_OPEN : IDBKeyRange::LEFT_BOUND); -} - -PassRefPtr<IDBKeyRange> IndexedDatabaseRequest::makeRightBoundKeyRange(PassRefPtr<SerializedScriptValue> bound, bool open) -{ - return IDBKeyRange::create(SerializedScriptValue::create(), bound, open ? IDBKeyRange::RIGHT_OPEN : IDBKeyRange::RIGHT_BOUND); -} - -PassRefPtr<IDBKeyRange> IndexedDatabaseRequest::makeBoundKeyRange(PassRefPtr<SerializedScriptValue> left, PassRefPtr<SerializedScriptValue> right, bool openLeft, bool openRight) -{ - unsigned short flags = openLeft ? IDBKeyRange::LEFT_OPEN : IDBKeyRange::LEFT_BOUND; - flags |= openRight ? IDBKeyRange::RIGHT_OPEN : IDBKeyRange::RIGHT_BOUND; - return IDBKeyRange::create(left, right, flags); -} - } // namespace WebCore #endif // ENABLE(INDEXED_DATABASE) diff --git a/WebCore/storage/IndexedDatabaseRequest.h b/WebCore/storage/IndexedDatabaseRequest.h index f505d9d..57f8a78 100644 --- a/WebCore/storage/IndexedDatabaseRequest.h +++ b/WebCore/storage/IndexedDatabaseRequest.h @@ -39,12 +39,11 @@ namespace WebCore { -class IDBAny; +class IDBKey; class IDBKeyRange; class IDBRequest; class IndexedDatabase; class ScriptExecutionContext; -class SerializedScriptValue; class IndexedDatabaseRequest : public RefCounted<IndexedDatabaseRequest> { public: @@ -55,10 +54,6 @@ public: ~IndexedDatabaseRequest(); PassRefPtr<IDBRequest> open(ScriptExecutionContext*, const String& name, const String& description); - PassRefPtr<IDBKeyRange> makeSingleKeyRange(PassRefPtr<SerializedScriptValue> value); - PassRefPtr<IDBKeyRange> makeLeftBoundKeyRange(PassRefPtr<SerializedScriptValue> bound, bool open = false); - PassRefPtr<IDBKeyRange> makeRightBoundKeyRange(PassRefPtr<SerializedScriptValue> bound, bool open = false); - PassRefPtr<IDBKeyRange> makeBoundKeyRange(PassRefPtr<SerializedScriptValue> left, PassRefPtr<SerializedScriptValue> right, bool openLeft = false, bool openRight = false); private: IndexedDatabaseRequest(IndexedDatabase*); diff --git a/WebCore/storage/IndexedDatabaseRequest.idl b/WebCore/storage/IndexedDatabaseRequest.idl index 502e804..e6ee446 100644 --- a/WebCore/storage/IndexedDatabaseRequest.idl +++ b/WebCore/storage/IndexedDatabaseRequest.idl @@ -29,10 +29,6 @@ module storage { Conditional=INDEXED_DATABASE ] IndexedDatabaseRequest { [CallWith=ScriptExecutionContext] IDBRequest open(in DOMString name, in DOMString description); - IDBKeyRange makeSingleKeyRange(in SerializedScriptValue value); - IDBKeyRange makeLeftBoundKeyRange(in SerializedScriptValue bound, in [Optional] boolean open); - IDBKeyRange makeRightBoundKeyRange(in SerializedScriptValue bound, in [Optional] boolean open); - IDBKeyRange makeBoundKeyRange(in SerializedScriptValue left, in SerializedScriptValue right, in [Optional] boolean openLeft, in [Optional] boolean openRight); }; } diff --git a/WebCore/storage/SQLTransaction.cpp b/WebCore/storage/SQLTransaction.cpp index decdf24..e43d844 100644 --- a/WebCore/storage/SQLTransaction.cpp +++ b/WebCore/storage/SQLTransaction.cpp @@ -292,8 +292,7 @@ void SQLTransaction::deliverTransactionCallback() m_executeSqlAllowed = true; shouldDeliverErrorCallback = !m_callback->handleEvent(m_database->scriptExecutionContext(), this); m_executeSqlAllowed = false; - } else - shouldDeliverErrorCallback = true; + } // Transaction Step 5 - If the transaction callback was null or raised an exception, jump to the error callback if (shouldDeliverErrorCallback) { diff --git a/WebCore/storage/SQLTransactionSync.cpp b/WebCore/storage/SQLTransactionSync.cpp index af98f8f..883721c 100644 --- a/WebCore/storage/SQLTransactionSync.cpp +++ b/WebCore/storage/SQLTransactionSync.cpp @@ -150,7 +150,7 @@ ExceptionCode SQLTransactionSync::begin() ExceptionCode SQLTransactionSync::execute() { ASSERT(m_database->scriptExecutionContext()->isContextThread()); - if (!m_database->opened() || !m_callback || !m_callback->handleEvent(m_database->scriptExecutionContext(), this)) { + if (!m_database->opened() || (m_callback && !m_callback->handleEvent(m_database->scriptExecutionContext(), this))) { m_callback = 0; return SQLException::UNKNOWN_ERR; } diff --git a/WebCore/storage/chromium/DatabaseObserver.h b/WebCore/storage/chromium/DatabaseObserver.h index e2e5184..96b5972 100644 --- a/WebCore/storage/chromium/DatabaseObserver.h +++ b/WebCore/storage/chromium/DatabaseObserver.h @@ -31,6 +31,8 @@ #ifndef DatabaseObserver_h #define DatabaseObserver_h +#if ENABLE(DATABASE) + namespace WebCore { class AbstractDatabase; @@ -49,4 +51,6 @@ public: } +#endif // ENABLE(DATABASE) + #endif // DatabaseObserver_h diff --git a/WebCore/storage/chromium/DatabaseTrackerChromium.cpp b/WebCore/storage/chromium/DatabaseTrackerChromium.cpp index 7d9c4de..aad4ed9 100644 --- a/WebCore/storage/chromium/DatabaseTrackerChromium.cpp +++ b/WebCore/storage/chromium/DatabaseTrackerChromium.cpp @@ -31,6 +31,8 @@ #include "config.h" #include "DatabaseTracker.h" +#if ENABLE(DATABASE) + #include "AbstractDatabase.h" #include "DatabaseObserver.h" #include "QuotaTracker.h" @@ -173,3 +175,5 @@ unsigned long long DatabaseTracker::getMaxSizeForDatabase(const AbstractDatabase } } + +#endif // ENABLE(DATABASE) diff --git a/WebCore/storage/chromium/QuotaTracker.cpp b/WebCore/storage/chromium/QuotaTracker.cpp index 9e64942..3f48682 100644 --- a/WebCore/storage/chromium/QuotaTracker.cpp +++ b/WebCore/storage/chromium/QuotaTracker.cpp @@ -31,8 +31,9 @@ #include "config.h" #include "QuotaTracker.h" +#if ENABLE(DATABASE) + #include <wtf/StdLibExtras.h> -#include <wtf/text/CString.h> namespace WebCore { @@ -67,3 +68,5 @@ void QuotaTracker::updateDatabaseSizeAndSpaceAvailableToOrigin( } } + +#endif // ENABLE(DATABASE) diff --git a/WebCore/storage/chromium/QuotaTracker.h b/WebCore/storage/chromium/QuotaTracker.h index 41c27fe..b913563 100644 --- a/WebCore/storage/chromium/QuotaTracker.h +++ b/WebCore/storage/chromium/QuotaTracker.h @@ -31,10 +31,12 @@ #ifndef QuotaTracker_h #define QuotaTracker_h +#if ENABLE(DATABASE) + +#include "PlatformString.h" #include "SecurityOrigin.h" #include "StringHash.h" #include <wtf/HashMap.h> -#include <wtf/text/CString.h> namespace WebCore { @@ -60,4 +62,6 @@ private: } +#endif // ENABLE(DATABASE) + #endif // QuotaTracker_h diff --git a/WebCore/storage/chromium/SQLTransactionClientChromium.cpp b/WebCore/storage/chromium/SQLTransactionClientChromium.cpp index 22d95e6..6a10821 100644 --- a/WebCore/storage/chromium/SQLTransactionClientChromium.cpp +++ b/WebCore/storage/chromium/SQLTransactionClientChromium.cpp @@ -31,6 +31,8 @@ #include "config.h" #include "SQLTransactionClient.h" +#if ENABLE(DATABASE) + #include "AbstractDatabase.h" #include "DatabaseObserver.h" #include "ScriptExecutionContext.h" @@ -83,3 +85,5 @@ bool SQLTransactionClient::didExceedQuota(AbstractDatabase* database) } } + +#endif // ENABLE(DATABASE) diff --git a/WebCore/svg/SVGDocumentExtensions.cpp b/WebCore/svg/SVGDocumentExtensions.cpp index bc4d6e8..325bcc7 100644 --- a/WebCore/svg/SVGDocumentExtensions.cpp +++ b/WebCore/svg/SVGDocumentExtensions.cpp @@ -34,16 +34,17 @@ #include "Frame.h" #include "FrameLoader.h" #include "Page.h" +#include "SMILTimeContainer.h" #include "SVGSMILElement.h" #include "SVGSVGElement.h" -#include "SMILTimeContainer.h" -#include "ScriptableDocumentParser.h" #include "ScriptController.h" +#include "ScriptableDocumentParser.h" namespace WebCore { SVGDocumentExtensions::SVGDocumentExtensions(Document* doc) : m_doc(doc) + , m_resourcesCache(new SVGResourcesCache) { } diff --git a/WebCore/svg/SVGDocumentExtensions.h b/WebCore/svg/SVGDocumentExtensions.h index d31536c..bfe48d1 100644 --- a/WebCore/svg/SVGDocumentExtensions.h +++ b/WebCore/svg/SVGDocumentExtensions.h @@ -25,6 +25,7 @@ #if ENABLE(SVG) #include "AtomicStringHash.h" +#include "SVGResourcesCache.h" #include "StringImpl.h" #include <wtf/HashMap.h> #include <wtf/HashSet.h> @@ -59,11 +60,14 @@ public: void reportWarning(const String&); void reportError(const String&); + SVGResourcesCache* resourcesCache() const { return m_resourcesCache.get(); } + private: Document* m_doc; // weak reference HashSet<SVGSVGElement*> m_timeContainers; // For SVG 1.2 support this will need to be made more general. HashMap<AtomicString, RenderSVGResourceContainer*> m_resources; HashMap<AtomicString, HashSet<SVGStyledElement*>*> m_pendingResources; + OwnPtr<SVGResourcesCache> m_resourcesCache; SVGDocumentExtensions(const SVGDocumentExtensions&); SVGDocumentExtensions& operator=(const SVGDocumentExtensions&); diff --git a/WebCore/svg/SVGFEDiffuseLightingElement.cpp b/WebCore/svg/SVGFEDiffuseLightingElement.cpp index fdb3b52..1bb274d 100644 --- a/WebCore/svg/SVGFEDiffuseLightingElement.cpp +++ b/WebCore/svg/SVGFEDiffuseLightingElement.cpp @@ -66,6 +66,18 @@ void SVGFEDiffuseLightingElement::parseMappedAttribute(Attribute* attr) SVGFilterPrimitiveStandardAttributes::parseMappedAttribute(attr); } +void SVGFEDiffuseLightingElement::svgAttributeChanged(const QualifiedName& attrName) +{ + SVGFilterPrimitiveStandardAttributes::svgAttributeChanged(attrName); + + if (attrName == SVGNames::inAttr + || attrName == SVGNames::surfaceScaleAttr + || attrName == SVGNames::diffuseConstantAttr + || attrName == SVGNames::kernelUnitLengthAttr + || attrName == SVGNames::lighting_colorAttr) + invalidateFilter(); +} + void SVGFEDiffuseLightingElement::synchronizeProperty(const QualifiedName& attrName) { SVGFilterPrimitiveStandardAttributes::synchronizeProperty(attrName); diff --git a/WebCore/svg/SVGFEDiffuseLightingElement.h b/WebCore/svg/SVGFEDiffuseLightingElement.h index 5815cfe..ec9002e 100644 --- a/WebCore/svg/SVGFEDiffuseLightingElement.h +++ b/WebCore/svg/SVGFEDiffuseLightingElement.h @@ -40,6 +40,7 @@ public: virtual ~SVGFEDiffuseLightingElement(); virtual void parseMappedAttribute(Attribute*); + virtual void svgAttributeChanged(const QualifiedName&); virtual void synchronizeProperty(const QualifiedName&); virtual PassRefPtr<FilterEffect> build(SVGFilterBuilder*); diff --git a/WebCore/svg/SVGFEOffsetElement.cpp b/WebCore/svg/SVGFEOffsetElement.cpp index db96fce..ce26599 100644 --- a/WebCore/svg/SVGFEOffsetElement.cpp +++ b/WebCore/svg/SVGFEOffsetElement.cpp @@ -49,6 +49,16 @@ void SVGFEOffsetElement::parseMappedAttribute(Attribute* attr) SVGFilterPrimitiveStandardAttributes::parseMappedAttribute(attr); } +void SVGFEOffsetElement::svgAttributeChanged(const QualifiedName& attrName) +{ + SVGFilterPrimitiveStandardAttributes::svgAttributeChanged(attrName); + + if (attrName == SVGNames::inAttr + || attrName == SVGNames::dxAttr + || attrName == SVGNames::dyAttr) + invalidateFilter(); +} + void SVGFEOffsetElement::synchronizeProperty(const QualifiedName& attrName) { SVGFilterPrimitiveStandardAttributes::synchronizeProperty(attrName); diff --git a/WebCore/svg/SVGFEOffsetElement.h b/WebCore/svg/SVGFEOffsetElement.h index 4fbb698..6bf0d43 100644 --- a/WebCore/svg/SVGFEOffsetElement.h +++ b/WebCore/svg/SVGFEOffsetElement.h @@ -33,6 +33,7 @@ public: virtual ~SVGFEOffsetElement(); virtual void parseMappedAttribute(Attribute*); + virtual void svgAttributeChanged(const QualifiedName&); virtual void synchronizeProperty(const QualifiedName&); virtual PassRefPtr<FilterEffect> build(SVGFilterBuilder*); diff --git a/WebCore/svg/SVGFilterPrimitiveStandardAttributes.cpp b/WebCore/svg/SVGFilterPrimitiveStandardAttributes.cpp index 9b6b747..8e284e6 100644 --- a/WebCore/svg/SVGFilterPrimitiveStandardAttributes.cpp +++ b/WebCore/svg/SVGFilterPrimitiveStandardAttributes.cpp @@ -65,6 +65,18 @@ void SVGFilterPrimitiveStandardAttributes::parseMappedAttribute(Attribute* attr) return SVGStyledElement::parseMappedAttribute(attr); } +void SVGFilterPrimitiveStandardAttributes::svgAttributeChanged(const QualifiedName& attrName) +{ + SVGStyledElement::svgAttributeChanged(attrName); + + if (attrName == SVGNames::xAttr + || attrName == SVGNames::yAttr + || attrName == SVGNames::widthAttr + || attrName == SVGNames::heightAttr + || attrName == SVGNames::resultAttr) + invalidateFilter(); +} + void SVGFilterPrimitiveStandardAttributes::synchronizeProperty(const QualifiedName& attrName) { SVGStyledElement::synchronizeProperty(attrName); @@ -90,6 +102,14 @@ void SVGFilterPrimitiveStandardAttributes::synchronizeProperty(const QualifiedNa synchronizeResult(); } +void SVGFilterPrimitiveStandardAttributes::childrenChanged(bool changedByParser, Node* beforeChange, Node* afterChange, int childCountDelta) +{ + SVGStyledElement::childrenChanged(changedByParser, beforeChange, afterChange, childCountDelta); + + if (!changedByParser) + invalidateResourceClients(); +} + void SVGFilterPrimitiveStandardAttributes::setStandardAttributes(bool primitiveBoundingBoxMode, FilterEffect* filterEffect) const { ASSERT(filterEffect); diff --git a/WebCore/svg/SVGFilterPrimitiveStandardAttributes.h b/WebCore/svg/SVGFilterPrimitiveStandardAttributes.h index 6d1adad..14784a5 100644 --- a/WebCore/svg/SVGFilterPrimitiveStandardAttributes.h +++ b/WebCore/svg/SVGFilterPrimitiveStandardAttributes.h @@ -24,6 +24,7 @@ #if ENABLE(SVG) && ENABLE(FILTERS) #include "FilterEffect.h" #include "SVGFilterBuilder.h" +#include "SVGFilterElement.h" #include "SVGNames.h" #include "SVGStyledElement.h" @@ -40,13 +41,23 @@ public: virtual bool isFilterEffect() const { return true; } virtual void parseMappedAttribute(Attribute*); + virtual void svgAttributeChanged(const QualifiedName&); virtual void synchronizeProperty(const QualifiedName&); + virtual void childrenChanged(bool changedByParser = false, Node* beforeChange = 0, Node* afterChange = 0, int childCountDelta = 0); virtual PassRefPtr<FilterEffect> build(SVGFilterBuilder*) = 0; virtual bool rendererIsNeeded(RenderStyle*) { return false; } void setStandardAttributes(bool, FilterEffect*) const; +protected: + void invalidateFilter() + { + if (!inDocument() || !parentNode()->hasTagName(SVGNames::filterTag)) + return; + static_cast<SVGFilterElement*>(parentNode())->invalidateResourceClients(); + } + private: DECLARE_ANIMATED_PROPERTY(SVGFilterPrimitiveStandardAttributes, SVGNames::xAttr, SVGLength, X, x) DECLARE_ANIMATED_PROPERTY(SVGFilterPrimitiveStandardAttributes, SVGNames::yAttr, SVGLength, Y, y) diff --git a/WebCore/svg/SVGForeignObjectElement.cpp b/WebCore/svg/SVGForeignObjectElement.cpp index 7ffe1c6..2157c5e 100644 --- a/WebCore/svg/SVGForeignObjectElement.cpp +++ b/WebCore/svg/SVGForeignObjectElement.cpp @@ -126,8 +126,6 @@ void SVGForeignObjectElement::synchronizeProperty(const QualifiedName& attrName) synchronizeHeight(); else if (SVGExternalResourcesRequired::isKnownAttribute(attrName)) synchronizeExternalResourcesRequired(); - else if (SVGURIReference::isKnownAttribute(attrName)) - synchronizeHref(); } RenderObject* SVGForeignObjectElement::createRenderer(RenderArena* arena, RenderStyle*) diff --git a/WebCore/svg/SVGForeignObjectElement.h b/WebCore/svg/SVGForeignObjectElement.h index 86edc08..737addb 100644 --- a/WebCore/svg/SVGForeignObjectElement.h +++ b/WebCore/svg/SVGForeignObjectElement.h @@ -33,8 +33,7 @@ namespace WebCore { class SVGForeignObjectElement : public SVGStyledTransformableElement, public SVGTests, public SVGLangSpace, - public SVGExternalResourcesRequired, - public SVGURIReference { + public SVGExternalResourcesRequired { public: SVGForeignObjectElement(const QualifiedName&, Document*); virtual ~SVGForeignObjectElement(); diff --git a/WebCore/svg/SVGMaskElement.cpp b/WebCore/svg/SVGMaskElement.cpp index 1376480..5013e5c 100644 --- a/WebCore/svg/SVGMaskElement.cpp +++ b/WebCore/svg/SVGMaskElement.cpp @@ -40,7 +40,6 @@ namespace WebCore { SVGMaskElement::SVGMaskElement(const QualifiedName& tagName, Document* doc) : SVGStyledLocatableElement(tagName, doc) - , SVGURIReference() , SVGTests() , SVGLangSpace() , SVGExternalResourcesRequired() @@ -80,8 +79,6 @@ void SVGMaskElement::parseMappedAttribute(Attribute* attr) else if (attr->name() == SVGNames::heightAttr) setHeightBaseValue(SVGLength(LengthModeHeight, attr->value())); else { - if (SVGURIReference::parseMappedAttribute(attr)) - return; if (SVGTests::parseMappedAttribute(attr)) return; if (SVGLangSpace::parseMappedAttribute(attr)) @@ -108,7 +105,6 @@ void SVGMaskElement::svgAttributeChanged(const QualifiedName& attrName) if (invalidateClients || attrName == SVGNames::maskUnitsAttr || attrName == SVGNames::maskContentUnitsAttr - || SVGURIReference::isKnownAttribute(attrName) || SVGTests::isKnownAttribute(attrName) || SVGLangSpace::isKnownAttribute(attrName) || SVGExternalResourcesRequired::isKnownAttribute(attrName) @@ -126,7 +122,6 @@ void SVGMaskElement::synchronizeProperty(const QualifiedName& attrName) synchronizeX(); synchronizeY(); synchronizeExternalResourcesRequired(); - synchronizeHref(); return; } @@ -140,8 +135,6 @@ void SVGMaskElement::synchronizeProperty(const QualifiedName& attrName) synchronizeY(); else if (SVGExternalResourcesRequired::isKnownAttribute(attrName)) synchronizeExternalResourcesRequired(); - else if (SVGURIReference::isKnownAttribute(attrName)) - synchronizeHref(); } void SVGMaskElement::childrenChanged(bool changedByParser, Node* beforeChange, Node* afterChange, int childCountDelta) diff --git a/WebCore/svg/SVGMaskElement.h b/WebCore/svg/SVGMaskElement.h index 467128d..e941667 100644 --- a/WebCore/svg/SVGMaskElement.h +++ b/WebCore/svg/SVGMaskElement.h @@ -26,20 +26,19 @@ #include "SVGLangSpace.h" #include "SVGStyledLocatableElement.h" #include "SVGTests.h" -#include "SVGURIReference.h" namespace WebCore { class SVGLength; class SVGMaskElement : public SVGStyledLocatableElement, - public SVGURIReference, public SVGTests, public SVGLangSpace, public SVGExternalResourcesRequired { public: SVGMaskElement(const QualifiedName&, Document*); virtual ~SVGMaskElement(); + virtual bool isValid() const { return SVGTests::isValid(); } FloatRect maskBoundingBox(const FloatRect&) const; @@ -60,9 +59,6 @@ namespace WebCore { DECLARE_ANIMATED_PROPERTY(SVGMaskElement, SVGNames::widthAttr, SVGLength, Width, width) DECLARE_ANIMATED_PROPERTY(SVGMaskElement, SVGNames::heightAttr, SVGLength, Height, height) - // SVGURIReference - DECLARE_ANIMATED_PROPERTY(SVGMaskElement, XLinkNames::hrefAttr, String, Href, href) - // SVGExternalResourcesRequired DECLARE_ANIMATED_PROPERTY(SVGMaskElement, SVGNames::externalResourcesRequiredAttr, bool, ExternalResourcesRequired, externalResourcesRequired) }; diff --git a/WebCore/svg/graphics/SVGImage.cpp b/WebCore/svg/graphics/SVGImage.cpp index ebd7703..fead316 100644 --- a/WebCore/svg/graphics/SVGImage.cpp +++ b/WebCore/svg/graphics/SVGImage.cpp @@ -237,25 +237,27 @@ bool SVGImage::dataChanged(bool allDataReceived) if (allDataReceived) { static FrameLoaderClient* dummyFrameLoaderClient = new EmptyFrameLoaderClient; - static EditorClient* dummyEditorClient = new EmptyEditorClient; + + Page::PageClients pageClients; + m_chromeClient.set(new SVGImageChromeClient(this)); + pageClients.chromeClient = m_chromeClient.get(); #if ENABLE(CONTEXT_MENUS) static ContextMenuClient* dummyContextMenuClient = new EmptyContextMenuClient; -#else - static ContextMenuClient* dummyContextMenuClient = 0; + pageClients.contextMenuClient = dummyContextMenuClient; #endif + static EditorClient* dummyEditorClient = new EmptyEditorClient; + pageClients.editorClient = dummyEditorClient; #if ENABLE(DRAG_SUPPORT) static DragClient* dummyDragClient = new EmptyDragClient; -#else - static DragClient* dummyDragClient = 0; + pageClients.dragClient = dummyDragClient; #endif static InspectorClient* dummyInspectorClient = new EmptyInspectorClient; - - m_chromeClient.set(new SVGImageChromeClient(this)); + pageClients.inspectorClient = dummyInspectorClient; // FIXME: If this SVG ends up loading itself, we might leak the world. // The comment said that the Cache code does not know about CachedImages // holding Frames and won't know to break the cycle. But - m_page.set(new Page(m_chromeClient.get(), dummyContextMenuClient, dummyEditorClient, dummyDragClient, dummyInspectorClient, 0, 0, 0, 0)); + m_page.set(new Page(pageClients)); m_page->settings()->setMediaEnabled(false); m_page->settings()->setJavaScriptEnabled(false); m_page->settings()->setPluginsEnabled(false); diff --git a/WebCore/wml/WMLGoElement.cpp b/WebCore/wml/WMLGoElement.cpp index db4880c..9b329d7 100644 --- a/WebCore/wml/WMLGoElement.cpp +++ b/WebCore/wml/WMLGoElement.cpp @@ -25,6 +25,7 @@ #include "Attribute.h" #include "FormData.h" +#include "FormSubmission.h" #include "Frame.h" #include "FrameLoader.h" #include "HTMLNames.h" @@ -64,11 +65,11 @@ void WMLGoElement::deregisterPostfieldElement(WMLPostfieldElement* postfield) void WMLGoElement::parseMappedAttribute(Attribute* attr) { if (attr->name() == HTMLNames::methodAttr) - m_formDataBuilder.parseMethodType(attr->value()); + m_formAttributes.parseMethodType(attr->value()); else if (attr->name() == HTMLNames::enctypeAttr) - m_formDataBuilder.parseEncodingType(parseValueSubstitutingVariableReferences(attr->value())); + m_formAttributes.parseEncodingType(parseValueSubstitutingVariableReferences(attr->value())); else if (attr->name() == HTMLNames::accept_charsetAttr) - m_formDataBuilder.setAcceptCharset(parseValueForbiddingVariableReferences(attr->value())); + m_formAttributes.setAcceptCharset(parseValueForbiddingVariableReferences(attr->value())); else WMLTaskElement::parseMappedAttribute(attr); } @@ -126,7 +127,7 @@ void WMLGoElement::executeTask() String cacheControl = getAttribute(cache_controlAttr); - if (m_formDataBuilder.isPostMethod()) + if (m_formAttributes.method() == FormSubmission::PostMethod) preparePOSTRequest(request, inSameDeck, cacheControl); else prepareGETRequest(request, url); @@ -153,14 +154,14 @@ void WMLGoElement::preparePOSTRequest(ResourceRequest& request, bool inSameDeck, RefPtr<FormData> data; - if (m_formDataBuilder.isMultiPartForm()) { // multipart/form-data - Vector<char> boundary = m_formDataBuilder.generateUniqueBoundaryString(); + if (m_formAttributes.isMultiPartForm()) { // multipart/form-data + Vector<char> boundary = FormDataBuilder::generateUniqueBoundaryString(); data = createFormData(boundary.data()); - request.setHTTPContentType(m_formDataBuilder.encodingType() + "; boundary=" + boundary.data()); + request.setHTTPContentType(m_formAttributes.encodingType() + "; boundary=" + boundary.data()); } else { // text/plain or application/x-www-form-urlencoded data = createFormData(CString()); - request.setHTTPContentType(m_formDataBuilder.encodingType()); + request.setHTTPContentType(m_formAttributes.encodingType()); } request.setHTTPBody(data.get()); @@ -171,7 +172,7 @@ void WMLGoElement::prepareGETRequest(ResourceRequest& request, const KURL& url) request.setHTTPMethod("GET"); // Eventually display error message? - if (m_formDataBuilder.isMultiPartForm()) + if (m_formAttributes.isMultiPartForm()) return; RefPtr<FormData> data = createFormData(CString()); @@ -187,7 +188,7 @@ PassRefPtr<FormData> WMLGoElement::createFormData(const CString& boundary) CString value; Vector<char> encodedData; - TextEncoding encoding = m_formDataBuilder.dataEncoding(document()).encodingForFormSubmission(); + TextEncoding encoding = FormDataBuilder::encodingFromAcceptCharset(m_formAttributes.acceptCharset(), document()).encodingForFormSubmission(); Vector<WMLPostfieldElement*>::iterator it = m_postfieldElements.begin(); Vector<WMLPostfieldElement*>::iterator end = m_postfieldElements.end(); @@ -196,10 +197,10 @@ PassRefPtr<FormData> WMLGoElement::createFormData(const CString& boundary) for (; it != end; ++it) { (*it)->encodeData(encoding, key, value); - if (m_formDataBuilder.isMultiPartForm()) { + if (m_formAttributes.isMultiPartForm()) { Vector<char> header; - m_formDataBuilder.beginMultiPartHeader(header, boundary, key); - m_formDataBuilder.finishMultiPartHeader(header); + FormDataBuilder::beginMultiPartHeader(header, boundary, key); + FormDataBuilder::finishMultiPartHeader(header); result->appendData(header.data(), header.size()); if (size_t dataSize = value.length()) @@ -207,11 +208,11 @@ PassRefPtr<FormData> WMLGoElement::createFormData(const CString& boundary) result->appendData("\r\n", 2); } else - m_formDataBuilder.addKeyValuePairAsFormData(encodedData, key, value); + FormDataBuilder::addKeyValuePairAsFormData(encodedData, key, value); } - if (m_formDataBuilder.isMultiPartForm()) - m_formDataBuilder.addBoundaryToMultiPartHeader(encodedData, boundary, true); + if (m_formAttributes.isMultiPartForm()) + FormDataBuilder::addBoundaryToMultiPartHeader(encodedData, boundary, true); result->appendData(encodedData.data(), encodedData.size()); return result; diff --git a/WebCore/wml/WMLGoElement.h b/WebCore/wml/WMLGoElement.h index f602a39..d7f8991 100644 --- a/WebCore/wml/WMLGoElement.h +++ b/WebCore/wml/WMLGoElement.h @@ -22,7 +22,7 @@ #define WMLGoElement_h #if ENABLE(WML) -#include "FormDataBuilder.h" +#include "FormSubmission.h" #include "WMLTaskElement.h" namespace WebCore { @@ -48,7 +48,7 @@ private: PassRefPtr<FormData> createFormData(const CString& boundary); Vector<WMLPostfieldElement*> m_postfieldElements; - FormDataBuilder m_formDataBuilder; + FormSubmission::Attributes m_formAttributes; }; } diff --git a/WebCore/wml/WMLInputElement.h b/WebCore/wml/WMLInputElement.h index b8748fd..fe1ae89 100644 --- a/WebCore/wml/WMLInputElement.h +++ b/WebCore/wml/WMLInputElement.h @@ -96,6 +96,7 @@ private: friend class WMLCardElement; void initialize(); + virtual bool supportsMaxLength() const { return true; } String validateInputMask(const String&); unsigned cursorPositionToMaskIndex(unsigned); String constrainValue(const String&) const; diff --git a/WebCore/wscript b/WebCore/wscript index f923e87..bd058e4 100644 --- a/WebCore/wscript +++ b/WebCore/wscript @@ -30,7 +30,8 @@ from settings import * webcore_sources = {} if build_port == "wx": - webcore_sources['wx'] = ['platform/KillRingNone.cpp'] + webcore_sources['wx'] = ['platform/KillRingNone.cpp'] + if building_on_win32: # make sure platform/wx comes after this so we get the right # FontPlatformData.h @@ -125,7 +126,9 @@ def build(bld): wk_includes = ['.', '..', 'DerivedSources', wk_root, os.path.join(wk_root, 'JavaScriptCore'), + os.path.join(wk_root, 'JavaScriptCore', 'wtf', 'text'), os.path.join(wk_root, 'WebCore'), + os.path.join(wk_root, 'WebKit/wx'), 'platform/image-decoders', 'platform/win', 'platform/wx/wxcode', @@ -135,7 +138,7 @@ def build(bld): features = [build_port] exclude_patterns = ['*AllInOne.cpp', '*Brew.cpp', '*CFNet.cpp', '*Chromium*.cpp', '*Gtk.cpp', '*Mac.cpp', '*None.cpp', '*Qt.cpp', '*Safari.cpp', - 'test*bindings.*', '*Wince.cpp'] + 'test*bindings.*', '*Wince.cpp', "WebDOMSVG*.cpp"] if build_port == 'wx': features.append('curl') if not building_on_win32: @@ -172,6 +175,7 @@ def build(bld): includes = ' '.join(wk_includes), source = ' '.join(flattenSources(webcore_sources.values())), cxxflags = cxxflags, + defines = ['WXMAKINGDLL_WEBKIT'], target = 'webcore', uselib = 'WX ICU XML XSLT CURL SQLITE3 ' + get_config(), uselib_local = '', @@ -218,6 +222,15 @@ def build(bld): excludes.append('JSSVGTransformable.cpp') excludes.append('JSSVGURIReference.cpp') + excludes.append('WebDOMAbstractView.cpp') + excludes.append('WebDOMBlobBuilder.cpp') + excludes.append('WebDOMEventListenerCustom.cpp') + excludes.append('WebDOMElementTimeControl.cpp') + excludes.append('WebDOMImageData.cpp') + excludes.append('WebDOMScriptProfile.cpp') + excludes.append('WebDOMScriptProfileNode.cpp') + excludes.append('WebNativeEventListener.cpp') + if building_on_win32: excludes.append('SharedTimerWx.cpp') excludes.append('RenderThemeWin.cpp') |