From 1da42403ec84fcbb634a816bec0618e47d5e0b70 Mon Sep 17 00:00:00 2001 From: Moonchild Date: Sat, 5 Sep 2020 18:44:16 +0000 Subject: Issue #1525 - Kill marquee element (uplift) --- layout/style/contenteditable.css | 9 - layout/style/moz.build | 1 - layout/style/nsCSSParser.cpp | 24 +- layout/style/res/html.css | 17 - layout/style/xbl-marquee/jar.mn | 8 - layout/style/xbl-marquee/moz.build | 7 - layout/style/xbl-marquee/xbl-marquee.css | 12 - layout/style/xbl-marquee/xbl-marquee.xml | 733 ------------------------------- 8 files changed, 11 insertions(+), 800 deletions(-) delete mode 100644 layout/style/xbl-marquee/jar.mn delete mode 100644 layout/style/xbl-marquee/moz.build delete mode 100644 layout/style/xbl-marquee/xbl-marquee.css delete mode 100644 layout/style/xbl-marquee/xbl-marquee.xml (limited to 'layout/style') diff --git a/layout/style/contenteditable.css b/layout/style/contenteditable.css index c550bc7c9..6d569f75e 100644 --- a/layout/style/contenteditable.css +++ b/layout/style/contenteditable.css @@ -80,15 +80,6 @@ input[contenteditable="true"][type="file"] { -moz-user-focus: none !important; } -/* emulation of non-standard HTML tag */ -marquee:-moz-read-write { - -moz-binding: url('chrome://xbl-marquee/content/xbl-marquee.xml#marquee-horizontal-editable'); -} - -marquee[direction="up"]:-moz-read-write, marquee[direction="down"]:-moz-read-write { - -moz-binding: url('chrome://xbl-marquee/content/xbl-marquee.xml#marquee-vertical-editable'); -} - *|*:-moz-read-write > input[type="hidden"], input[contenteditable="true"][type="hidden"] { border: 1px solid black !important; diff --git a/layout/style/moz.build b/layout/style/moz.build index ff06b5101..bdc86ee99 100644 --- a/layout/style/moz.build +++ b/layout/style/moz.build @@ -19,7 +19,6 @@ with Files('CSSRuleList.*'): with Files('nsDOM*'): BUG_COMPONENT = ('Core', 'DOM: CSS Object Model') -DIRS += ['xbl-marquee'] TEST_DIRS += ['test'] XPIDL_SOURCES += [ diff --git a/layout/style/nsCSSParser.cpp b/layout/style/nsCSSParser.cpp index 556e35406..f6b84bfac 100644 --- a/layout/style/nsCSSParser.cpp +++ b/layout/style/nsCSSParser.cpp @@ -5941,8 +5941,6 @@ CSSParserImpl::ParseAttributeSelector(int32_t& aDataMask, "language", "defer", "type", - // additional attributes not in HTML4 - "direction", // marquee nullptr }; short i = 0; @@ -15318,17 +15316,17 @@ CSSParserImpl::ParseFontFeatureSettings(nsCSSValue& aValue) return true; } -bool -CSSParserImpl::ParseFontVariationSettings(nsCSSValue& aValue) -{ - // TODO: Actually implement this. - - // This stub is here because websites insist on considering this - // very hardware-dependent and O.S.-variable low-level font-control - // as a "critical feature" which it isn't as there is 0 guarantee - // that font variation settings are supported or honored by any - // operating system used by the client. - return true; +bool +CSSParserImpl::ParseFontVariationSettings(nsCSSValue& aValue) +{ + // TODO: Actually implement this. + + // This stub is here because websites insist on considering this + // very hardware-dependent and O.S.-variable low-level font-control + // as a "critical feature" which it isn't as there is 0 guarantee + // that font variation settings are supported or honored by any + // operating system used by the client. + return true; } bool diff --git a/layout/style/res/html.css b/layout/style/res/html.css index 44e41c8d0..b975bf0c9 100644 --- a/layout/style/res/html.css +++ b/layout/style/res/html.css @@ -64,7 +64,6 @@ legend, li, listing, main, -marquee, menu, nav, noframes, @@ -819,25 +818,9 @@ dialog:not([open]) { display: none; } -/* emulation of non-standard HTML tag */ -marquee { - inline-size: -moz-available; - display: inline-block; - vertical-align: text-bottom; - text-align: start; - -moz-binding: url('chrome://xbl-marquee/content/xbl-marquee.xml#marquee-horizontal'); -} - -marquee[direction="up"], marquee[direction="down"] { - -moz-binding: url('chrome://xbl-marquee/content/xbl-marquee.xml#marquee-vertical'); - block-size: 200px; -} - /* PRINT ONLY rules follow */ @media print { - marquee { -moz-binding: none; } - } /* Ruby */ diff --git a/layout/style/xbl-marquee/jar.mn b/layout/style/xbl-marquee/jar.mn deleted file mode 100644 index 9247cb4a1..000000000 --- a/layout/style/xbl-marquee/jar.mn +++ /dev/null @@ -1,8 +0,0 @@ -# This Source Code Form is subject to the terms of the Mozilla Public -# License, v. 2.0. If a copy of the MPL was not distributed with this -# file, You can obtain one at http://mozilla.org/MPL/2.0/. - -toolkit.jar: -% content xbl-marquee %content/xbl-marquee/ contentaccessible=yes - content/xbl-marquee/xbl-marquee.xml - content/xbl-marquee/xbl-marquee.css diff --git a/layout/style/xbl-marquee/moz.build b/layout/style/xbl-marquee/moz.build deleted file mode 100644 index eb4454d28..000000000 --- a/layout/style/xbl-marquee/moz.build +++ /dev/null @@ -1,7 +0,0 @@ -# -*- Mode: python; indent-tabs-mode: nil; tab-width: 40 -*- -# vim: set filetype=python: -# This Source Code Form is subject to the terms of the Mozilla Public -# License, v. 2.0. If a copy of the MPL was not distributed with this -# file, You can obtain one at http://mozilla.org/MPL/2.0/. - -JAR_MANIFESTS += ['jar.mn'] \ No newline at end of file diff --git a/layout/style/xbl-marquee/xbl-marquee.css b/layout/style/xbl-marquee/xbl-marquee.css deleted file mode 100644 index e6d3ee94b..000000000 --- a/layout/style/xbl-marquee/xbl-marquee.css +++ /dev/null @@ -1,12 +0,0 @@ -/* This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ - -/* PRINT ONLY rules */ -@media print { - - marquee > * > * { - margin: 0 !important; - padding: 0 !important; - } /* This hack is needed until bug 119078 gets fixed */ -} diff --git a/layout/style/xbl-marquee/xbl-marquee.xml b/layout/style/xbl-marquee/xbl-marquee.xml deleted file mode 100644 index bb837624d..000000000 --- a/layout/style/xbl-marquee/xbl-marquee.xml +++ /dev/null @@ -1,733 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - var val = parseInt(val); - if (val > 0 ) { - this.setAttribute("scrolldelay", val); - } - - - - - - - - - - - - - - - this._mutationActor(this._mutationObserver.takeRecords()); - return this._direction; - - - - - - - - - this._mutationActor(this._mutationObserver.takeRecords()); - return this._behavior; - - - if (typeof val == 'string') { - val = val.toLowerCase(); - } - if (val == "alternate" || val == "slide" || val == 'scroll') { - this.setAttribute("behavior", val); - } - - - - - - - - - - 0) { - this.setAttribute("loop", val); - } - ]]> - - - - - - - return this.getAttribute("onstart"); - - - this._setEventListener("start", val, true); - this.setAttribute("onstart", val); - - - - - - return this.getAttribute("onfinish"); - - - this._setEventListener("finish", val, true); - this.setAttribute("onfinish", val); - - - - - - return this.getAttribute("onbounce"); - - - this._setEventListener("bounce", val, true); - this.setAttribute("onbounce", val); - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - this.outerDiv.offsetHeight) { - corrvalue = this.originalHeight - this.outerDiv.offsetHeight; - } - this.innerDiv.style.padding = height + " 0"; - this.dirsign = 1; - this.startAt = (this._behavior == 'alternate') ? (this.originalHeight - corrvalue) : 0; - this.stopAt = (this._behavior == 'alternate' || this._behavior == 'slide') ? - (parseInt(height) + corrvalue) : (this.originalHeight + parseInt(height)); - break; - - case "down": - var height = document.defaultView.getComputedStyle(this, "").height; - this.outerDiv.style.height = height; - if (this.originalHeight > this.outerDiv.offsetHeight) { - corrvalue = this.originalHeight - this.outerDiv.offsetHeight; - } - this.innerDiv.style.padding = height + " 0"; - this.dirsign = -1; - this.startAt = (this._behavior == 'alternate') ? - (parseInt(height) + corrvalue) : (this.originalHeight + parseInt(height)); - this.stopAt = (this._behavior == 'alternate' || this._behavior == 'slide') ? - (this.originalHeight - corrvalue) : 0; - break; - - case "right": - if (this.innerDiv.offsetWidth > this.outerDiv.offsetWidth) { - corrvalue = this.innerDiv.offsetWidth - this.outerDiv.offsetWidth; - } - this.dirsign = -1; - this.stopAt = (this._behavior == 'alternate' || this._behavior == 'slide') ? - (this.innerDiv.offsetWidth - corrvalue) : 0; - this.startAt = this.outerDiv.offsetWidth + ((this._behavior == 'alternate') ? - corrvalue : (this.innerDiv.offsetWidth + this.stopAt)); - break; - - case "left": - default: - if (this.innerDiv.offsetWidth > this.outerDiv.offsetWidth) { - corrvalue = this.innerDiv.offsetWidth - this.outerDiv.offsetWidth; - } - this.dirsign = 1; - this.startAt = (this._behavior == 'alternate') ? (this.innerDiv.offsetWidth - corrvalue) : 0; - this.stopAt = this.outerDiv.offsetWidth + - ((this._behavior == 'alternate' || this._behavior == 'slide') ? - corrvalue : (this.innerDiv.offsetWidth + this.startAt)); - } - - if (aResetPosition) { - this.newPosition = this.startAt; - this._fireEvent("start", false, false); - } - } //end if - - this.newPosition = this.newPosition + (this.dirsign * this._scrollAmount); - - if ((this.dirsign == 1 && this.newPosition > this.stopAt) || - (this.dirsign == -1 && this.newPosition < this.stopAt)) - { - switch (this._behavior) - { - case 'alternate': - // lets start afresh - this.startNewDirection = true; - - // swap direction - const swap = {left: "right", down: "up", up: "down", right: "left"}; - this._direction = swap[this._direction]; - this.newPosition = this.stopAt; - - if ((this._direction == "up") || (this._direction == "down")) { - this.outerDiv.scrollTop = this.newPosition; - } else { - this.outerDiv.scrollLeft = this.newPosition; - } - - if (this._loop != 1) { - this._fireEvent("bounce", false, true); - } - break; - - case 'slide': - if (this._loop > 1) { - this.newPosition = this.startAt; - } - break; - - default: - this.newPosition = this.startAt; - - if ((this._direction == "up") || (this._direction == "down")) { - this.outerDiv.scrollTop = this.newPosition; - } else { - this.outerDiv.scrollLeft = this.newPosition; - } - - //dispatch start event, even when this._loop == 1, comp. with IE6 - this._fireEvent("start", false, false); - } - - if (this._loop > 1) { - this._loop--; - } else if (this._loop == 1) { - if ((this._direction == "up") || (this._direction == "down")) { - this.outerDiv.scrollTop = this.stopAt; - } else { - this.outerDiv.scrollLeft = this.stopAt; - } - this.stop(); - this._fireEvent("finish", false, true); - return; - } - } - else { - if ((this._direction == "up") || (this._direction == "down")) { - this.outerDiv.scrollTop = this.newPosition; - } else { - this.outerDiv.scrollLeft = this.newPosition; - } - } - - var myThis = this; - var lambda = function myTimeOutFunction(){myThis._doMove(false);} - this.runId = window.setTimeout(lambda, this._scrollDelay); - ]]> - - - - - - - - - - - - - 0) { - var mutation = aMutations.shift(); - var attrName = mutation.attributeName.toLowerCase(); - var oldValue = mutation.oldValue; - var target = mutation.target; - var newValue = target.getAttribute(attrName); - - if (oldValue != newValue) { - switch (attrName) { - case "loop": - target._set_loop(newValue); - if (target.rundId == 0) { - target.start(); - } - break; - case "scrollamount": - target._set_scrollAmount(newValue); - break; - case "scrolldelay": - target._set_scrollDelay(newValue); - target.stop(); - target.start(); - break; - case "truespeed": - //needed to update target._scrollDelay - var myThis = target; - var lambda = function() {myThis._set_scrollDelay(myThis.getAttribute('scrolldelay'));} - window.setTimeout(lambda, 0); - break; - case "behavior": - target._set_behavior(newValue); - target.startNewDirection = true; - if ((oldValue == "slide" && target.newPosition == target.stopAt) || - newValue == "alternate" || newValue == "slide") { - target.stop(); - target._doMove(true); - } - break; - case "direction": - if (!newValue) { - newValue = "left"; - } - target._set_direction(newValue); - break; - case "width": - case "height": - target.startNewDirection = true; - break; - case "onstart": - target._setEventListener("start", newValue); - break; - case "onfinish": - target._setEventListener("finish", newValue); - break; - case "onbounce": - target._setEventListener("bounce", newValue); - break; - } - } - } - ]]> - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -- cgit v1.2.3