| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2007, 2009, 2010 Apple Inc. All rights reserved. | 2 * Copyright (C) 2007, 2009, 2010 Apple Inc. All rights reserved. |
| 3 * Copyright (C) 2008 Google Inc. | 3 * Copyright (C) 2008 Google Inc. |
| 4 * | 4 * |
| 5 * Redistribution and use in source and binary forms, with or without | 5 * Redistribution and use in source and binary forms, with or without |
| 6 * modification, are permitted provided that the following conditions | 6 * modification, are permitted provided that the following conditions |
| 7 * are met: | 7 * are met: |
| 8 * 1. Redistributions of source code must retain the above copyright | 8 * 1. Redistributions of source code must retain the above copyright |
| 9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
| 10 * 2. Redistributions in binary form must reproduce the above copyright | 10 * 2. Redistributions in binary form must reproduce the above copyright |
| (...skipping 151 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 162 RefPtr<HTMLAnchorElement> anchor = HTMLAnchorElement::create(doc
ument); | 162 RefPtr<HTMLAnchorElement> anchor = HTMLAnchorElement::create(doc
ument); |
| 163 anchor->setHref(url); | 163 anchor->setHref(url); |
| 164 if (title.isEmpty()) { | 164 if (title.isEmpty()) { |
| 165 // Try the plain text first because the url might be normali
zed or escaped. | 165 // Try the plain text first because the url might be normali
zed or escaped. |
| 166 if (dragData->containsPlainText()) | 166 if (dragData->containsPlainText()) |
| 167 title = dragData->asPlainText(frame); | 167 title = dragData->asPlainText(frame); |
| 168 if (title.isEmpty()) | 168 if (title.isEmpty()) |
| 169 title = url; | 169 title = url; |
| 170 } | 170 } |
| 171 RefPtr<Node> anchorText = document->createTextNode(title); | 171 RefPtr<Node> anchorText = document->createTextNode(title); |
| 172 anchor->appendChild(anchorText, IGNORE_EXCEPTION); | 172 anchor->appendChild(anchorText, IGNORE_EXCEPTION, DeprecatedAtta
chNow); |
| 173 RefPtr<DocumentFragment> fragment = document->createDocumentFrag
ment(); | 173 RefPtr<DocumentFragment> fragment = document->createDocumentFrag
ment(); |
| 174 fragment->appendChild(anchor, IGNORE_EXCEPTION); | 174 fragment->appendChild(anchor, IGNORE_EXCEPTION, DeprecatedAttach
Now); |
| 175 return fragment.get(); | 175 return fragment.get(); |
| 176 } | 176 } |
| 177 } | 177 } |
| 178 } | 178 } |
| 179 if (allowPlainText && dragData->containsPlainText()) { | 179 if (allowPlainText && dragData->containsPlainText()) { |
| 180 chosePlainText = true; | 180 chosePlainText = true; |
| 181 return createFragmentFromText(context.get(), dragData->asPlainText(frame
)).get(); | 181 return createFragmentFromText(context.get(), dragData->asPlainText(frame
)).get(); |
| 182 } | 182 } |
| 183 | 183 |
| 184 return 0; | 184 return 0; |
| (...skipping 745 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 930 return false; | 930 return false; |
| 931 #endif | 931 #endif |
| 932 } | 932 } |
| 933 | 933 |
| 934 void DragController::cleanupAfterSystemDrag() | 934 void DragController::cleanupAfterSystemDrag() |
| 935 { | 935 { |
| 936 } | 936 } |
| 937 | 937 |
| 938 } // namespace WebCore | 938 } // namespace WebCore |
| 939 | 939 |
| OLD | NEW |