') + ')', 'gi'); if (regex.test(text)) { found = true; var frag = document.createDocumentFragment(); var parts = text.split(regex); parts.forEach(function(part, i) { if (i % 2 === 0) { frag.appendChild(document.createTextNode(part)); } else { var span = document.createElement('span'); span.className = 'userscript-highlight'; span.textContent = part; frag.appendChild(span); } }); node.parentNode.replaceChild(frag, node); } }); } else if (node.nodeType === 1 && node.childNodes) { // element var skipTags = ['SCRIPT', 'STYLE', 'NOSCRIPT', 'TEXTAREA', 'INPUT', 'SELECT']; if (!skipTags.includes(node.tagName)) { Array.from(node.childNodes).forEach(highlight); } } } highlight(document.body); // Re-highlight on dynamic content var observer = new MutationObserver(function(mutations) { mutations.forEach(function(m) { m.addedNodes.forEach(function(node) { if (node.nodeType === 1 || node.nodeType === 3) highlight(node); }); }); }); observer.observe(document.body, { childList: true, subtree: true }); })(); } } catch(__e) { console.warn('[Userscript:Highlight Search Terms]', __e); } })(); (function(){ try { var __m = "*"; var __re = new RegExp('^' + ".*" + ', 'i'); if (__m === '*' || __re.test(location.href)) { // Strip utm_, fbclid, gclid, etc. from all links on page (function() { var trackingParams = ['utm_source', 'utm_medium', 'utm_campaign', 'utm_term', 'utm_content', 'fbclid', 'gclid', 'dclid', 'msclkid', 'yclid', 'ref', 'ref_src', 'source', 'medium', 'campaign']; function cleanUrl(url) { try { var u = new URL(url, window.location.origin); var changed = false; trackingParams.forEach(function(p) { if (u.searchParams.has(p)) { u.searchParams.delete(p); changed = true; } }); return changed ? u.toString() : url; } catch (e) { return url; } } function cleanLinks() { document.querySelectorAll('a[href]').forEach(function(a) { var clean = cleanUrl(a.href); if (clean !== a.href) a.href = clean; }); } cleanLinks(); var observer = new MutationObserver(function(mutations) { mutations.forEach(function(m) { m.addedNodes.forEach(function(node) { if (node.nodeType === 1) { if (node.tagName === 'A') cleanLinks(); node.querySelectorAll('a[href]').forEach(function(a) { var clean = cleanUrl(a.href); if (clean !== a.href) a.href = clean; }); } }); }); }); observer.observe(document.body, { childList: true, subtree: true }); })(); } } catch(__e) { console.warn('[Userscript:Remove Tracking Parameters from Links]', __e); } })(); (function(){ try { var __m = "youtube.com"; var __re = new RegExp('^' + "youtube\\.com" + ', 'i'); if (__m === '*' || __re.test(location.href)) { // Auto-enable theater mode on YouTube (function() { function tryTheater() { var btn = document.querySelector('button[aria-label="Theater mode"], ytd-player #player button[title="Theater mode"]'); if (btn && !btn.classList.contains('activated')) { btn.click(); } } // Try immediately tryTheater(); // Try after navigation (SPA) var lastUrl = location.href; setInterval(function() { if (location.href !== lastUrl) { lastUrl = location.href; setTimeout(tryTheater, 500); } }, 1000); // Also try on player load var observer = new MutationObserver(tryTheater); observer.observe(document.body, { childList: true, subtree: true }); })(); } } catch(__e) { console.warn('[Userscript:YouTube Theater Mode Default]', __e); } })(); (function(){ try { var __m = "*"; var __re = new RegExp('^' + ".*" + ', 'i'); if (__m === '*' || __re.test(location.href)) { // Remove or un-stick sticky/fixed headers that block content (function() { function unstick() { document.querySelectorAll('header, nav, [role="banner"], .header, .navbar, .sticky, .fixed-top, [style*="position: fixed"], [style*="position:sticky"]').forEach(function(el) { if (el.style.position === 'fixed' || el.style.position === 'sticky' || getComputedStyle(el).position === 'fixed' || getComputedStyle(el).position === 'sticky') { el.style.position = 'static'; el.style.top = 'auto'; el.style.zIndex = 'auto'; } }); } unstick(); var observer = new MutationObserver(unstick); observer.observe(document.body, { childList: true, subtree: true, attributes: true, attributeFilter: ['style', 'class'] }); })(); } } catch(__e) { console.warn('[Userscript:Kill Sticky Headers]', __e); } })(); })(); Phase out *-baseline in `table` as IE doesn't follow this part of the SVG standard by monfera · Pull Request #2076 · plotly/plotly.js · GitHub
Skip to content

Phase out *-baseline in table as IE doesn't follow this part of the SVG standard - #2076

Merged
monfera merged 3 commits into
masterfrom
table-firefox-baseline
Oct 10, 2017
Merged

Phase out *-baseline in table as IE doesn't follow this part of the SVG standard#2076
monfera merged 3 commits into
masterfrom
table-firefox-baseline

Conversation

@monfera

Copy link
Copy Markdown
Contributor

Local, recent Firefox doesn't adhere to alignment-baseline here, this tests effects on CI.

@monferamonfera self-assigned this Oct 9, 2017
@monfera
monferaforce-pushed the table-firefox-baseline branch from 1fd18c3 to 7df8c2bCompareOctober 9, 2017 21:54
@monfera

Copy link
Copy Markdown
ContributorAuthor

It fixed the local FF misalignment of unwrapped lines:

image

... and it didn't break the same thing which evidently worked fine on CI (test cases intact).

Also, adding a similar fix to parcoords, where the effect of the problem (locally) was much less noticeable, and similarly, it worked fine on CI.

So I'm proposing this for merging.

@monfera

Copy link
Copy Markdown
ContributorAuthor

Thanks @alexcjohnson for bringing up an issue seen in CI (separate one, not dealt with by this PR) that led to to these FF problems.

@alexcjohnson

Copy link
Copy Markdown
Collaborator

I do like those mocks a bit better, but now I'm rather confused... parcoords plots look fine in IE11 but according to a quick check on browserstack neither alignment-baseline nor dominant-baseline works there? How is that possible? Suffice it to say it doesn't seem to me like these attributes (or styles?) are really ready for prime time. How hard would it be to 🔪 them entirely?

dominant baseline chrome - http://bl.ocks.org/eweitnauer/7325338 (assumed to be the authority)
dominant baseline chrome

dominant baseline ff - seems to work but somewhat differently (baseline-shift fails, dominant-baseline has small differences)
dominant baseline ff

dominant baseline ie11 - fail
dominant baseline ie11

alignment baseline chrome - https://bl.ocks.org/emmasaunders/0016ee0a2cab25a643ee9bd4855d3464
alignment baseline chrome

alignment baseline ff - fail
alignment baseline ff

alignment baseline ie11 - fail
alignment baseline ie11

@monfera

Copy link
Copy Markdown
ContributorAuthor

Indeed! This says it's not supported by IE: https://msdn.microsoft.com/en-us/library/gg558060(v=vs.85).aspx

Looks like we need to do the dy: 0.35em trick for central/middle and something analogous for hanging.

@monfera
monferaforce-pushed the table-firefox-baseline branch from d7e2d9d to ea94d21CompareOctober 10, 2017 08:30
@monfera

Copy link
Copy Markdown
ContributorAuthor

There are still some vertical misalignments specifically in CI, adding a separate item. The purpose of this ticket is, after @alexcjohnson 's IE testing, merely the replacement of *-baseline attributes with something even IE adheres to. This is a big improvement because, without this PR, Firefox and especially IE rendering have serious alignment problems so its separate merge is suggested.

@monferamonfera changed the title Switch to dominant-baseline in tablePhase out *-baseline in table as IE doesn't follow this part of the SVG standardOct 10, 2017

@alexcjohnsonalexcjohnson left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Excellent, thanks. 💃 And thanks for calling out the remaining alignment CI issues in #2056

@monfera
monfera merged commit c3f0a18 into masterOct 10, 2017
@monfera
monfera deleted the table-firefox-baseline branch October 10, 2017 14:58
@AlexVvxAlexVvx mentioned this pull request Dec 6, 2017
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bugsomething broken

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

@monfera@alexcjohnson