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

Unified Diff: chrome/browser/resources/chromeos/chromevox/common/selection_util.js

Issue 2943193002: Run clang-format on .js files in c/b/r/chromeos/chromevox (Closed)
Patch Set: Created 3 years, 6 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/resources/chromeos/chromevox/common/selection_util.js
diff --git a/chrome/browser/resources/chromeos/chromevox/common/selection_util.js b/chrome/browser/resources/chromeos/chromevox/common/selection_util.js
index 3057d2efc9bec9e49bb50c523bace282cee140d6..41fd78c77535a765fa9366aee48fac88a34d6c0a 100644
--- a/chrome/browser/resources/chromeos/chromevox/common/selection_util.js
+++ b/chrome/browser/resources/chromeos/chromevox/common/selection_util.js
@@ -93,7 +93,6 @@ cvox.SelectionUtil.cleanUpSentence = function(sel) {
var lastSelectionOffset;
while (expand) {
-
// nodeType:3 == TEXT_NODE
if (sel.focusNode.nodeType == 3) {
// The focus node is of type text, check end for period
@@ -105,8 +104,8 @@ cvox.SelectionUtil.cleanUpSentence = function(sel) {
if (fnode.substringData(sel.getRangeAt(0).endOffset - 1, 1) == '.') {
// Text node ends with period.
return true;
- } else if (fnode.substringData(sel.getRangeAt(0).endOffset - 1, 1) ==
- ' ') {
+ } else if (
+ fnode.substringData(sel.getRangeAt(0).endOffset - 1, 1) == ' ') {
// Text node ends with space.
return true;
} else {
@@ -186,8 +185,7 @@ cvox.SelectionUtil.findTopLeftPosition = function(targetNode) {
*/
cvox.SelectionUtil.isSelectionValid = function(sel) {
var regExpWhiteSpace = new RegExp(/^\s+$/);
- return (! ((regExpWhiteSpace.test(sel.toString())) ||
- (sel.toString() == '')));
+ return (!((regExpWhiteSpace.test(sel.toString())) || (sel.toString() == '')));
};
/**
@@ -199,8 +197,7 @@ cvox.SelectionUtil.isSelectionValid = function(sel) {
cvox.SelectionUtil.isRangeValid = function(range) {
var text = range.cloneContents().textContent;
var regExpWhiteSpace = new RegExp(/^\s+$/);
- return (! ((regExpWhiteSpace.test(text)) ||
- (text == '')));
+ return (!((regExpWhiteSpace.test(text)) || (text == '')));
};
/**
@@ -247,8 +244,8 @@ cvox.SelectionUtil.scrollElementsToView = function(focusNode) {
// Center the active element on the page once we know it's visible.
var pos = cvox.SelectionUtil.findPos_(focusNode);
- window.scrollTo(pos[0] - window.innerWidth / 2,
- pos[1] - window.innerHeight / 2);
+ window.scrollTo(
+ pos[0] - window.innerWidth / 2, pos[1] - window.innerHeight / 2);
};
/**
@@ -273,12 +270,11 @@ cvox.SelectionUtil.scrollToSelection = function(sel) {
var left = pos[1];
var scrolledVertically = window.pageYOffset ||
- document.documentElement.scrollTop ||
- document.body.scrollTop;
+ document.documentElement.scrollTop || document.body.scrollTop;
var pageHeight = window.innerHeight ||
document.documentElement.clientHeight || document.body.clientHeight;
- var pageWidth = window.innerWidth ||
- document.documentElement.innerWidth || document.body.clientWidth;
+ var pageWidth = window.innerWidth || document.documentElement.innerWidth ||
+ document.body.clientWidth;
if (left < pageWidth) {
left = 0;
@@ -331,9 +327,9 @@ cvox.SelectionUtil.isAllWs = function(node) {
*/
cvox.SelectionUtil.isIgnorable = function(node) {
- return (node.nodeType == 8) || // A comment node
- ((node.nodeType == 3) &&
- cvox.SelectionUtil.isAllWs(node)); // a text node, all ws
+ return (node.nodeType == 8) || // A comment node
+ ((node.nodeType == 3) &&
+ cvox.SelectionUtil.isAllWs(node)); // a text node, all ws
};
/**

Powered by Google App Engine
This is Rietveld 408576698