From f7659ebc723ee7afbf82c77e3d05ace349ca5ed9 Mon Sep 17 00:00:00 2001 From: Karol Rozycki Date: Thu, 21 Jul 2016 23:51:55 +0100 Subject: [PATCH] Replace 'iff' with 'if and only if' --- src/lib/custom-style.html | 6 ++++-- src/lib/dom-api-shady.html | 21 +++++++++++---------- src/lib/experimental/patch-dom.html | 2 +- src/lib/template/dom-if.html | 2 +- src/mini/shady.html | 2 +- src/standard/gestures.html | 4 ++-- src/standard/styling.html | 2 +- src/standard/x-styling.html | 10 +++++----- 8 files changed, 26 insertions(+), 23 deletions(-) diff --git a/src/lib/custom-style.html b/src/lib/custom-style.html index 688237d439..bad8dd0746 100644 --- a/src/lib/custom-style.html +++ b/src/lib/custom-style.html @@ -129,7 +129,8 @@ this.__appliedElement.__cssBuild = this.__cssBuild; } // needed becuase elements in imports do not get 'attached' - // TODO(sorvell): we could only do this iff this.ownerDocument != document; + // TODO(sorvell): we could only do this if and only if + // this.ownerDocument != document; // however, if we do that, we also have to change the `attached` // code to go at `_beforeAttached` time because this is when // elements produce styles (otherwise this breaks @apply shim) @@ -144,7 +145,8 @@ _tryApply: function() { if (!this._appliesToDocument) { - // only apply variables iff this style is not inside a dom-module + // only apply variables if and only if this style is not inside + // a dom-module if (this.parentNode && (this.parentNode.localName !== 'dom-module')) { this._appliesToDocument = true; diff --git a/src/lib/dom-api-shady.html b/src/lib/dom-api-shady.html index 7c4da0b23b..9c278fc444 100644 --- a/src/lib/dom-api-shady.html +++ b/src/lib/dom-api-shady.html @@ -45,8 +45,8 @@ }, // cases in which we may not be able to just do standard native call - // 1. container has a shadyRoot (needsDistribution IFF the shadyRoot - // has an insertion point) + // 1. container has a shadyRoot (needsDistribution if and only if the + // shadyRoot has an insertion point) // 2. container is a shadyRoot (don't distribute, instead set // container to container.host. // 3. node is (host of container needs distribution) @@ -55,7 +55,7 @@ throw Error('The ref_node to be inserted before is not a child ' + 'of this node'); } - // remove node from its current position iff it's in a tree. + // remove node from its current position if and only if it's in a tree. if (node.nodeType !== Node.DOCUMENT_FRAGMENT_NODE) { var parent = TreeApi.Logical.getParentNode(node); // notify existing parent that this node is being removed. @@ -87,7 +87,7 @@ }, // Try to add node. Record logical info, track insertion points, perform - // distribution iff needed. Return true if the add is handled. + // distribution if and only if needed. Return true if the add is handled. _addNode: function(node, ref_node) { var root = this.getOwnerRoot(); if (root) { @@ -95,7 +95,7 @@ // since this saves logical tree info; however, invalidation state // needs var ipAdded = this._maybeAddInsertionPoint(node, this.node); - // invalidate insertion points IFF not already invalid! + // invalidate insertion points if and only if not already invalid! if (!root._invalidInsertionPoints) { root._invalidInsertionPoints = ipAdded; } @@ -110,7 +110,8 @@ // if shady is handling this node, // the actual dom may not be removed if the node or fragment contents // remain undistributed so we ensure removal here. - // NOTE: we only remove from existing location iff shady dom is involved. + // NOTE: we only remove from existing location if and only if shady dom is + // involved. // This is because a node fragment is passed to the native add method // which expects to see fragment children. Regular elements must also // use this check because not doing so causes separation of @@ -154,8 +155,8 @@ return node; }, - // Try to remove node: update logical info and perform distribution iff - // needed. Return true if the removal has been handled. + // Try to remove node: update logical info and perform distribution if and + // only if needed. Return true if the removal has been handled. // note that it's possible for both the node's host and its parent // to require distribution... both cases are handled here. _removeNode: function(node) { @@ -165,10 +166,10 @@ var distributed; var root = this._ownerShadyRootForNode(node); if (logicalParent) { - // distribute node's parent iff needed + // distribute node's parent if and only if needed distributed = dom(node)._maybeDistributeParent(); TreeApi.Logical.recordRemoveChild(node, logicalParent); - // remove node from root and distribute it iff needed + // remove node from root and distribute it if and only if needed if (root && this._removeDistributedChildren(root, node)) { root._invalidInsertionPoints = true; this._lazyDistribute(root.host); diff --git a/src/lib/experimental/patch-dom.html b/src/lib/experimental/patch-dom.html index d326d393d0..1d28785fae 100644 --- a/src/lib/experimental/patch-dom.html +++ b/src/lib/experimental/patch-dom.html @@ -241,7 +241,7 @@ // NOTE: patch logical implementations here so we can use // composed getters - // TODO(sorvell): may need to patch saveChildNodes iff the tree has + // TODO(sorvell): may need to patch saveChildNodes if and only if the tree has // already been distributed. TreeApi.Logical.recordInsertBefore = function(node, container, ref_node) { container.__dom.childNodes = null; diff --git a/src/lib/template/dom-if.html b/src/lib/template/dom-if.html index 500f56f372..67edab16d4 100644 --- a/src/lib/template/dom-if.html +++ b/src/lib/template/dom-if.html @@ -13,7 +13,7 @@