Ticket #2254 (closed Bug: fixed)
Malfunction in FCKSelection object
| Reported by: | jenka1980 | Owned by: | martinkou |
|---|---|---|---|
| Priority: | Normal | Milestone: | FCKeditor 2.6.2 |
| Component: | General | Version: | FCKeditor 2.5 |
| Keywords: | Confirmed Review+ | Cc: |
Description
FCKSelection have 2 methods called: HasAncestorNode and MoveToAncestorNode. Both of theme have input parameter called nodeTagName of type string and as written in comments of this function the passed string should be written in upper case.
But in the code when check is done actual tag name never converted to upper case.
if ( oContainer.tagName == nodeTagName ) return true ;
So if your edited HTML has tags written in lower case (like custom tags) this functions won't find the ancestor tag.
Hope you'll fix this small thing in next revision.
tank's
Attachments
Change History
comment:1 Changed 5 years ago by w.olchawa
- Keywords Confirmed added; FCKSelecte upper case tagName HasAncestorNode MoveToAncestorNode removed
comment:4 Changed 5 years ago by martinkou
- Status changed from new to assigned
- Keywords Review- added; Review? removed
- Owner changed from w.olchawa to martinkou
Hmm... the patch has a number of problems:
- toLocalUpperCase() is not defined, which gives out JavaScript errors.
- Even converting the toLocalUpperCase() to toUpperCase(), the patch is still wrong because it still can't check against DOM nodes with lowercase tag names.
We actually have a shorthand string function defined in FCKeditor's code for this kind of case insensitive string matching - String::IEquals(). You can find it in $FCKeditor/editor/_source/fckjscoreextensions.js, it's a very useful function. :)
comment:6 Changed 5 years ago by alfonsoml
- Keywords Review+ added; Review? removed
- Summary changed from Malfunction in FCK.Selecte object to Malfunction in FCKSelection object
BTW, I think that sometimes Safari does return node names with a different case than the rest of the browsers. Am I right?
Do you think that this can fix any other problem?
comment:7 Changed 5 years ago by martinkou
Hmm... no? Safari gives out upper case nodeNames for HTML nodes, just the same as any other browser at the moment.
comment:8 Changed 5 years ago by martinkou
- Status changed from assigned to closed
- Resolution set to fixed
Fixed with [2046].
Click here for more info about our SVN system.
comment:9 Changed 5 years ago by fredck
- Keywords Review- added; Review+ removed
- Status changed from closed to reopened
- Resolution fixed deleted
comment:10 Changed 5 years ago by martinkou
- Keywords Review? added; Review- removed
Ok, tagName is not always defined for all DOM nodes, particularly for the #document node.
Changing to checking for nodeName instead.
comment:12 Changed 5 years ago by martinkou
- Status changed from reopened to closed
- Resolution set to fixed
Fixed with [2072].
Click here for more info about our SVN system.
