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

Side by Side Diff: third_party/WebKit/Source/devtools/front_end/platform/DOMExtension.js

Issue 1881233002: DevTools: workaround bug in Blink selection API (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 8 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
« no previous file with comments | « no previous file | no next file » | 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) 2007 Apple Inc. All rights reserved. 2 * Copyright (C) 2007 Apple Inc. All rights reserved.
3 * Copyright (C) 2012 Google Inc. All rights reserved. 3 * Copyright (C) 2012 Google Inc. All rights reserved.
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 * 8 *
9 * 1. Redistributions of source code must retain the above copyright 9 * 1. Redistributions of source code must retain the above copyright
10 * notice, this list of conditions and the following disclaimer. 10 * notice, this list of conditions and the following disclaimer.
(...skipping 330 matching lines...) Expand 10 before | Expand all | Expand 10 after
341 if (this.firstChild) 341 if (this.firstChild)
342 this.textContent = ""; 342 this.textContent = "";
343 } 343 }
344 344
345 /** 345 /**
346 * @return {boolean} 346 * @return {boolean}
347 */ 347 */
348 Element.prototype.isInsertionCaretInside = function() 348 Element.prototype.isInsertionCaretInside = function()
349 { 349 {
350 var selection = this.getComponentSelection(); 350 var selection = this.getComponentSelection();
351 if (!selection.rangeCount || !selection.isCollapsed) 351 // @see crbug.com/602541
352 var selectionRange = selection && selection.rangeCount ? selection.getRangeA t(0) : null;
353 if (!selectionRange || !selection.isCollapsed)
352 return false; 354 return false;
353 var selectionRange = selection.getRangeAt(0);
354 return selectionRange.startContainer.isSelfOrDescendant(this); 355 return selectionRange.startContainer.isSelfOrDescendant(this);
355 } 356 }
356 357
357 /** 358 /**
358 * @param {string} tagName 359 * @param {string} tagName
359 * @param {string=} customElementType 360 * @param {string=} customElementType
360 * @return {!Element} 361 * @return {!Element}
361 * @suppressGlobalPropertiesCheck 362 * @suppressGlobalPropertiesCheck
362 */ 363 */
363 function createElement(tagName, customElementType) 364 function createElement(tagName, customElementType)
(...skipping 621 matching lines...) Expand 10 before | Expand all | Expand 10 after
985 { 986 {
986 window.removeEventListener("DOMContentLoaded", windowLoaded, false); 987 window.removeEventListener("DOMContentLoaded", windowLoaded, false);
987 callback(); 988 callback();
988 } 989 }
989 990
990 if (document.readyState === "complete" || document.readyState === "interacti ve") 991 if (document.readyState === "complete" || document.readyState === "interacti ve")
991 callback(); 992 callback();
992 else 993 else
993 window.addEventListener("DOMContentLoaded", windowLoaded, false); 994 window.addEventListener("DOMContentLoaded", windowLoaded, false);
994 } 995 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698