Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2)

Side by Side Diff: Source/core/editing/Editor.cpp

Issue 126443005: Use TreeScope::completeURL and baseURL instead of the Document versions (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Rebased again, passes tests Created 6 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « Source/core/dom/VisitedLinkState.cpp ('k') | Source/core/editing/MarkupAccumulator.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2006, 2007, 2008, 2011 Apple Inc. All rights reserved. 2 * Copyright (C) 2006, 2007, 2008, 2011 Apple Inc. All rights reserved.
3 * Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies) 3 * Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies)
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 429 matching lines...) Expand 10 before | Expand all | Expand 10 after
440 ASSERT(image); 440 ASSERT(image);
441 441
442 // FIXME: This should probably be reconciled with HitTestResult::absoluteIma geURL. 442 // FIXME: This should probably be reconciled with HitTestResult::absoluteIma geURL.
443 AtomicString urlString; 443 AtomicString urlString;
444 if (node->hasTagName(imgTag) || node->hasTagName(inputTag)) 444 if (node->hasTagName(imgTag) || node->hasTagName(inputTag))
445 urlString = toElement(node)->getAttribute(srcAttr); 445 urlString = toElement(node)->getAttribute(srcAttr);
446 else if (node->hasTagName(SVGNames::imageTag)) 446 else if (node->hasTagName(SVGNames::imageTag))
447 urlString = toElement(node)->getAttribute(XLinkNames::hrefAttr); 447 urlString = toElement(node)->getAttribute(XLinkNames::hrefAttr);
448 else if (node->hasTagName(embedTag) || node->hasTagName(objectTag)) 448 else if (node->hasTagName(embedTag) || node->hasTagName(objectTag))
449 urlString = toElement(node)->imageSourceURL(); 449 urlString = toElement(node)->imageSourceURL();
450 KURL url = urlString.isEmpty() ? KURL() : node->document().completeURL(strip LeadingAndTrailingHTMLSpaces(urlString)); 450 KURL url = urlString.isEmpty() ? KURL() : node->treeScope().completeURL(stri pLeadingAndTrailingHTMLSpaces(urlString));
451 451
452 pasteboard->writeImage(image, url, title); 452 pasteboard->writeImage(image, url, title);
453 } 453 }
454 454
455 // Returns whether caller should continue with "the default processing", which i s the same as 455 // Returns whether caller should continue with "the default processing", which i s the same as
456 // the event handler NOT setting the return value to false 456 // the event handler NOT setting the return value to false
457 bool Editor::dispatchCPPEvent(const AtomicString &eventType, ClipboardAccessPoli cy policy, PasteMode pasteMode) 457 bool Editor::dispatchCPPEvent(const AtomicString &eventType, ClipboardAccessPoli cy policy, PasteMode pasteMode)
458 { 458 {
459 Node* target = findEventTargetFromSelection(); 459 Node* target = findEventTargetFromSelection();
460 if (!target) 460 if (!target)
(...skipping 848 matching lines...) Expand 10 before | Expand all | Expand 10 after
1309 return m_frame.spellChecker(); 1309 return m_frame.spellChecker();
1310 } 1310 }
1311 1311
1312 void Editor::toggleOverwriteModeEnabled() 1312 void Editor::toggleOverwriteModeEnabled()
1313 { 1313 {
1314 m_overwriteModeEnabled = !m_overwriteModeEnabled; 1314 m_overwriteModeEnabled = !m_overwriteModeEnabled;
1315 frame().selection().setShouldShowBlockCursor(m_overwriteModeEnabled); 1315 frame().selection().setShouldShowBlockCursor(m_overwriteModeEnabled);
1316 } 1316 }
1317 1317
1318 } // namespace WebCore 1318 } // namespace WebCore
OLDNEW
« no previous file with comments | « Source/core/dom/VisitedLinkState.cpp ('k') | Source/core/editing/MarkupAccumulator.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698