jenkins-bot has submitted this change and it was merged. 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 --- M src/ce/ve.ce.FocusableNode.js 1 file changed, 22 insertions(+), 21 deletions(-) Approvals: Trevor Parscal: Looks good to me, approved jenkins-bot: Verified 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/198216 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: Id361221bba9ea9f20c57eedeea6939bb48107727 Gerrit-PatchSet: 3 Gerrit-Project: VisualEditor/VisualEditor Gerrit-Branch: master Gerrit-Owner: Esanders <esand...@wikimedia.org> Gerrit-Reviewer: Trevor Parscal <tpars...@wikimedia.org> Gerrit-Reviewer: jenkins-bot <> _______________________________________________ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits