Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix style matching in Firefox 67 #2485

Merged
merged 1 commit into from
May 24, 2019
Merged

Fix style matching in Firefox 67 #2485

merged 1 commit into from
May 24, 2019

Conversation

NeilFraser
Copy link
Contributor

Chrome returns transform: translate(107px, 0px); whereas Firefox now returns transform: translate(107px); if the y value is 0. This is consistent with existing behaviour in the translate SVG attribute.

The comment in our code specifically states:
// Accounts for same exceptions as XY_REGEX_
Yet that was not true at all.

This PR makes the y argument optional (as falsely described in the comment). It also merges the 2D and 3D regeps together to simplify the code.

Resolves issue #2482. Needs to be cherrypicked to Master and everything rebuilt and pushed.

Chrome returns ‘transform: translate(107px, 0px);’ whereas Firefox now returns ‘transform: translate(107px);’ if the y value is 0.  This is consistent with existing behaviour in the translate SVG attribute.

The comment in our code specifically states:
// Accounts for same exceptions as XY_REGEX_
Yet that was not true at all.

This PR makes the y argument optional (as falsely described in the comment).  It also merges the 2D and 3D regeps together to simplify the code.

Resolves issue #2482.  Needs to be cherrypicked to Master and everything rebuilt and pushed.
@RoboErikG RoboErikG merged commit a4e0091 into develop May 24, 2019
@NeilFraser NeilFraser deleted the fraser-xy-regexp branch May 24, 2019 16:11
towerofnix added a commit to towerofnix/scratch-blocks that referenced this pull request May 24, 2019
(Ported from PR google/blockly#2485, which is by @NeilFraser.
 Description from that PR follows:)

Chrome returns ‘transform: translate(107px, 0px);’ whereas Firefox now
returns ‘transform: translate(107px);’ if the y value is 0.  This is
consistent with existing behaviour in the translate SVG attribute.

The comment in our code specifically states:
// Accounts for same exceptions as XY_REGEX_
Yet that was not true at all.

This PR makes the y argument optional (as falsely described in the
comment).  It also merges the 2D and 3D regeps together to simplify the
code.
papaphil pushed a commit to papaphil/DataTools-scratch-blocks that referenced this pull request Nov 15, 2019
* Add dart to gitignore

* Fix typo in cleanup.sh file

* Field dropdown calls menu item values that are functions

* Add SOUND_RECORD localization

* Sync translations with transifex

Added arabic

* Fixes webpack problem breaking 'npm install' (scratchfoundation#1739)

Running 'npm install' from fresh repo will result in error.
Fixed by forcing never versions of webpack and webpack-cli, see: webpack/webpack#8082

* fixed missing argType declaration (scratchfoundation#1738)

ArgType was declared in field_dropdown, but not in field_varible. This prevented some css theming.

* Fix scratchfoundation#1506 (scratchfoundation#1741)

* Fix scratchfoundation#1647 (scratchfoundation#1742)

* Fix scratchfoundation#1408 (scratchfoundation#1740)

* Use grandparent block colours for number picker dropdowns (scratchfoundation#1744)

* Fix scratchfoundation#1345.  Android triggers a window resize event when the soft keyboard pops up (i.e. when the text field is focused) which caused us to call hideChaff and close the widget div, unfocusing the text input and auto-closing the keyboard. This PR adds a new method to call from the window resize handler that moves the widget div rather than hiding it. (scratchfoundation#1743)

* Choose sensible defaults for custom procedure parameters.

* Initialize currentDragDeltaXY_ correctly (scratchfoundation#1747)

* Remove unneeded logs (scratchfoundation#1748)

* Use different text for variable and list deletion/renaming (scratchfoundation#1750)

* Add a context menu to the list getter block (scratchfoundation#1749)

* Don't allow illegal connections to procedure prototype blocks (scratchfoundation#1751)

* Update translations

* Add some missing utility functions

* Add play note block to default toolbox for testing

* Fix procedure definition blocks with trailing text (scratchfoundation#1755)

* Automate translation update (scratchfoundation#1752)

* Add transifex node package to support syncing scripts
* Add scripts to push source `en.json` to Transifex and download translations to generate `scratch_msgs.js`
* Adds a test to ensure that changes to `msg/messages.js` have been reflected in the source and generated `scratch_msgs.js`
* gets the list of supported languages from scratch-l10n

* Remove custom touch handling for dropdowns (scratchfoundation#1756)

* Add note field with SVG piano keys

* Draw black and white keys in a single loop

* Key highlighting

* Add note name indicator

* Add playNote function to override

* Add octave buttons

* Labels on low and high C keys

* function to add C key labels

* Only show one octave (13 keys)

* Handle octave display state

and re-arrange and rename some fns for clarity

* Fix C key fill color

* Remove extra bottom padding

* Allow block comments to be editable on mobile by catching the mousedown event and grabbing focus instead of the mouse up.  This makes the experience a bit worse in firefox (you have to click twice to focus the comment now), but fixing this the right way is invovled.  See scratchfoundation#1631 for full context. (scratchfoundation#1757)

* Octave shift animation

* Fix octave change bugs

* Add validator

* sync translations (scratchfoundation#1761)

* Cleanup and JSDOC

* Precisely position the piano keys, so the stroke appears the same on all sides

* Update octave button and fix positioning

* Adjust piano key positioning

* Remove console.log

* Hide and show C key labels

* Animate C key label visibility

* Cleanup

* Use unicode sharp and flat symbols

* Disable pointer events on field angle arrow to fix firefox dragging

* Ensmallen the delete area to not extend above and below the flyout

* Fix comment

* Optimize SVG

* Clarify variable names for fieldEditorWidth_ and fieldEditorHeight_

* Dispose SVG elements

* Octave button handlers directly call octave changers

* Gave the drag handle a bit more spaceing to avoid glow getting cut (scratchfoundation#1767)

* Correctly dispose keySVGs array

* Fix local compile on Windows

We call the local compiler with `subprocess.Popen`, passing
`google-closure-compiler` as the command to run. On Windows, the actual
command is `google-closure-compiler.cmd` -- the extension is
automatically added by the shell. Unfortunately `subprocess.Popen` by
default bypasses the shell, leading to an error. Setting `shell=True`
makes `Popen` use the Windows shell (`cmd`) and correctky find
`google-closure-compiler.cmd`.

* Sync translations with Transifex

update translations

* Revert "Merge pull request scratchfoundation#1772 from cwillisf/windows-fix-local-compile"

This reverts commit 4ffecde, reversing
changes made to b63e5c6.

What I thought were spurious build failures on CI were apparently legit...

* Support scientific notation in numerical inputs

* Make insertion markers for define blocks have the correct width (scratchfoundation#1781)

* Fix scratchfoundation#1186

* Added comment to clarify which case is being handled

* Allow uppercase E in numbers as well

* Track cloud variable info and handle naming and renaming cloud variables.

* feat: (try to) add 'random position' dropdown in 'point towards'

* Update varcreate json tests to include cloud variable info.

* sync translations with Transifex

* add ‘random direction’ to translations

* Update scratch-l10n to the latest version

Need to update the version of scratch-l10n because a language (Croation) was added.

* Sync translations with transifex

* Update scratch-l10n

* update to latest scratch-l10n, and use new script to push source files to transifex (removing unneeded local script)
* update to latest translations.

* Fix importing cloud vars from xml.

* fixed lack of category id under ([sensing] of [object]) (scratchfoundation#1798)

* Fix the "Create Variable" button in the playground by providing default

* Use variable IDs and setValue instead of variable names and setText for context menu callbacks

* Update and switch to reviewed translations

* Use variable name as rename prompt's default value

* Update min height on drop down div, to fix reporters having extra space below text.

* Use fill-opacity for notepicker shadow

* Make SHADOW_OPACITY a number, not a string

* Clear dropdown width

* Allow disconnection when deleting a block with no previousConnection

* Fix extra events being emitted from the color slider

* Add class to category menu item based on id

* Move binding callbacks below showing dropdown div so sliders update

They were not updating because the component does not update if it is not visible in the DOM

* Conditionally turn off slider handle callbacks.

* Do not include own variable name in variable reporter context menu.

* Don't include cloud symbol in default value of "rename variable" prompt

Co-Authored-By: towerofnix <9948030+towerofnix@users.noreply.github.com>

* Use CLOUD_PREFIX.length instead of assuming it

* Change the order of the arrow keys

* Lint (fix long line)

Co-Authored-By: towerofnix <9948030+towerofnix@users.noreply.github.com>

* Update translations

Also update l10n to incude isiZulu

* scroll very long context menus

* Duplicated block goes to mouse pointer, not corner of block

* Remove testing comment context menu code

* Grammar

* Fix eslint issue

* Remove extraneous comment lines

* Add restrictor to disallow text being typed in "direction" block input

* Don't bind on mouseup for toolbox when block is being dragged over it

* Use webdriver-selenium for tests

* Remove selenium and unused test scripts

* Comment formatting improvements

* pull new translations from transifex

* "Say something" for block comment

* Pull new translations from transifex

* Add new langauges.

* update translations from transifex

* Minor whitespace change to put else back up a line

* Manually calculate the bounding box of the flyout since se have all the data so the browser does not reflow as a result of getBBox.

Finish up bounding box calculations.

* pull updated translations from Transifex

* Improve connection db performance

* Sort context menu variable list

* Pull updated translations from Transifex

* added persian and central kurdish

* Fix scratchfoundation#1671 by ignoring mouse ups on flyout buttons when there is a drag in process.

This issue was caused by adding pointer-events:none on the drag surface 
element in scratchfoundation/scratch-gui#2584

* Fix typo

* sort filenames in gen_blocks for deterministic build order

* add goog.provide() and goog.require() calls to procedures.js

* Remove undefined modules from procedures.js

* Remove 'To JavaScript' button

Resolves scratchfoundation#1893

* Update translations from transifex

* Update argument reporter names in the define stack after mutation change

* Update translations from Transifex

* Update translations from transifex

Corrections to argument order in Persian (fa)

* Pull updated translations from Transifex.

* Use opt_secondValue in addBlock as expected

* Sort list context menu

* Update scratch-l10n to pick up belarusian

* Update l10n dependency for rap and uz

L10n 3.3.x includes the new langauges Rapa Nui and Uzbek

* Update translations with Rapa Nui and Uzbek

* Handle promise rejection for sound.play() in preload

* Fix style matching in Firefox 67

(Ported from PR google/blockly#2485, which is by @NeilFraser.
 Description from that PR follows:)

Chrome returns ‘transform: translate(107px, 0px);’ whereas Firefox now
returns ‘transform: translate(107px);’ if the y value is 0.  This is
consistent with existing behaviour in the translate SVG attribute.

The comment in our code specifically states:
// Accounts for same exceptions as XY_REGEX_
Yet that was not true at all.

This PR makes the y argument optional (as falsely described in the
comment).  It also merges the 2D and 3D regeps together to simplify the
code.

* May translations update

* Match scratch-gui default zoom in playground for testing ease

* Increase touchable size of checkboxes and extension status buttons.

* Fix broken image for numpad delete button

It turns out we are creating a data-uri SVG for the delete button, but are using string interpolation for the color. If you use hex, this breaks the image on Chrome (but not Safari). Using a standard css color keyword (alternatively using RGB) fix the issue.

* Fixed DOMException when play request gets interrupted by a call to pause.

* Converted arrow function to normal function

* Now checking if promise is undefined, so it doesn't throw on Edge

* Removed empty line

* Fixed indentation

* Fixed indentation

* Fix numpad to work correctly with moving cursors

* Allow quiet inputs to be focused by typing

* Add Khmer and sync translations

* add Georgian

- [ ] update l10n to 3.5.x to get Georgian
- [ ] sync translations

* Move call to focus element outside of the the setTimeout. iOS is picky about what things you can do outside of a direct user action and I think focus might be one of them.  With this change comments are now editable on iOS.

* remove stray newline

* Track touch vs mouse origins of field interactions

* Move workspace comment click target rect to only cover the textarea

* Mark delete/resize events as noCaptureIdentifier to stop workspace freezing

* Stop propagation for textarea clicks to make sure preventDefault is not called by workspace event listeners

* Fix error when deleting comments caused by trying to blur removed node

* Use placeholders instead of a default value for comments

* Force focus after block comments are created

* Fix a layout bug in RTL with workspace comment delete icon, was accidentally giving the correct value, but changing sizes revealed it was doing it wrong

* Fix RTL bug where resize handle was positioned incorrectly

* Resize minimize/delete handle icons so they take up the entire topbar height. This makes them much easier to touch

* Change resize handle to add a larger hitbox to make touch interactions easier

* Remove debug stylings

* Fix text spilling out of minimized workspace comments in RTL

* Use click event to avoid gesture problems freezing workspace

* Now using correct delete count to check if should show dialog

* august translation update

* Added custom data file dropdown
aburroughs97 pushed a commit to papaphil/DataTools-scratch-blocks that referenced this pull request Feb 6, 2020
…ions (#3)

* Add some missing utility functions

* Add play note block to default toolbox for testing

* Fix procedure definition blocks with trailing text (scratchfoundation#1755)

* Automate translation update (scratchfoundation#1752)

* Add transifex node package to support syncing scripts
* Add scripts to push source `en.json` to Transifex and download translations to generate `scratch_msgs.js`
* Adds a test to ensure that changes to `msg/messages.js` have been reflected in the source and generated `scratch_msgs.js`
* gets the list of supported languages from scratch-l10n

* Remove custom touch handling for dropdowns (scratchfoundation#1756)

* Add note field with SVG piano keys

* Draw black and white keys in a single loop

* Key highlighting

* Add note name indicator

* Add playNote function to override

* Add octave buttons

* Labels on low and high C keys

* function to add C key labels

* Only show one octave (13 keys)

* Handle octave display state

and re-arrange and rename some fns for clarity

* Fix C key fill color

* Remove extra bottom padding

* Allow block comments to be editable on mobile by catching the mousedown event and grabbing focus instead of the mouse up.  This makes the experience a bit worse in firefox (you have to click twice to focus the comment now), but fixing this the right way is invovled.  See scratchfoundation#1631 for full context. (scratchfoundation#1757)

* Octave shift animation

* Fix octave change bugs

* Add validator

* sync translations (scratchfoundation#1761)

* Cleanup and JSDOC

* Precisely position the piano keys, so the stroke appears the same on all sides

* Update octave button and fix positioning

* Adjust piano key positioning

* Remove console.log

* Hide and show C key labels

* Animate C key label visibility

* Cleanup

* Use unicode sharp and flat symbols

* Disable pointer events on field angle arrow to fix firefox dragging

* Ensmallen the delete area to not extend above and below the flyout

* Fix comment

* Optimize SVG

* Clarify variable names for fieldEditorWidth_ and fieldEditorHeight_

* Dispose SVG elements

* Octave button handlers directly call octave changers

* Gave the drag handle a bit more spaceing to avoid glow getting cut (scratchfoundation#1767)

* Correctly dispose keySVGs array

* Fix local compile on Windows

We call the local compiler with `subprocess.Popen`, passing
`google-closure-compiler` as the command to run. On Windows, the actual
command is `google-closure-compiler.cmd` -- the extension is
automatically added by the shell. Unfortunately `subprocess.Popen` by
default bypasses the shell, leading to an error. Setting `shell=True`
makes `Popen` use the Windows shell (`cmd`) and correctky find
`google-closure-compiler.cmd`.

* Sync translations with Transifex

update translations

* Revert "Merge pull request scratchfoundation#1772 from cwillisf/windows-fix-local-compile"

This reverts commit 4ffecde, reversing
changes made to b63e5c6.

What I thought were spurious build failures on CI were apparently legit...

* Support scientific notation in numerical inputs

* Make insertion markers for define blocks have the correct width (scratchfoundation#1781)

* Fix scratchfoundation#1186

* Added comment to clarify which case is being handled

* Allow uppercase E in numbers as well

* Track cloud variable info and handle naming and renaming cloud variables.

* feat: (try to) add 'random position' dropdown in 'point towards'

* Update varcreate json tests to include cloud variable info.

* sync translations with Transifex

* add ‘random direction’ to translations

* Update scratch-l10n to the latest version

Need to update the version of scratch-l10n because a language (Croation) was added.

* Sync translations with transifex

* Update scratch-l10n

* update to latest scratch-l10n, and use new script to push source files to transifex (removing unneeded local script)
* update to latest translations.

* Fix importing cloud vars from xml.

* fixed lack of category id under ([sensing] of [object]) (scratchfoundation#1798)

* Fix the "Create Variable" button in the playground by providing default

* Use variable IDs and setValue instead of variable names and setText for context menu callbacks

* Update and switch to reviewed translations

* Use variable name as rename prompt's default value

* Update min height on drop down div, to fix reporters having extra space below text.

* Use fill-opacity for notepicker shadow

* Make SHADOW_OPACITY a number, not a string

* Clear dropdown width

* Allow disconnection when deleting a block with no previousConnection

* Fix extra events being emitted from the color slider

* Add class to category menu item based on id

* Move binding callbacks below showing dropdown div so sliders update

They were not updating because the component does not update if it is not visible in the DOM

* Conditionally turn off slider handle callbacks.

* Do not include own variable name in variable reporter context menu.

* Don't include cloud symbol in default value of "rename variable" prompt

Co-Authored-By: towerofnix <9948030+towerofnix@users.noreply.github.com>

* Use CLOUD_PREFIX.length instead of assuming it

* Change the order of the arrow keys

* Lint (fix long line)

Co-Authored-By: towerofnix <9948030+towerofnix@users.noreply.github.com>

* Update translations

Also update l10n to incude isiZulu

* scroll very long context menus

* Duplicated block goes to mouse pointer, not corner of block

* Remove testing comment context menu code

* Grammar

* Fix eslint issue

* Remove extraneous comment lines

* Add restrictor to disallow text being typed in "direction" block input

* Don't bind on mouseup for toolbox when block is being dragged over it

* Use webdriver-selenium for tests

* Remove selenium and unused test scripts

* Comment formatting improvements

* pull new translations from transifex

* "Say something" for block comment

* Pull new translations from transifex

* Add new langauges.

* update translations from transifex

* Minor whitespace change to put else back up a line

* Manually calculate the bounding box of the flyout since se have all the data so the browser does not reflow as a result of getBBox.

Finish up bounding box calculations.

* pull updated translations from Transifex

* Improve connection db performance

* Sort context menu variable list

* Pull updated translations from Transifex

* added persian and central kurdish

* Fix scratchfoundation#1671 by ignoring mouse ups on flyout buttons when there is a drag in process.

This issue was caused by adding pointer-events:none on the drag surface 
element in scratchfoundation/scratch-gui#2584

* Fix typo

* sort filenames in gen_blocks for deterministic build order

* add goog.provide() and goog.require() calls to procedures.js

* Remove undefined modules from procedures.js

* Remove 'To JavaScript' button

Resolves scratchfoundation#1893

* Update translations from transifex

* Update argument reporter names in the define stack after mutation change

* Update translations from Transifex

* Update translations from transifex

Corrections to argument order in Persian (fa)

* Pull updated translations from Transifex.

* Use opt_secondValue in addBlock as expected

* Sort list context menu

* Update scratch-l10n to pick up belarusian

* Update l10n dependency for rap and uz

L10n 3.3.x includes the new langauges Rapa Nui and Uzbek

* Update translations with Rapa Nui and Uzbek

* Handle promise rejection for sound.play() in preload

* Fix style matching in Firefox 67

(Ported from PR google/blockly#2485, which is by @NeilFraser.
 Description from that PR follows:)

Chrome returns ‘transform: translate(107px, 0px);’ whereas Firefox now
returns ‘transform: translate(107px);’ if the y value is 0.  This is
consistent with existing behaviour in the translate SVG attribute.

The comment in our code specifically states:
// Accounts for same exceptions as XY_REGEX_
Yet that was not true at all.

This PR makes the y argument optional (as falsely described in the
comment).  It also merges the 2D and 3D regeps together to simplify the
code.

* May translations update

* Match scratch-gui default zoom in playground for testing ease

* Increase touchable size of checkboxes and extension status buttons.

* Fix broken image for numpad delete button

It turns out we are creating a data-uri SVG for the delete button, but are using string interpolation for the color. If you use hex, this breaks the image on Chrome (but not Safari). Using a standard css color keyword (alternatively using RGB) fix the issue.

* Fixed DOMException when play request gets interrupted by a call to pause.

* Converted arrow function to normal function

* Now checking if promise is undefined, so it doesn't throw on Edge

* Removed empty line

* Fixed indentation

* Fixed indentation

* Fix numpad to work correctly with moving cursors

* Allow quiet inputs to be focused by typing

* Add Khmer and sync translations

* add Georgian

- [ ] update l10n to 3.5.x to get Georgian
- [ ] sync translations

* Move call to focus element outside of the the setTimeout. iOS is picky about what things you can do outside of a direct user action and I think focus might be one of them.  With this change comments are now editable on iOS.

* remove stray newline

* Track touch vs mouse origins of field interactions

* Move workspace comment click target rect to only cover the textarea

* Mark delete/resize events as noCaptureIdentifier to stop workspace freezing

* Stop propagation for textarea clicks to make sure preventDefault is not called by workspace event listeners

* Fix error when deleting comments caused by trying to blur removed node

* Use placeholders instead of a default value for comments

* Force focus after block comments are created

* Fix a layout bug in RTL with workspace comment delete icon, was accidentally giving the correct value, but changing sizes revealed it was doing it wrong

* Fix RTL bug where resize handle was positioned incorrectly

* Resize minimize/delete handle icons so they take up the entire topbar height. This makes them much easier to touch

* Change resize handle to add a larger hitbox to make touch interactions easier

* Remove debug stylings

* Fix text spilling out of minimized workspace comments in RTL

* Use click event to avoid gesture problems freezing workspace

* Now using correct delete count to check if should show dialog

* august translation update

* Monthly translation update

* Include swahili messages

Require `3.6.x` of `scratch-l10n` to include swahili in the supported languages. Update the messages strings as well.

* update strings for swahili

* Translation update for Oct

* November translations update

(earlier in the month due to Thanksgiving holiday. There won’t be an update next week).

* Fix offset of comments in stacks

* Update l10n and pull in Haitian Creole

Also brought transifex dependency up to date with l10n

* update translations from transifex

* Scripts for automating translation in travis.

i18n/sync_translations.sh: doesn’t do anything if it isn’t a cron job. Otherwise, it updates and tests messages, then commits and pushes to develop branch if there are no errors.

.travis.yml: adds syncing translations before the build script. Trying to keep the .travis config changes minimal.

* Don’t kick off a new build after updating translations

* [skip ci] Update translations from transifex

* Only run sync_translations on node 8 build

Travis runs two builds in parallel. Only run the translation sync and commit on one of them.

* working

* it should work now

Co-authored-by: chrisgarrity <chrisg@scratch.mit.edu>
Co-authored-by: Andrew Sliwinski <andrewsliwinski@acm.org>
Co-authored-by: Rachel Fenichel <fenichel@google.com>
Co-authored-by: Eric Rosenbaum <eric.rosenbaum@gmail.com>
Co-authored-by: picklesrus <picklesrus@users.noreply.github.com>
Co-authored-by: Paul Kaplan <pkaplan@media.mit.edu>
Co-authored-by: Erik Mejer Hansen <erik.mejer.hansen@gmail.com>
Co-authored-by: Chris Willis-Ford <cwillisf@users.noreply.github.com>
Co-authored-by: Florrie <9948030+towerofnix@users.noreply.github.com>
Co-authored-by: Karishma Chadha <kchadha@scratch.mit.edu>
Co-authored-by: jokebookservice1 <jokebookyeye@gmail.com>
Co-authored-by: Bill Shoener <nitrocipher@gmail.com>
Co-authored-by: Ashwin Ramaswami <aramaswamis@gmail.com>
Co-authored-by: Marcus Weiner <marcus.weiner@gmail.com>
Co-authored-by: apple502j <33279053+apple502j@users.noreply.github.com>
Co-authored-by: Benjamin Wheeler <wheeler.benjamin@gmail.com>
Co-authored-by: julescubtree <julescubtree@users.noreply.github.com>
Co-authored-by: Ken <kenny2minecraft@gmail.com>
Co-authored-by: Yağmur Oymak <yagmur.oymak@gmail.com>
Co-authored-by: Michael Franz <mfr@trifork.com>
Co-authored-by: Ray Schamp <rschamp@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants