Changeset 53272 in webkit
- Timestamp:
- Jan 14, 2010 10:47:50 AM (14 years ago)
- Location:
- trunk
- Files:
-
- 2 deleted
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r53270 r53272 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 and9 dropEffect to bogus values (that it gets ignored), and updated results10 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 17 1 2010-01-14 Adam Roben <aroben@apple.com> 18 2 -
trunk/LayoutTests/fast/events/drag-and-drop-expected.txt
r53270 r53272 93 93 When effectAllowed == "dummy" 94 94 95 PASS event.dataTransfer.effectAllowed is "uninitialized"96 95 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" 96 PASS event.dataTransfer.dropEffect is "none" 97 PASS event.dataTransfer.dropEffect is "none" 98 PASS event.dataTransfer.dropEffect is "none" 104 99 PASS event.dataTransfer.dropEffect is "none" 105 100 -
trunk/LayoutTests/fast/events/drag-and-drop.html
r53270 r53272 100 100 } 101 101 102 if (chosenEffectAllowed === "dummy") {103 // If a bad effectAllowed is attempted to be set, it should never be set, and the104 // effectAllowed should be uninitialized.105 shouldBeEqualToString("event.dataTransfer.effectAllowed", "uninitialized");106 107 // Then set the chosenEffectAllowed so isDropEffectAllowed matches the HTML5 spec, and108 // doesn't need special cases for undefined.109 chosenEffectAllowed = "uninitialized";110 }111 112 102 if (isDropEffectAllowed(chosenDropEffect, chosenEffectAllowed)) 113 103 shouldBeEqualToString('event.dataTransfer.dropEffect', dropEffectElem.options[dropEffectElem.selectedIndex].value); -
trunk/WebCore/ChangeLog
r53271 r53272 63 63 * bindings/v8/custom/V8XMLHttpRequestUploadCustom.cpp: 64 64 * bindings/v8/custom/V8XSLTProcessorCustom.cpp: 65 66 2010-01-14 Brian Weinstein <bweinstein@apple.com>67 68 Reviewed by Oliver Hunt.69 70 [DnD] effectAllowed and dropEffect can be set to bogus values.71 Fixes <https://bugs.webkit.org/show_bug.cgi?id=33635>.72 73 Test to make aure dropEffect and effectAllowed are being set to valid values74 when they are being set (list of valid values given by HTML5 specification).75 76 Also, drive by change to initialize dropEffect to none (as described in spec).77 78 Test: fast/events/bogus-dropEffect-effectAllowed.html79 80 * dom/Clipboard.cpp:81 (WebCore::Clipboard::Clipboard): Initialize m_dropEffect to "none".82 (WebCore::Clipboard::setDropEffect): Check if dropEffect is being set to a valid value.83 (WebCore::Clipboard::setEffectAllowed): Check if effectAllowed is being set to a valid value.84 65 85 66 2010-01-14 Martin Robinson <martin.james.robinson@gmail.com> -
trunk/WebCore/dom/Clipboard.cpp
r53270 r53272 36 36 37 37 Clipboard::Clipboard(ClipboardAccessPolicy policy, bool isForDragging) 38 : m_policy(policy) 39 , m_dropEffect("none") 38 : m_policy(policy) 40 39 , m_effectAllowed("uninitialized") 41 40 , m_dragStarted(false) … … 132 131 return; 133 132 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 138 133 if (m_policy == ClipboardReadable || m_policy == ClipboardTypesReadable) 139 134 m_dropEffect = effect; … … 145 140 return; 146 141 147 if (dragOpFromIEOp(effect) == DragOperationPrivate) {148 // This means that there was no conversion, and the effectAllowed that149 // 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 than153 // none, copy, copyLink, copyMove, link, linkMove, move, all, and uninitialized.154 return;155 }156 157 158 142 if (m_policy == ClipboardWritable) 159 143 m_effectAllowed = effect;
Note: See TracChangeset
for help on using the changeset viewer.