Ah ok. I was reading the diff incorrectly. Sorry for the confusion. -Alex
On 4/29/18, 11:57 PM, "Piotr Zarzycki" <piotrzarzyck...@gmail.com> wrote: Alex, I'm not sure what do you mean. I have added here that line: count = classList.length - startIndex; Without it I'm having infinite loop when I use ClassSelectorList in MDL NavigationLayout. Piotr 2018-04-30 2:06 GMT+02:00 Alex Harui <aha...@adobe.com.invalid>: > Hi Piotr, > > Are you sure it is right to remove names that were there before? > > -Alex > > On 4/29/18, 10:48 AM, "pio...@apache.org" <pio...@apache.org> wrote: > > This is an automated email from the ASF dual-hosted git repository. > > piotrz pushed a commit to branch develop > in repository https://na01.safelinks.protection.outlook.com/?url= > https%3A%2F%2Fgitbox.apache.org%2Frepos%2Fasf%2Froyale- > asjs.git&data=02%7C01%7Caharui%40adobe.com%7C0fc0bb013c6b498d00cd08d5adf9 > 6581%7Cfa7b1b5a7b34438794aed2c178decee1%7C0%7C0% > 7C636606209043570512&sdata=1%2FgKb08tPhVJAbGu7lsE1vpep6pjlN > wME6i5zHxf65M%3D&reserved=0 > > > The following commit(s) were added to refs/heads/develop by this push: > new 4340b40 ClassSelectorList: Fix issue with infinite loop in > addNames function > 4340b40 is described below > > commit 4340b40997cf2f445f0a228559146ba88f073c24 > Author: Piotr Zarzycki <piotrzarzyck...@gmail.com> > AuthorDate: Sun Apr 29 19:48:09 2018 +0200 > > ClassSelectorList: Fix issue with infinite loop in addNames > function > --- > .../org/apache/royale/utils/ClassSelectorList.as | 38 > ++++++++++++++-------- > 1 file changed, 24 insertions(+), 14 deletions(-) > > diff --git a/frameworks/projects/Core/src/main/royale/org/apache/ > royale/utils/ClassSelectorList.as b/frameworks/projects/Core/ > src/main/royale/org/apache/royale/utils/ClassSelectorList.as > index 6c35dc3..79c1b34 100644 > --- a/frameworks/projects/Core/src/main/royale/org/apache/ > royale/utils/ClassSelectorList.as > +++ b/frameworks/projects/Core/src/main/royale/org/apache/ > royale/utils/ClassSelectorList.as > @@ -59,6 +59,9 @@ package org.apache.royale.utils > /** > * Add a class selector to the list. > * @param name Name of selector to remove. > + * > + * @royaleignorecoercion HTMLElement > + * @royaleignorecoercion DOMTokenList > */ > public function remove(name:String):void > { > @@ -95,27 +98,34 @@ package org.apache.royale.utils > * Add a space-separated list of names. > * @param names Space-separated list of names to add. > * @royaleignorecoercion HTMLElement > + * @royaleignorecoercion DOMTokenList > */ > public function addNames(names:String):void > { > COMPILE::JS > { > - var positioner:HTMLElement = component.positioner as > HTMLElement; > - var classList:DOMTokenList = positioner.classList; > - if (component.parent) > - { > - // remove names that were set last time > - while (count > 0) > + var positioner:HTMLElement = component.positioner as > HTMLElement; > + var classList:DOMTokenList = positioner.classList; > + if (component.parent) > { > - var name:String = classList.item(startIndex); > - classList.remove(name); > + // remove names that were set last time > + while (count > 0) > + { > + var name:String = classList.item(startIndex); > + classList.remove(name); > + count = classList.length - startIndex; > + } > } > - } > - if (startIndex > 0) > - positioner.className += " " + names; > - else > - positioner.className = names; > - count = classList.length - startIndex; > + > + if (startIndex > 0) > + { > + positioner.className += " " + names; > + } > + else > + { > + positioner.className = names; > + } > + count = classList.length - startIndex; > } > } > } > > -- > To stop receiving notification emails like this one, please contact > pio...@apache.org. > > > -- Piotr Zarzycki Patreon: *https://na01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fwww.patreon.com%2Fpiotrzarzycki&data=02%7C01%7Caharui%40adobe.com%7Cf0e310dda2fc4e2f577908d5ae67a8ef%7Cfa7b1b5a7b34438794aed2c178decee1%7C0%7C0%7C636606682675509292&sdata=tstX9x6iLTwBNlFyRXv6a%2BDVDQ3yJY63oNF%2BUI%2FYLHE%3D&reserved=0 <https://na01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fwww.patreon.com%2Fpiotrzarzycki&data=02%7C01%7Caharui%40adobe.com%7Cf0e310dda2fc4e2f577908d5ae67a8ef%7Cfa7b1b5a7b34438794aed2c178decee1%7C0%7C0%7C636606682675509292&sdata=tstX9x6iLTwBNlFyRXv6a%2BDVDQ3yJY63oNF%2BUI%2FYLHE%3D&reserved=0>*