FLUID-6422: The textNodeParser's hasTextToRead mistakenly thinks containers with floated elements are hidden

Metadata

Source
FLUID-6422
Type
Bug
Priority
Major
Status
Closed
Resolution
Fixed
Assignee
N/A
Reporter
Justin Obara
Created
2019-11-01T10:55:01.842-0400
Updated
2019-11-06T10:44:23.892-0500
Versions
N/A
Fixed Versions
N/A
Component
  1. Framework

Description

The fluid.textNodeParser.hasTextToRead function attempts to see if text is hidden by checking the elements offsetHeight. However, if the element only contains floated elements, it will have an offsetHeight of 0, even if those child elements are visible.

A more robust check for visibility needs to be done to determine if the text is actually visible.

Comments

  • Cindy Li commented 2019-11-05T14:16:25.790-0500

    @@Justin Obara, could you describe how to reproduce the problem? Thanks.

  • Justin Obara commented 2019-11-05T15:56:25.855-0500

    @@Cindy Li if using the UIO+ chrome extension, you an go to the morphic.world site and enable the syllabification preference. With the bug, the content in the middle of the page is not syllabified, while the text at the top and bottom is.

    If you want to try in infusion, you could modify the prefs framework demo have a container that only held floating elements.

    The PR includes test cases for the issue, so you could also grab those and try them with master.

  • Cindy Li commented 2019-11-06T10:44:19.359-0500

    The pull request has been merged into the project repo master branch at this commit.