Unreviewed, rolling out r159455.

http://trac.webkit.org/changeset/159455
https://bugs.webkit.org/show_bug.cgi?id=124568

broke two api tests (see bug 124564) (Requested by thorton on
#webkit).

Source/WebCore:

* CMakeLists.txt:
* GNUmakefile.list.am:
* WebCore.exp.in:
* WebCore.vcxproj/WebCore.vcxproj:
* WebCore.vcxproj/WebCore.vcxproj.filters:
* WebCore.xcodeproj/project.pbxproj:
* bindings/objc/DOM.mm:
(-[DOMNode renderedImage]):
(-[DOMRange renderedImageForcingBlackText:]):
* dom/Clipboard.cpp:
(WebCore::Clipboard::createDragImage):
* dom/ClipboardMac.mm:
(WebCore::Clipboard::createDragImage):
* page/DragController.cpp:
(WebCore::DragController::startDrag):
* page/Frame.cpp:
(WebCore::ScopedFramePaintingState::ScopedFramePaintingState):
(WebCore::ScopedFramePaintingState::~ScopedFramePaintingState):
(WebCore::Frame::nodeImage):
(WebCore::Frame::dragImageForSelection):
* page/Frame.h:
* page/FrameSnapshotting.cpp: Removed.
* page/FrameSnapshotting.h: Removed.
* page/mac/FrameMac.mm: Copied from Source/WebCore/page/win/FrameWin.h.
(WebCore::Frame::nodeImage):
(WebCore::Frame::dragImageForSelection):
* page/mac/FrameSnapshottingMac.h: Copied from Source/WebCore/page/win/FrameWin.h.
* page/mac/FrameSnapshottingMac.mm: Added.
(WebCore::imageFromRect):
(WebCore::selectionImage):
(WebCore::rangeImage):
(WebCore::snapshotDragImage):
* page/win/FrameWin.cpp:
(WebCore::Frame::dragImageForSelection):
(WebCore::Frame::nodeImage):
* page/win/FrameWin.h:
* platform/DragImage.cpp:
(WebCore::fitDragImageToMaxSize):
(WebCore::createDragImageForLink):
* platform/DragImage.h:

Source/WebKit/ios:

* WebCoreSupport/WebFrameIOS.mm:

Source/WebKit/mac:

* WebView/WebHTMLView.mm:
(-[WebHTMLView _selectionDraggingImage]):
(-[WebHTMLView selectionImageForcingBlackText:]):

Source/WebKit/win:

* DOMCoreClasses.cpp:
(DOMElement::renderedImage):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@159487 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent 1bd541e8
......@@ -1726,7 +1726,6 @@ set(WebCore_SOURCES
page/FocusController.cpp
page/Frame.cpp
page/FrameDestructionObserver.cpp
page/FrameSnapshotting.cpp
page/FrameTree.cpp
page/FrameView.cpp
page/GestureTapHighlighter.cpp
......
2013-11-18 Commit Queue <commit-queue@webkit.org>
Unreviewed, rolling out r159455.
http://trac.webkit.org/changeset/159455
https://bugs.webkit.org/show_bug.cgi?id=124568
broke two api tests (see bug 124564) (Requested by thorton on
#webkit).
* CMakeLists.txt:
* GNUmakefile.list.am:
* WebCore.exp.in:
* WebCore.vcxproj/WebCore.vcxproj:
* WebCore.vcxproj/WebCore.vcxproj.filters:
* WebCore.xcodeproj/project.pbxproj:
* bindings/objc/DOM.mm:
(-[DOMNode renderedImage]):
(-[DOMRange renderedImageForcingBlackText:]):
* dom/Clipboard.cpp:
(WebCore::Clipboard::createDragImage):
* dom/ClipboardMac.mm:
(WebCore::Clipboard::createDragImage):
* page/DragController.cpp:
(WebCore::DragController::startDrag):
* page/Frame.cpp:
(WebCore::ScopedFramePaintingState::ScopedFramePaintingState):
(WebCore::ScopedFramePaintingState::~ScopedFramePaintingState):
(WebCore::Frame::nodeImage):
(WebCore::Frame::dragImageForSelection):
* page/Frame.h:
* page/FrameSnapshotting.cpp: Removed.
* page/FrameSnapshotting.h: Removed.
* page/mac/FrameMac.mm: Copied from Source/WebCore/page/win/FrameWin.h.
(WebCore::Frame::nodeImage):
(WebCore::Frame::dragImageForSelection):
* page/mac/FrameSnapshottingMac.h: Copied from Source/WebCore/page/win/FrameWin.h.
* page/mac/FrameSnapshottingMac.mm: Added.
(WebCore::imageFromRect):
(WebCore::selectionImage):
(WebCore::rangeImage):
(WebCore::snapshotDragImage):
* page/win/FrameWin.cpp:
(WebCore::Frame::dragImageForSelection):
(WebCore::Frame::nodeImage):
* page/win/FrameWin.h:
* platform/DragImage.cpp:
(WebCore::fitDragImageToMaxSize):
(WebCore::createDragImageForLink):
* platform/DragImage.h:
2013-11-18 Mark Rowe <mrowe@apple.com>
Use hw.activecpu for determining how many processes to spawn.
......
......@@ -4118,8 +4118,6 @@ webcore_sources += \
Source/WebCore/page/Frame.h \
Source/WebCore/page/FrameDestructionObserver.cpp \
Source/WebCore/page/FrameDestructionObserver.h \
Source/WebCore/page/FrameSnapshotting.cpp \
Source/WebCore/page/FrameSnapshotting.h \
Source/WebCore/page/FrameTree.cpp \
Source/WebCore/page/FrameTree.h \
Source/WebCore/page/FrameView.cpp \
......
......@@ -427,6 +427,7 @@ __ZN7WebCore14cookiesEnabledERKNS_21NetworkStorageSessionERKNS_3URLES5_
__ZN7WebCore14decodeHostNameEP8NSString
__ZN7WebCore14encodeHostNameEP8NSString
__ZN7WebCore14endOfParagraphERKNS_15VisiblePositionENS_27EditingBoundaryCrossingRuleE
__ZN7WebCore14selectionImageEPNS_5FrameEb
__ZN7WebCore14setMetadataURLERN3WTF6StringERKS1_S4_
__ZN7WebCore15AffineTransform5flipYEv
__ZN7WebCore15AffineTransform5scaleEd
......@@ -886,7 +887,6 @@ __ZN7WebCore27AuthenticationChallengeBaseC2Ev
__ZN7WebCore27CSSComputedStyleDeclarationC1EN3WTF10PassRefPtrINS_4NodeEEEbRKNS1_6StringE
__ZN7WebCore27DeviceOrientationClientMock14setOrientationEN3WTF10PassRefPtrINS_21DeviceOrientationDataEEE
__ZN7WebCore27DeviceOrientationClientMockC1Ev
__ZN7WebCore27createDragImageForSelectionERNS_5FrameEb
__ZN7WebCore27protocolHostAndPortAreEqualERKNS_3URLES2_
__ZN7WebCore27startObservingCookieChangesEPFvvE
__ZN7WebCore28DocumentStyleSheetCollection12addUserSheetEN3WTF7PassRefINS_18StyleSheetContentsEEE
......@@ -2032,6 +2032,7 @@ __ZN7WebCore38contextMenuItemTagWritingDirectionMenuEv
__ZN7WebCore42contextMenuItemTagCheckGrammarWithSpellingEv
__ZN7WebCore42contextMenuItemTagCheckSpellingWhileTypingEv
__ZN7WebCore46contextMenuItemTagCorrectSpellingAutomaticallyEv
__ZN7WebCore5Frame9nodeImageEPNS_4NodeE
__ZN7WebCore6Cursor8fromTypeENS0_4TypeE
__ZN7WebCore6CursorC1EPNS_5ImageERKNS_8IntPointE
__ZN7WebCore6CursorC1ERKS0_
......
......@@ -6983,7 +6983,6 @@
<ClCompile Include="..\page\FocusController.cpp" />
<ClCompile Include="..\page\Frame.cpp" />
<ClCompile Include="..\page\FrameDestructionObserver.cpp" />
<ClCompile Include="..\page\FrameSnapshotting.cpp" />
<ClCompile Include="..\page\FrameTree.cpp" />
<ClCompile Include="..\page\FrameView.cpp" />
<ClCompile Include="..\page\GroupSettings.cpp" />
......@@ -18825,7 +18824,6 @@
<ClInclude Include="..\page\FocusDirection.h" />
<ClInclude Include="..\page\Frame.h" />
<ClInclude Include="..\page\FrameDestructionObserver.h" />
<ClInclude Include="..\page\FrameSnapshotting.h" />
<ClInclude Include="..\page\FrameTree.h" />
<ClInclude Include="..\page\FrameView.h" />
<ClInclude Include="..\page\GroupSettings.h" />
......@@ -717,9 +717,6 @@
<ClCompile Include="..\page\FrameDestructionObserver.cpp">
<Filter>page</Filter>
</ClCompile>
<ClCompile Include="..\page\FrameSnapshotting.cpp">
<Filter>page</Filter>
</ClCompile>
<ClCompile Include="..\page\FrameTree.cpp">
<Filter>page</Filter>
</ClCompile>
......@@ -7626,9 +7623,6 @@
<ClInclude Include="..\page\FrameDestructionObserver.h">
<Filter>page</Filter>
</ClInclude>
<ClInclude Include="..\page\FrameSnapshotting.h">
<Filter>page</Filter>
</ClInclude>
<ClInclude Include="..\page\FrameTree.h">
<Filter>page</Filter>
</ClInclude>
......
......@@ -2005,6 +2005,7 @@
65A21485097A3F5300B9050A /* FrameTree.h in Headers */ = {isa = PBXBuildFile; fileRef = 65A21483097A3F5300B9050A /* FrameTree.h */; settings = {ATTRIBUTES = (Private, ); }; };
65BF022E0974816300C43196 /* Frame.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 65BF02290974816300C43196 /* Frame.cpp */; };
65BF022F0974816300C43196 /* Frame.h in Headers */ = {isa = PBXBuildFile; fileRef = 65BF022A0974816300C43196 /* Frame.h */; settings = {ATTRIBUTES = (Private, ); }; };
65BF02450974819000C43196 /* FrameMac.mm in Sources */ = {isa = PBXBuildFile; fileRef = 65BF023C0974819000C43196 /* FrameMac.mm */; };
65C97AF308EA908800ACD273 /* config.h in Headers */ = {isa = PBXBuildFile; fileRef = 65C97AF208EA908800ACD273 /* config.h */; };
65CBFEF90974F607001DAC25 /* FrameView.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 65CBFEF70974F607001DAC25 /* FrameView.cpp */; };
65CBFEFA0974F607001DAC25 /* FrameView.h in Headers */ = {isa = PBXBuildFile; fileRef = 65CBFEF80974F607001DAC25 /* FrameView.h */; settings = {ATTRIBUTES = (Private, ); }; };
......@@ -2205,6 +2206,8 @@
7C5343FC17B74B63004232F0 /* JSMediaQueryListListener.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 7C5343FA17B74B63004232F0 /* JSMediaQueryListListener.cpp */; };
7C5343FD17B74B63004232F0 /* JSMediaQueryListListener.h in Headers */ = {isa = PBXBuildFile; fileRef = 7C5343FB17B74B63004232F0 /* JSMediaQueryListListener.h */; };
7CC7E3D717208C0F003C5277 /* IDNScriptWhiteList.txt in Resources */ = {isa = PBXBuildFile; fileRef = 7CC7E3D617208C0F003C5277 /* IDNScriptWhiteList.txt */; };
7CE30DA9171B63D200EC33E1 /* FrameSnapshottingMac.mm in Sources */ = {isa = PBXBuildFile; fileRef = 7CE30DA7171B63D200EC33E1 /* FrameSnapshottingMac.mm */; };
7CE30DAA171B63D200EC33E1 /* FrameSnapshottingMac.h in Headers */ = {isa = PBXBuildFile; fileRef = 7CE30DA8171B63D200EC33E1 /* FrameSnapshottingMac.h */; settings = {ATTRIBUTES = (Private, ); }; };
7D741BDA177226AA00859170 /* CSSValueKeywords.h in Copy Generated Headers */ = {isa = PBXBuildFile; fileRef = 6565814809D13043000E61D7 /* CSSValueKeywords.h */; };
7E12E90F15FA5D3A005E4126 /* CustomFilterMeshGenerator.h in Headers */ = {isa = PBXBuildFile; fileRef = 7E12E90D15FA5D3A005E4126 /* CustomFilterMeshGenerator.h */; };
7E12E91015FA5D3A005E4126 /* CustomFilterMeshGenerator.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 7E12E90E15FA5D3A005E4126 /* CustomFilterMeshGenerator.cpp */; };
......@@ -5241,8 +5244,6 @@
C3CF17A515B0063F00276D39 /* IdTargetObserver.h in Headers */ = {isa = PBXBuildFile; fileRef = C3CF17A115B0063F00276D39 /* IdTargetObserver.h */; settings = {ATTRIBUTES = (Private, ); }; };
C3CF17A615B0063F00276D39 /* IdTargetObserverRegistry.cpp in Sources */ = {isa = PBXBuildFile; fileRef = C3CF17A215B0063F00276D39 /* IdTargetObserverRegistry.cpp */; };
C3CF17A715B0063F00276D39 /* IdTargetObserverRegistry.h in Headers */ = {isa = PBXBuildFile; fileRef = C3CF17A315B0063F00276D39 /* IdTargetObserverRegistry.h */; settings = {ATTRIBUTES = (Private, ); }; };
C4CD629A18383766007EBAF1 /* FrameSnapshotting.cpp in Sources */ = {isa = PBXBuildFile; fileRef = C4CD629818383766007EBAF1 /* FrameSnapshotting.cpp */; };
C4CD629B18383766007EBAF1 /* FrameSnapshotting.h in Headers */ = {isa = PBXBuildFile; fileRef = C4CD629918383766007EBAF1 /* FrameSnapshotting.h */; settings = {ATTRIBUTES = (Private, ); }; };
C50B561612119D23008B46E0 /* GroupSettings.cpp in Sources */ = {isa = PBXBuildFile; fileRef = C50B561412119D23008B46E0 /* GroupSettings.cpp */; };
C50B561712119D23008B46E0 /* GroupSettings.h in Headers */ = {isa = PBXBuildFile; fileRef = C50B561512119D23008B46E0 /* GroupSettings.h */; settings = {ATTRIBUTES = (Private, ); }; };
C50D0E820FF4272900AC2644 /* StorageNamespace.cpp in Sources */ = {isa = PBXBuildFile; fileRef = C50D0E800FF4272900AC2644 /* StorageNamespace.cpp */; };
......@@ -8740,6 +8741,7 @@
65A640F00533BB1F0085E777 /* BlockExceptions.h */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 4; lastKnownFileType = sourcecode.c.h; path = BlockExceptions.h; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; };
65BF02290974816300C43196 /* Frame.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = Frame.cpp; sourceTree = "<group>"; };
65BF022A0974816300C43196 /* Frame.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = Frame.h; sourceTree = "<group>"; };
65BF023C0974819000C43196 /* FrameMac.mm */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.objcpp; path = FrameMac.mm; sourceTree = "<group>"; };
65C97AF208EA908800ACD273 /* config.h */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 4; lastKnownFileType = sourcecode.c.h; path = config.h; sourceTree = "<group>"; tabWidth = 4; usesTabs = 0; };
65CBFEF70974F607001DAC25 /* FrameView.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = FrameView.cpp; sourceTree = "<group>"; };
65CBFEF80974F607001DAC25 /* FrameView.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = FrameView.h; sourceTree = "<group>"; };
......@@ -8967,6 +8969,8 @@
7C6136F81710C35200FF4A57 /* InFilesParser.pm */ = {isa = PBXFileReference; lastKnownFileType = text.script.perl; name = InFilesParser.pm; path = scripts/InFilesParser.pm; sourceTree = "<group>"; };
7C6136F91710C35200FF4A57 /* StaticString.pm */ = {isa = PBXFileReference; lastKnownFileType = text.script.perl; name = StaticString.pm; path = scripts/StaticString.pm; sourceTree = "<group>"; };
7CC7E3D617208C0F003C5277 /* IDNScriptWhiteList.txt */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = IDNScriptWhiteList.txt; sourceTree = "<group>"; };
7CE30DA7171B63D200EC33E1 /* FrameSnapshottingMac.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = FrameSnapshottingMac.mm; sourceTree = "<group>"; };
7CE30DA8171B63D200EC33E1 /* FrameSnapshottingMac.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = FrameSnapshottingMac.h; sourceTree = "<group>"; };
7E12E90D15FA5D3A005E4126 /* CustomFilterMeshGenerator.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = CustomFilterMeshGenerator.h; path = filters/CustomFilterMeshGenerator.h; sourceTree = "<group>"; };
7E12E90E15FA5D3A005E4126 /* CustomFilterMeshGenerator.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = CustomFilterMeshGenerator.cpp; path = filters/CustomFilterMeshGenerator.cpp; sourceTree = "<group>"; };
7E33CD00127F340D00BE8F17 /* PurgePriority.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PurgePriority.h; sourceTree = "<group>"; };
......@@ -12270,8 +12274,6 @@
C3CF17A115B0063F00276D39 /* IdTargetObserver.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IdTargetObserver.h; sourceTree = "<group>"; };
C3CF17A215B0063F00276D39 /* IdTargetObserverRegistry.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = IdTargetObserverRegistry.cpp; sourceTree = "<group>"; };
C3CF17A315B0063F00276D39 /* IdTargetObserverRegistry.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IdTargetObserverRegistry.h; sourceTree = "<group>"; };
C4CD629818383766007EBAF1 /* FrameSnapshotting.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = FrameSnapshotting.cpp; sourceTree = "<group>"; };
C4CD629918383766007EBAF1 /* FrameSnapshotting.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = FrameSnapshotting.h; sourceTree = "<group>"; };
C50B561412119D23008B46E0 /* GroupSettings.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = GroupSettings.cpp; sourceTree = "<group>"; };
C50B561512119D23008B46E0 /* GroupSettings.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = GroupSettings.h; sourceTree = "<group>"; };
C50D0E800FF4272900AC2644 /* StorageNamespace.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = StorageNamespace.cpp; sourceTree = "<group>"; };
......@@ -15605,8 +15607,6 @@
65BF022A0974816300C43196 /* Frame.h */,
974A862014B7ADBB003FDC76 /* FrameDestructionObserver.cpp */,
974A862114B7ADBB003FDC76 /* FrameDestructionObserver.h */,
C4CD629818383766007EBAF1 /* FrameSnapshotting.cpp */,
C4CD629918383766007EBAF1 /* FrameSnapshotting.h */,
65A21482097A3F5300B9050A /* FrameTree.cpp */,
65A21483097A3F5300B9050A /* FrameTree.h */,
65CBFEF70974F607001DAC25 /* FrameView.cpp */,
......@@ -16521,6 +16521,9 @@
ABAF22070C03B1C700B0BCF0 /* ChromeMac.mm */,
A718788F0B2D04AC00A16ECE /* DragControllerMac.mm */,
93C09A7E0B064EEF005ABD4D /* EventHandlerMac.mm */,
65BF023C0974819000C43196 /* FrameMac.mm */,
7CE30DA8171B63D200EC33E1 /* FrameSnapshottingMac.h */,
7CE30DA7171B63D200EC33E1 /* FrameSnapshottingMac.mm */,
1C26497B0D7E24EC00BD10F2 /* PageMac.cpp */,
E1C2F2481533A2120083F974 /* SettingsMac.mm */,
F587854C02DE375901EA4122 /* WebCoreFrameView.h */,
......@@ -22119,7 +22122,6 @@
1A569CF80D7E2B82007C3983 /* c_class.h in Headers */,
1A569CFA0D7E2B82007C3983 /* c_instance.h in Headers */,
1A569CFC0D7E2B82007C3983 /* c_runtime.h in Headers */,
C4CD629B18383766007EBAF1 /* FrameSnapshotting.h in Headers */,
1A569CFE0D7E2B82007C3983 /* c_utility.h in Headers */,
BCB16C1A0979C3BD00467741 /* CachedCSSStyleSheet.h in Headers */,
BC64B4CC0CB4295D005F2B62 /* CachedFont.h in Headers */,
......@@ -22979,6 +22981,7 @@
628D214E12131EF40055DCFC /* FrameNetworkingContext.h in Headers */,
E172AF70180F289500FBADB9 /* CryptoKeyUsage.h in Headers */,
93309E0E099E64920056E581 /* FrameSelection.h in Headers */,
7CE30DAA171B63D200EC33E1 /* FrameSnapshottingMac.h in Headers */,
65A21485097A3F5300B9050A /* FrameTree.h in Headers */,
65CBFEFA0974F607001DAC25 /* FrameView.h in Headers */,
97205AB0123928CA00B17380 /* FTPDirectoryDocument.h in Headers */,
......@@ -26258,8 +26261,10 @@
932E16090AF578340025F408 /* FrameLoader.cpp in Sources */,
D000EBA211BDAFD400C47726 /* FrameLoaderStateMachine.cpp in Sources */,
86BA766E166427A8005BE5D1 /* FrameLoadRequest.cpp in Sources */,
65BF02450974819000C43196 /* FrameMac.mm in Sources */,
93309E0D099E64920056E581 /* FrameSelection.cpp in Sources */,
4A8C96EB0BE69032004EEFF0 /* FrameSelectionMac.mm in Sources */,
7CE30DA9171B63D200EC33E1 /* FrameSnapshottingMac.mm in Sources */,
07969DAD17D14151007FF842 /* JSRTCDataChannelEvent.cpp in Sources */,
65A21484097A3F5300B9050A /* FrameTree.cpp in Sources */,
E4C91A101802343900A17F6D /* TextPaintStyle.cpp in Sources */,
......@@ -27765,7 +27770,6 @@
51E0BB390DA5ACB600A9E417 /* StorageMap.cpp in Sources */,
07277E5217D018CC0015534D /* JSMediaStreamTrack.cpp in Sources */,
C50D0E820FF4272900AC2644 /* StorageNamespace.cpp in Sources */,
C4CD629A18383766007EBAF1 /* FrameSnapshotting.cpp in Sources */,
C55E38C010040D5D00A56BDB /* StorageNamespaceImpl.cpp in Sources */,
1AB09DB416AF5F6C008538E7 /* StorageStrategy.cpp in Sources */,
C5102D950FD9AA2D00FAFF04 /* StorageSyncManager.cpp in Sources */,
......@@ -36,9 +36,9 @@
#import "DOMNodeInternal.h"
#import "DOMPrivate.h"
#import "DOMRangeInternal.h"
#import "DragImage.h"
#import "Font.h"
#import "Frame.h"
#import "FrameSnapshottingMac.h"
#import "HTMLElement.h"
#import "HTMLNames.h"
#import "HTMLParserIdioms.h"
......@@ -287,9 +287,9 @@ id <DOMEventTarget> kit(WebCore::EventTarget* eventTarget)
// FIXME: Could we move this function to WebCore::Node and autogenerate?
WebCore::Node* node = core(self);
WebCore::Frame* frame = node->document().frame();
if (!frame || !node)
if (!frame)
return nil;
return [[createDragImageForNode(*frame, *node) retain] autorelease];
return frame->nodeImage(node).get();
}
- (NSArray *)textRects
......@@ -332,10 +332,10 @@ id <DOMEventTarget> kit(WebCore::EventTarget* eventTarget)
{
WebCore::Range* range = core(self);
WebCore::Frame* frame = range->ownerDocument().frame();
if (!frame || !range)
if (!frame)
return nil;
return [[createDragImageForRange(*frame, *range, forceBlackText) retain] autorelease];
return WebCore::rangeImage(frame, range, forceBlackText);
}
- (NSArray *)textRects
......
......@@ -277,11 +277,10 @@ DragImageRef Clipboard::createDragImage(IntPoint& location) const
if (m_dragImageElement) {
if (Frame* frame = m_dragImageElement->document().frame())
return createDragImageForNode(*frame, *m_dragImageElement);
return frame->nodeImage(m_dragImageElement.get());
}
// We do not have enough information to create a drag image, use the default icon.
return nullptr;
return 0; // We do not have enough information to create a drag image, use the default icon.
}
#endif
......
......@@ -28,7 +28,7 @@
#import "CachedImage.h"
#import "Element.h"
#import "DragImage.h"
#import "FrameSnapshottingMac.h"
namespace WebCore {
......@@ -37,16 +37,16 @@ namespace WebCore {
// Clipboard::dragImage in Clipboard.cpp does not handle correctly, so must resolve that as well.
DragImageRef Clipboard::createDragImage(IntPoint& location) const
{
DragImageRef result = nil;
NSImage *result = nil;
if (m_dragImageElement) {
if (Frame* frame = m_dragImageElement->document().frame()) {
IntRect imageRect;
IntRect elementRect;
result = createDragImageForImage(*frame, *m_dragImageElement, imageRect, elementRect);
NSRect imageRect;
NSRect elementRect;
result = snapshotDragImage(frame, m_dragImageElement.get(), &imageRect, &elementRect);
// Client specifies point relative to element, not the whole image, which may include child
// layers spread out all over the place.
location.setX(elementRect.x() - imageRect.x() + m_dragLocation.x());
location.setY(imageRect.height() - (elementRect.y() - imageRect.y() + m_dragLocation.y()));
location.setX(elementRect.origin.x - imageRect.origin.x + m_dragLocation.x());
location.setY(imageRect.size.height - (elementRect.origin.y - imageRect.origin.y + m_dragLocation.y()));
}
} else if (m_dragImage) {
result = m_dragImage->image()->getNSImage();
......
......@@ -37,7 +37,6 @@
#include "DragActions.h"
#include "DragClient.h"
#include "DragData.h"
#include "DragImage.h"
#include "DragSession.h"
#include "DragState.h"
#include "Editor.h"
......@@ -781,7 +780,7 @@ bool DragController::startDrag(Frame& src, const DragState& state, DragOperation
}
m_client.willPerformDragSourceAction(DragSourceActionSelection, dragOrigin, clipboard);
if (!dragImage) {
dragImage = dissolveDragImageToFraction(createDragImageForSelection(src), DragImageAlpha);
dragImage = dissolveDragImageToFraction(src.dragImageForSelection(), DragImageAlpha);
dragLoc = dragLocForSelectionDrag(src);
m_dragOffset = IntPoint(dragOrigin.x() - dragLoc.x(), dragOrigin.y() - dragLoc.y());
}
......
......@@ -966,4 +966,108 @@ bool Frame::isURLAllowed(const URL& url) const
return true;
}
#if !PLATFORM(MAC) && !PLATFORM(WIN)
struct ScopedFramePaintingState {
ScopedFramePaintingState(Frame* frame, Node* node)
: frame(frame)
, node(node)
, paintBehavior(frame->view()->paintBehavior())
, backgroundColor(frame->view()->baseBackgroundColor())
{
ASSERT(!node || node->renderer());
if (node)
node->renderer()->updateDragState(true);
}
~ScopedFramePaintingState()
{
if (node && node->renderer())
node->renderer()->updateDragState(false);
frame->view()->setPaintBehavior(paintBehavior);
frame->view()->setBaseBackgroundColor(backgroundColor);
frame->view()->setNodeToDraw(0);
}
Frame* frame;
Node* node;
PaintBehavior paintBehavior;
Color backgroundColor;
};
DragImageRef Frame::nodeImage(Node* node)
{
if (!node->renderer())
return nullptr;
const ScopedFramePaintingState state(this, node);
m_view->setPaintBehavior(state.paintBehavior | PaintBehaviorFlattenCompositingLayers);
// When generating the drag image for an element, ignore the document background.
m_view->setBaseBackgroundColor(Color::transparent);
m_doc->updateLayout();
m_view->setNodeToDraw(node); // Enable special sub-tree drawing mode.
// Document::updateLayout may have blown away the original renderer.
auto renderer = node->renderer();
if (!renderer)
return nullptr;
LayoutRect topLevelRect;
IntRect paintingRect = pixelSnappedIntRect(renderer->paintingRootRect(topLevelRect));
float deviceScaleFactor = 1;
if (m_page)
deviceScaleFactor = m_page->deviceScaleFactor();
paintingRect.setWidth(paintingRect.width() * deviceScaleFactor);
paintingRect.setHeight(paintingRect.height() * deviceScaleFactor);
OwnPtr<ImageBuffer> buffer(ImageBuffer::create(paintingRect.size(), deviceScaleFactor, ColorSpaceDeviceRGB));
if (!buffer)
return nullptr;
buffer->context()->translate(-paintingRect.x(), -paintingRect.y());
buffer->context()->clip(FloatRect(0, 0, paintingRect.maxX(), paintingRect.maxY()));
m_view->paintContents(buffer->context(), paintingRect);
RefPtr<Image> image = buffer->copyImage();
ImageOrientationDescription orientationDescription(renderer->shouldRespectImageOrientation());
#if ENABLE(CSS_IMAGE_ORIENTATION)
orientationDescription.setImageOrientationEnum(renderer->style().imageOrientation());
#endif
return createDragImageFromImage(image.get(), orientationDescription);
}
DragImageRef Frame::dragImageForSelection()
{
if (!selection().isRange())
return 0;
const ScopedFramePaintingState state(this, 0);
m_view->setPaintBehavior(PaintBehaviorSelectionOnly);
m_doc->updateLayout();
IntRect paintingRect = enclosingIntRect(selection().bounds());
float deviceScaleFactor = 1;
if (m_page)
deviceScaleFactor = m_page->deviceScaleFactor();
paintingRect.setWidth(paintingRect.width() * deviceScaleFactor);
paintingRect.setHeight(paintingRect.height() * deviceScaleFactor);
OwnPtr<ImageBuffer> buffer(ImageBuffer::create(paintingRect.size(), deviceScaleFactor, ColorSpaceDeviceRGB));
if (!buffer)
return 0;
buffer->context()->translate(-paintingRect.x(), -paintingRect.y());
buffer->context()->clip(FloatRect(0, 0, paintingRect.maxX(), paintingRect.maxY()));
m_view->paintContents(buffer->context(), paintingRect);
RefPtr<Image> image = buffer->copyImage();
return createDragImageFromImage(image.get(), ImageOrientationDescription());
}
#endif
} // namespace WebCore
......@@ -29,6 +29,7 @@
#define Frame_h
#include "AdjustViewSizeOrNot.h"
#include "DragImage.h"
#include "FrameLoader.h"
#include "FrameTree.h"
#include "IntRect.h"
......@@ -57,13 +58,11 @@ namespace WebCore {
class Editor;
class Element;
class EventHandler;
class FloatSize;
class FrameDestructionObserver;
class FrameSelection;
class FrameView;
class HTMLFrameOwnerElement;
class HTMLTableCellElement;
class ImageBuffer;
class IntRect;
class MainFrame;
class Node;
......@@ -178,6 +177,9 @@ namespace WebCore {
String displayStringModifiedByEncoding(const String&) const;
DragImageRef nodeImage(Node*);
DragImageRef dragImageForSelection();
VisiblePosition visiblePositionForPoint(const IntPoint& framePoint);
Document* documentAtPoint(const IntPoint& windowPoint);
PassRefPtr<Range> rangeForPoint(const IntPoint& framePoint);
......
/*
* Copyright (C) 2013 University of Washington. 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 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
* HOLDER 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 "FrameSnapshotting.h"
#include "Document.h"
#include "Frame.h"
#include "FrameSelection.h"
#include "FrameView.h"
#include "ImageBuffer.h"
#include "Page.h"
#include "RenderObject.h"
namespace WebCore {
struct ScopedFramePaintingState {
ScopedFramePaintingState(Frame& frame, Node* node)
: frame(frame)
, node(node)
, paintBehavior(frame.view()->paintBehavior())
, backgroundColor(frame.view()->baseBackgroundColor())
{
ASSERT(!node || node->renderer());
}
~ScopedFramePaintingState()
{
frame.view()->setPaintBehavior(paintBehavior);
frame.view()->setBaseBackgroundColor(backgroundColor);
frame.view()->setNodeToDraw(nullptr);
}
Frame& frame;
Node* node;
PaintBehavior paintBehavior;
Color backgroundColor;
};
std::unique_ptr<ImageBuffer> snapshotFrameRect(Frame& frame, const IntRect& imageRect, SnapshotOptions options)
{
FrameView::SelectionInSnapshot shouldIncludeSelection = FrameView::IncludeSelection;
if (options & SnapshotOptionsExcludeSelectionHighlighting)
shouldIncludeSelection = FrameView::ExcludeSelection;
FrameView::CoordinateSpaceForSnapshot coordinateSpace = FrameView::DocumentCoordinates;
if (options & SnapshotOptionsInViewCoordinates)
coordinateSpace = FrameView::ViewCoordinates;
PaintBehavior textPaintBehavior = 0;
if (options & SnapshotOptionsForceBlackText)
textPaintBehavior = PaintBehaviorForceBlackText;
const ScopedFramePaintingState state(frame, nullptr);
// Other paint behaviors are set by paintContentsForSnapshot.
PaintBehavior existingBehavior = frame.view()->paintBehavior();
frame.view()->setPaintBehavior(existingBehavior | textPaintBehavior);
frame.document()->updateLayout();
float deviceScaleFactor = frame.page() ? frame.page()->deviceScaleFactor() : 1;
IntRect usedRect(imageRect);
usedRect.scale(deviceScaleFactor);
std::unique_ptr<ImageBuffer> buffer = std::unique_ptr<ImageBuffer>(ImageBuffer::create(usedRect.size(), deviceScaleFactor, ColorSpaceDeviceRGB).leakPtr());
if (!buffer)
return nullptr;
buffer->context()->translate(-usedRect.x(), -usedRect.y());
buffer->context()->clip(FloatRect(0, 0, usedRect.maxX(), usedRect.maxY()));
frame.view()->paintContentsForSnapshot(buffer->context(), usedRect, shouldIncludeSelection, coordinateSpace);
return buffer;
}
std::unique_ptr<ImageBuffer> snapshotSelection(Frame& frame, SnapshotOptions options)
{
if (!frame.selection().isRange())
return nullptr;
// Force selection highlighting to be included.
options &= ~SnapshotOptionsExcludeSelectionHighlighting;
IntRect selectionRect = enclosingIntRect(frame.selection().bounds());
return snapshotFrameRect(frame, selectionRect, options);
}
std::unique_ptr<ImageBuffer> snapshotNode(Frame& frame, Node& node)
{
if (!node.renderer())
return nullptr;
const ScopedFramePaintingState state(frame, &node);
frame.view()->setBaseBackgroundColor(Color::transparent);
frame.document()->updateLayout();
frame.view()->setNodeToDraw(&node);
// Document::updateLayout may have blown away the original renderer.
RenderObject* renderer = node.renderer();
if (!renderer)
return nullptr;
LayoutRect topLevelRect;
IntRect paintingRect = pixelSnappedIntRect(renderer->paintingRootRect(topLevelRect));
return snapshotFrameRect(frame, paintingRect);
}
} // namespace WebCore
/*
* Copyright (C) 2013 University of Washington. 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 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
* HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,