Ticket #3441 enhancement closed wontfix

Opened 6 years ago

Last modified 4 years ago

Include "meta viewport" in DirectoryListing output to better support iPhone

Reported by: russryba Owned by:
Priority: normal Milestone:
Component: web Keywords: iPhone, iPod touch, webkit, viewport
Cc: thijs Branch:
Author: Launchpad Bug:

Description

Problem:
When using simple mktap web to browse directories, the pages do not format well on iPhone or iPod touch.

Root Cause:
The cause of this problem is that iPhones expect a meta tag to be set to define the viewport dimensions of the device. This is part of the CSS specification that defines the size of the view window separate from the size of the page itself.

Solution:
Adding a meta tag that defines the viewport appears to fix this problem. Tested locally with iPod Touch firmware 2.1.

Adding this line...

<meta name="viewport" content="initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, width=device-width">

...to twisted\web\woven\dirlist.py fixes this problem. This was at line 26 in my version, result source code is below.

class DirectoryLister(page.Page):
    template = '''
    <html>
    <head>
    <title model="header"> </title>
    <meta name="viewport" content="initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, width=device-width" />
    <style>

Searching for '<head>' I see several other places where adding this meta tag would be helpful. I know my source code is out of date so I will leave it to the developers to figure out where this should go in the latest code.

Change History

1

Changed 6 years ago by exarkun

  • summary changed from Change default html headers to better support iPhone to Include "meta viewport" in DirectoryListing output to better support iPhone

2

Changed 4 years ago by thijs

  • status changed from new to closed
  • cc thijs added
  • resolution set to wontfix

Woven is no longer part of Twisted so closing this ticket.

3

Changed 3 years ago by <automation>

  • owner jknight deleted
Note: See TracTickets for help on using tickets.