Jforrester has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/198279

Change subject: Fix webkit column hack
......................................................................

Fix webkit column hack

* Was checking for 'size' (which doesn't exist) instead of 'width'
* The default value is 'auto', which isn't falsey.

As a result the webkit hack was triggering on all focusables.

Bug: T93322
Change-Id: Id361221bba9ea9f20c57eedeea6939bb48107727
(cherry picked from commit 2d14f7acd28787eb4bebc8ae7b02d95122e01cb8)
---
M src/ce/ve.ce.FocusableNode.js
1 file changed, 22 insertions(+), 21 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/VisualEditor/VisualEditor 
refs/changes/79/198279/1

diff --git a/src/ce/ve.ce.FocusableNode.js b/src/ce/ve.ce.FocusableNode.js
index 42d857c..f9ad510 100644
--- a/src/ce/ve.ce.FocusableNode.js
+++ b/src/ce/ve.ce.FocusableNode.js
@@ -406,7 +406,7 @@
  * Calculate position of highlights
  */
 ve.ce.FocusableNode.prototype.calculateHighlights = function () {
-       var i, l, $set,
+       var i, l, $set, columnCount, columnWidth,
                rects = [],
                filteredRects = [],
                webkitColumns = 'webkitColumnCount' in document.createElement( 
'div' ).style,
@@ -427,27 +427,28 @@
                        return;
                }
 
-               if (
-                       webkitColumns &&
-                       ( $el.css( '-webkit-column-count' ) || $el.css( 
'-webkit-column-size' ) )
-               ) {
-                       // Chrome incorrectly measures children of nodes with 
columns [1], let's
-                       // just ignore them rather than render a possibly 
bizarre highlight. They
-                       // will usually not be positioned, because Chrome also 
doesn't position
-                       // them correctly [2] and so people avoid doing it.
-                       //
-                       // Of course there are other ways to render a node 
outside the bounding
-                       // box of its parent, like negative margin. We do not 
handle these cases,
-                       // and the highlight may not correctly cover the entire 
node if that
-                       // happens. This can't be worked around without 
implementing CSS
-                       // layouting logic ourselves, which is not worth it.
-                       //
-                       // [1] 
http://code.google.com/p/chromium/issues/detail?id=391271
-                       // [2] 
https://code.google.com/p/chromium/issues/detail?id=291616
+               if ( webkitColumns ) {
+                       columnCount = $el.css( '-webkit-column-count' );
+                       columnWidth = $el.css( '-webkit-column-width' );
+                       if ( ( columnCount && columnCount !== 'auto' ) || ( 
columnWidth && columnWidth !== 'auto' ) ) {
+                               // Chrome incorrectly measures children of 
nodes with columns [1], let's
+                               // just ignore them rather than render a 
possibly bizarre highlight. They
+                               // will usually not be positioned, because 
Chrome also doesn't position
+                               // them correctly [2] and so people avoid doing 
it.
+                               //
+                               // Of course there are other ways to render a 
node outside the bounding
+                               // box of its parent, like negative margin. We 
do not handle these cases,
+                               // and the highlight may not correctly cover 
the entire node if that
+                               // happens. This can't be worked around without 
implementing CSS
+                               // layouting logic ourselves, which is not 
worth it.
+                               //
+                               // [1] 
https://code.google.com/p/chromium/issues/detail?id=391271
+                               // [2] 
https://code.google.com/p/chromium/issues/detail?id=291616
 
-                       // jQuery keeps nodes in its collections in document 
order, so the
-                       // children have not been processed yet and can be 
safely removed.
-                       $set = $set.not( $el.find( '*' ) );
+                               // jQuery keeps nodes in its collections in 
document order, so the
+                               // children have not been processed yet and can 
be safely removed.
+                               $set = $set.not( $el.find( '*' ) );
+                       }
                }
 
                clientRects = el.getClientRects();

-- 
To view, visit https://gerrit.wikimedia.org/r/198279
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Id361221bba9ea9f20c57eedeea6939bb48107727
Gerrit-PatchSet: 1
Gerrit-Project: VisualEditor/VisualEditor
Gerrit-Branch: wmf/1.25wmf22
Gerrit-Owner: Jforrester <jforres...@wikimedia.org>
Gerrit-Reviewer: Esanders <esand...@wikimedia.org>

_______________________________________________
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to