Changeset 53270 in webkit
- Timestamp:
- Jan 14, 2010 10:23:18 AM (14 years ago)
- Location:
- trunk
- Files:
-
- 2 added
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r53268 r53270 1 2010-01-14 Brian Weinstein <bweinstein@apple.com> 2 3 Reviewed by Oliver Hunt. 4 5 [DnD] effectAllowed and dropEffect can be set to bogus values. 6 Fixes <https://bugs.webkit.org/show_bug.cgi?id=33635>. 7 8 Added a test to check the handling of setting effectAllowed and 9 dropEffect to bogus values (that it gets ignored), and updated results 10 to drag-and-drop because it uses a dummy value. 11 12 * fast/events/bogus-dropEffect-effectAllowed-expected.txt: Added. 13 * fast/events/bogus-dropEffect-effectAllowed.html: Added. 14 * fast/events/drag-and-drop-expected.txt: 15 * fast/events/drag-and-drop.html: 16 1 17 2010-01-14 Adam Roben <aroben@apple.com> 2 18 -
trunk/LayoutTests/fast/events/drag-and-drop-expected.txt
r53203 r53270 93 93 When effectAllowed == "dummy" 94 94 95 PASS event.dataTransfer.effectAllowed is "uninitialized" 95 96 PASS event.dataTransfer.dropEffect is "none" 96 PASS event.dataTransfer.dropEffect is "none" 97 PASS event.dataTransfer.dropEffect is "none" 98 PASS event.dataTransfer.dropEffect is "none" 97 PASS event.dataTransfer.effectAllowed is "uninitialized" 98 PASS event.dataTransfer.dropEffect is "copy" 99 PASS event.dataTransfer.effectAllowed is "uninitialized" 100 PASS event.dataTransfer.dropEffect is "move" 101 PASS event.dataTransfer.effectAllowed is "uninitialized" 102 PASS event.dataTransfer.dropEffect is "link" 103 PASS event.dataTransfer.effectAllowed is "uninitialized" 99 104 PASS event.dataTransfer.dropEffect is "none" 100 105 -
trunk/LayoutTests/fast/events/drag-and-drop.html
r53203 r53270 93 93 if (chosenEffectAllowed === "undefined") { 94 94 // If no effectAllowed is set, we should default to uninitialized. Make sure that's the case. 95 shouldBeEqualToString("event.dataTransfer.effectAllowed", "uninitialized"); 96 97 // Then set the chosenEffectAllowed so isDropEffectAllowed matches the HTML5 spec, and 98 // doesn't need special cases for undefined. 99 chosenEffectAllowed = "uninitialized"; 100 } 101 102 if (chosenEffectAllowed === "dummy") { 103 // If a bad effectAllowed is attempted to be set, it should never be set, and the 104 // effectAllowed should be uninitialized. 95 105 shouldBeEqualToString("event.dataTransfer.effectAllowed", "uninitialized"); 96 106 -
trunk/WebCore/ChangeLog
r53264 r53270 1 2010-01-14 Brian Weinstein <bweinstein@apple.com> 2 3 Reviewed by Oliver Hunt. 4 5 [DnD] effectAllowed and dropEffect can be set to bogus values. 6 Fixes <https://bugs.webkit.org/show_bug.cgi?id=33635>. 7 8 Test to make aure dropEffect and effectAllowed are being set to valid values 9 when they are being set (list of valid values given by HTML5 specification). 10 11 Also, drive by change to initialize dropEffect to none (as described in spec). 12 13 Test: fast/events/bogus-dropEffect-effectAllowed.html 14 15 * dom/Clipboard.cpp: 16 (WebCore::Clipboard::Clipboard): Initialize m_dropEffect to "none". 17 (WebCore::Clipboard::setDropEffect): Check if dropEffect is being set to a valid value. 18 (WebCore::Clipboard::setEffectAllowed): Check if effectAllowed is being set to a valid value. 19 1 20 2010-01-14 Martin Robinson <martin.james.robinson@gmail.com> 2 21 -
trunk/WebCore/dom/Clipboard.cpp
r53203 r53270 36 36 37 37 Clipboard::Clipboard(ClipboardAccessPolicy policy, bool isForDragging) 38 : m_policy(policy) 38 : m_policy(policy) 39 , m_dropEffect("none") 39 40 , m_effectAllowed("uninitialized") 40 41 , m_dragStarted(false) … … 131 132 return; 132 133 134 // The attribute must ignore any attempts to set it to a value other than none, copy, link, and move. 135 if (effect != "none" && effect != "copy" && effect != "link" && effect != "move") 136 return; 137 133 138 if (m_policy == ClipboardReadable || m_policy == ClipboardTypesReadable) 134 139 m_dropEffect = effect; … … 140 145 return; 141 146 147 if (dragOpFromIEOp(effect) == DragOperationPrivate) { 148 // This means that there was no conversion, and the effectAllowed that 149 // we are passed isn't a valid effectAllowed, so we should ignore it, 150 // and not set m_effectAllowed. 151 152 // The attribute must ignore any attempts to set it to a value other than 153 // none, copy, copyLink, copyMove, link, linkMove, move, all, and uninitialized. 154 return; 155 } 156 157 142 158 if (m_policy == ClipboardWritable) 143 159 m_effectAllowed = effect;
Note: See TracChangeset
for help on using the changeset viewer.