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

About the behavior of iOS 10.3 and higher. #390

Open
kirou opened this issue May 25, 2017 · 1 comment
Open

About the behavior of iOS 10.3 and higher. #390

kirou opened this issue May 25, 2017 · 1 comment

Comments

@kirou
Copy link

kirou commented May 25, 2017

There is a problem with iOS 10.3 or later terminal.

https://github.com/readium/readium-shared-js/blob/master/js/views/reflowable_view.js#L315
When this process is confirmed at iOS 10.2 or less, it becomes vertical-rl, and if it checks at iOS 10.3 and above it becomes horizontal-tb and the result will be different.

https://github.com/readium/readium-shared-js/blob/master/js/views/reflowable_view.js#L307
The result was different between getComputedStyle itself, iOS 10.2 and iOS 10.3.
Therefore, I think that the result differs also with getPropertyValue.

Have you heard the story that the same phenomenon occurred?

@danielweck
Copy link
Member

For reference:

 var htmlBodyComputedStyle = win.getComputedStyle(_$htmlBody[0], null);
        if (htmlBodyComputedStyle)
        {
            _htmlBodyIsLTRDirection = htmlBodyComputedStyle.direction === "ltr";

            var writingMode = undefined;
            if (htmlBodyComputedStyle.getPropertyValue)
            {
                writingMode = htmlBodyComputedStyle.getPropertyValue("-webkit-writing-mode") || htmlBodyComputedStyle.getPropertyValue("-moz-writing-mode") || htmlBodyComputedStyle.getPropertyValue("-ms-writing-mode") || htmlBodyComputedStyle.getPropertyValue("-o-writing-mode") || htmlBodyComputedStyle.getPropertyValue("-epub-writing-mode") || htmlBodyComputedStyle.getPropertyValue("writing-mode");
            }
            else
            {
                writingMode = htmlBodyComputedStyle.webkitWritingMode || htmlBodyComputedStyle.mozWritingMode || htmlBodyComputedStyle.msWritingMode || htmlBodyComputedStyle.oWritingMode || htmlBodyComputedStyle.epubWritingMode || htmlBodyComputedStyle.writingMode;
            }

            if (writingMode)
            {
                _htmlBodyIsLTRWritingMode = writingMode.indexOf("-lr") >= 0; // || writingMode.indexOf("horizontal-") >= 0; we need explicit!

                if (writingMode.indexOf("vertical") >= 0 || writingMode.indexOf("tb-") >= 0 || writingMode.indexOf("bt-") >= 0)
                {
                    _htmlBodyIsVerticalWritingMode = true;
                }
            }
        }

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants