Merge lp:~iheino+ub/ubuntu/maverick/w3m/bug683337 into lp:ubuntu/maverick/w3m

Proposed by Tuomas Heino
Status: Merged
Merged at revision: 16
Proposed branch: lp:~iheino+ub/ubuntu/maverick/w3m/bug683337
Merge into: lp:ubuntu/maverick/w3m
Diff against target: 398 lines (+366/-1)
4 files modified
debian/changelog (+9/-0)
debian/control (+2/-1)
debian/patches/091_button.patch (+354/-0)
debian/patches/series (+1/-0)
To merge this branch: bzr merge lp:~iheino+ub/ubuntu/maverick/w3m/bug683337
Reviewer Review Type Date Requested Status
Colin Watson Approve
Artur Rona (community) Disapprove
Review via email: mp+46417@code.launchpad.net

Description of the change

Fix lp#683337 by backporting 020_button.patch from natty.

TEST CASE:
Log in to launchpad with w3m. Without the fix continue-button will not work.

To post a comment you must log in.
Revision history for this message
Artur Rona (ari-tczew) wrote :

1) Please improve entry in debian/changelog to:

  * debian/091_button.patch:
    - Support the button element as defined in HTML 4.01.
      Backport of 020_button.patch from natty.
      (LP: #683337, Closes: #136810)

1.1) Change target to maverick-proposed in debian/changelog

2) Rename 020_button.patch to 091_button.patch

3) Add following DEP3 tags to patch:
From: Tuomas Heino <email address hidden>
Bug-Ubuntu: https://launchpad.net/bugs/683337

Revision history for this message
Artur Rona (ari-tczew) wrote :

> (...)
Of course it was 'Needs-fixing'.

review: Needs Fixing
17. By Tuomas Heino

  * debian/patches/091_button.patch:
    - Support the button element as defined in HTML 4.01.
      Backport of 020_button.patch from natty.
      (LP: #683337, Closes: #136810)

Revision history for this message
Artur Rona (ari-tczew) wrote :
review: Needs Fixing
Revision history for this message
Artur Rona (ari-tczew) wrote :

Also please run script 'update-maintainer' from package ubuntu-dev-tools.
https://wiki.ubuntu.com/DebianMaintainerField

review: Needs Fixing
18. By Tuomas Heino

update-maintainer applied

Revision history for this message
Artur Rona (ari-tczew) wrote :

I have debated with Martin Pitt about your patch and unfortunately, it can't be approved. It's small new feature, no bug-fix. This is way through backports.
https://help.ubuntu.com/community/UbuntuBackports

Shortly:
1) Upload package from natty to your PPA without any changes for source;
2) Test package from natty on your maverick;
3) Open bug against maverick-backports and give feedback from testing.

If you have more questions, feel free to get in touch with us on #ubuntu-motu.

review: Disapprove
Revision history for this message
Colin Watson (cjwatson) wrote :

We discussed this in the Technical Board meeting of 2011-03-10 (logs: http://irclogs.ubuntu.com/2011/03/10/%23ubuntu-meeting.html), and agreed that this falls under the general precedent set by https://lists.ubuntu.com/archives/ubuntu-devel-announce/2009-March/000550.html: although this introduces a new feature, it's impelled by an external event (a change in how Launchpad handles authentication). As such, there is no need for this to go through -backports.

Your patch looks fine to me; I'll give it some testing, and merge and upload it if it works for me.

Revision history for this message
Colin Watson (cjwatson) wrote :

I've merged into a private branch and uploaded. Once it's been accepted into maverick-proposed, I'll be able to push to lp:ubuntu/maverick-proposed/w3m.

Thanks!

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'debian/changelog'
2--- debian/changelog 2010-07-07 00:10:09 +0000
3+++ debian/changelog 2011-01-18 10:55:22 +0000
4@@ -1,3 +1,12 @@
5+w3m (0.5.2-6ubuntu1) maverick-proposed; urgency=low
6+
7+ * debian/patches/091_button.patch:
8+ - Support the button element as defined in HTML 4.01.
9+ Backport of 020_button.patch from natty.
10+ (LP: #683337, Closes: #136810)
11+
12+ -- Tuomas Heino <iheino+ub@cc.hut.fi> Mon, 17 Jan 2011 09:57:32 +0200
13+
14 w3m (0.5.2-6) unstable; urgency=low
15
16 * debian/patches/070_form-update.patch: Patch to fix a problem of
17
18=== modified file 'debian/control'
19--- debian/control 2010-07-07 00:10:09 +0000
20+++ debian/control 2011-01-18 10:55:22 +0000
21@@ -1,7 +1,8 @@
22 Source: w3m
23 Section: web
24 Priority: standard
25-Maintainer: Tatsuya Kinoshita <tats@debian.org>
26+Maintainer: Ubuntu Developers <ubuntu-devel-discuss@lists.ubuntu.com>
27+XSBC-Original-Maintainer: Tatsuya Kinoshita <tats@debian.org>
28 Build-Depends: libgc-dev, libncurses5-dev, libgpmg1-dev [!kfreebsd-i386 !kfreebsd-amd64 !hurd-i386], zlib1g-dev, libssl-dev, debhelper (>= 7), gawk | awk, libimlib2-dev
29 Homepage: http://sourceforge.net/projects/w3m
30 Standards-Version: 3.9.0
31
32=== added file 'debian/patches/091_button.patch'
33--- debian/patches/091_button.patch 1970-01-01 00:00:00 +0000
34+++ debian/patches/091_button.patch 2011-01-18 10:55:22 +0000
35@@ -0,0 +1,354 @@
36+From: Tuomas Heino <iheino+ub@cc.hut.fi>
37+Bug-Ubuntu: https://launchpad.net/bugs/683337
38+Description: Support the button element as defined in HTML 4.01
39+Origin: upstream, http://www.sic.med.tohoku.ac.jp/~satodai/w3m-dev/201009.month/4411.html
40+Bug-Debian: http://bugs.debian.org/136810
41+
42+diff -ur w3m.orig/file.c w3m/file.c
43+--- w3m.orig/file.c 2010-12-01 00:35:27.775973000 +0200
44++++ w3m/file.c 2010-12-01 00:13:20.352955706 +0200
45+@@ -2449,6 +2449,7 @@
46+ bcopy((void *)&obuf->anchor, (void *)&obuf->bp.anchor,
47+ sizeof(obuf->anchor));
48+ obuf->bp.img_alt = obuf->img_alt;
49++ obuf->bp.input_alt = obuf->input_alt;
50+ obuf->bp.in_bold = obuf->in_bold;
51+ obuf->bp.in_italic = obuf->in_italic;
52+ obuf->bp.in_under = obuf->in_under;
53+@@ -2466,6 +2467,7 @@
54+ bcopy((void *)&obuf->bp.anchor, (void *)&obuf->anchor,
55+ sizeof(obuf->anchor));
56+ obuf->img_alt = obuf->bp.img_alt;
57++ obuf->input_alt = obuf->bp.input_alt;
58+ obuf->in_bold = obuf->bp.in_bold;
59+ obuf->in_italic = obuf->bp.in_italic;
60+ obuf->in_under = obuf->bp.in_under;
61+@@ -2709,7 +2711,7 @@
62+ Str line = obuf->line, pass = NULL;
63+ char *hidden_anchor = NULL, *hidden_img = NULL, *hidden_bold = NULL,
64+ *hidden_under = NULL, *hidden_italic = NULL, *hidden_strike = NULL,
65+- *hidden_ins = NULL, *hidden = NULL;
66++ *hidden_ins = NULL, *hidden_input, *hidden = NULL;
67+
68+ #ifdef DEBUG
69+ if (w3m_debug) {
70+@@ -2741,6 +2743,12 @@
71+ hidden = hidden_img;
72+ }
73+ }
74++ if (obuf->input_alt.in) {
75++ if ((hidden_input = has_hidden_link(obuf, HTML_INPUT_ALT)) != NULL) {
76++ if (!hidden || hidden_input < hidden)
77++ hidden = hidden_input;
78++ }
79++ }
80+ if (obuf->in_bold) {
81+ if ((hidden_bold = has_hidden_link(obuf, HTML_B)) != NULL) {
82+ if (!hidden || hidden_bold < hidden)
83+@@ -2792,6 +2800,8 @@
84+ Strcat_charp(line, "</a>");
85+ if (obuf->img_alt && !hidden_img)
86+ Strcat_charp(line, "</img_alt>");
87++ if (obuf->input_alt.in && !hidden_input)
88++ Strcat_charp(line, "</input_alt>");
89+ if (obuf->in_bold && !hidden_bold)
90+ Strcat_charp(line, "</b>");
91+ if (obuf->in_italic && !hidden_italic)
92+@@ -3002,6 +3012,18 @@
93+ Strcat_charp(tmp, "\">");
94+ push_tag(obuf, tmp->ptr, HTML_IMG_ALT);
95+ }
96++ if (!hidden_input && obuf->input_alt.in) {
97++ Str tmp;
98++ if (obuf->input_alt.hseq > 0)
99++ obuf->input_alt.hseq = - obuf->input_alt.hseq;
100++ tmp = Sprintf("<INPUT_ALT hseq=\"%d\" fid=\"%d\" name=\"%s\" type=\"%s\" value=\"%s\">",
101++ obuf->input_alt.hseq,
102++ obuf->input_alt.fid,
103++ obuf->input_alt.name->ptr,
104++ obuf->input_alt.type->ptr,
105++ obuf->input_alt.value->ptr);
106++ push_tag(obuf, tmp->ptr, HTML_INPUT_ALT);
107++ }
108+ if (!hidden_bold && obuf->in_bold)
109+ push_tag(obuf, "<B>", HTML_B);
110+ if (!hidden_italic && obuf->in_italic)
111+@@ -3704,6 +3726,63 @@
112+ }
113+
114+ Str
115++process_button(struct parsed_tag *tag)
116++{
117++ Str tmp = NULL;
118++ char *p, *q, *r, *qq = NULL;
119++ int qlen, v;
120++
121++ if (cur_form_id < 0) {
122++ char *s = "<form_int method=internal action=none>";
123++ tmp = process_form(parse_tag(&s, TRUE));
124++ }
125++ if (tmp == NULL)
126++ tmp = Strnew();
127++
128++ p = "submit";
129++ parsedtag_get_value(tag, ATTR_TYPE, &p);
130++ q = NULL;
131++ parsedtag_get_value(tag, ATTR_VALUE, &q);
132++ r = "";
133++ parsedtag_get_value(tag, ATTR_NAME, &r);
134++
135++ v = formtype(p);
136++ if (v == FORM_UNKNOWN)
137++ return NULL;
138++
139++ if (!q) {
140++ switch (v) {
141++ case FORM_INPUT_SUBMIT:
142++ case FORM_INPUT_BUTTON:
143++ q = "SUBMIT";
144++ break;
145++ case FORM_INPUT_RESET:
146++ q = "RESET";
147++ break;
148++ }
149++ }
150++ if (q) {
151++ qq = html_quote(q);
152++ qlen = strlen(q);
153++ }
154++
155++ // Strcat_charp(tmp, "<pre_int>");
156++ Strcat(tmp, Sprintf("<input_alt hseq=\"%d\" fid=\"%d\" type=%s "
157++ "name=\"%s\" value=\"%s\">",
158++ cur_hseq++, cur_form_id, p, html_quote(r), qq));
159++ return tmp;
160++}
161++
162++Str
163++process_n_button(void)
164++{
165++ Str tmp = Strnew();
166++ Strcat_charp(tmp, "</input_alt>");
167++ // Strcat_charp(tmp, "</pre_int>");
168++ return tmp;
169++}
170++
171++Str
172+ process_select(struct parsed_tag *tag)
173+ {
174+ Str tmp = NULL;
175+@@ -4815,7 +4894,35 @@
176+ if (i > obuf->bottom_margin)
177+ obuf->bottom_margin = i;
178+ }
179++ if (parsedtag_get_value(tag, ATTR_HSEQ, &hseq)) {
180++ obuf->input_alt.hseq = hseq;
181++ }
182++ if (parsedtag_get_value(tag, ATTR_FID, &i)) {
183++ obuf->input_alt.fid = i;
184++ }
185++ if (parsedtag_get_value(tag, ATTR_TYPE, &p)) {
186++ obuf->input_alt.type = Strnew_charp(p);
187++ }
188++ if (parsedtag_get_value(tag, ATTR_VALUE, &p)) {
189++ obuf->input_alt.value = Strnew_charp(p);
190++ }
191++ if (parsedtag_get_value(tag, ATTR_NAME, &p)) {
192++ obuf->input_alt.name = Strnew_charp(p);
193++ }
194++ obuf->input_alt.in = 1;
195+ return 0;
196++ case HTML_N_INPUT_ALT:
197++ if (obuf->input_alt.in) {
198++ if (!close_effect0(obuf, HTML_INPUT_ALT))
199++ push_tag(obuf, "</input_alt>", HTML_N_INPUT_ALT);
200++ obuf->input_alt.hseq = 0;
201++ obuf->input_alt.fid = -1;
202++ obuf->input_alt.in = 0;
203++ obuf->input_alt.type = NULL;
204++ obuf->input_alt.name = NULL;
205++ obuf->input_alt.value = NULL;
206++ }
207++ return 1;
208+ case HTML_TABLE:
209+ close_anchor(h_env, obuf);
210+ obuf->table_level++;
211+@@ -4924,6 +5031,16 @@
212+ case HTML_INPUT:
213+ close_anchor(h_env, obuf);
214+ tmp = process_input(tag);
215++ if (tmp)
216++ HTMLlineproc1(tmp->ptr, h_env);
217++ return 1;
218++ case HTML_BUTTON:
219++ tmp = process_button(tag);
220++ if (tmp)
221++ HTMLlineproc1(tmp->ptr, h_env);
222++ return 1;
223++ case HTML_N_BUTTON:
224++ tmp = process_n_button();
225+ if (tmp)
226+ HTMLlineproc1(tmp->ptr, h_env);
227+ return 1;
228+@@ -5635,6 +5752,21 @@
229+ putHmarker(buf->hmarklist, currentLn(buf),
230+ hpos, hseq - 1);
231+ }
232++ else if (hseq < 0) {
233++ int h = -hseq - 1;
234++ int hpos = pos;
235++ if (*str == '[')
236++ hpos++;
237++ if (buf->hmarklist &&
238++ h < buf->hmarklist->nmark &&
239++ buf->hmarklist->marks[h].invalid) {
240++ buf->hmarklist->marks[h].pos = hpos;
241++ buf->hmarklist->marks[h].line = currentLn(buf);
242++ buf->hmarklist->marks[h].invalid = 0;
243++ hseq = -hseq;
244++ }
245++ }
246++
247+ if (!form->target)
248+ form->target = buf->baseTarget;
249+ if (a_textarea &&
250+@@ -6702,6 +6834,12 @@
251+ obuf->nobr_level = 0;
252+ bzero((void *)&obuf->anchor, sizeof(obuf->anchor));
253+ obuf->img_alt = 0;
254++ obuf->input_alt.hseq = 0;
255++ obuf->input_alt.fid = -1;
256++ obuf->input_alt.in = 0;
257++ obuf->input_alt.type = NULL;
258++ obuf->input_alt.name = NULL;
259++ obuf->input_alt.value = NULL;
260+ obuf->in_bold = 0;
261+ obuf->in_italic = 0;
262+ obuf->in_under = 0;
263+@@ -6737,6 +6875,15 @@
264+ push_tag(obuf, "</img_alt>", HTML_N_IMG_ALT);
265+ obuf->img_alt = NULL;
266+ }
267++ if (obuf->input_alt.in) {
268++ push_tag(obuf, "</input_alt>", HTML_N_INPUT_ALT);
269++ obuf->input_alt.hseq = 0;
270++ obuf->input_alt.fid = -1;
271++ obuf->input_alt.in = 0;
272++ obuf->input_alt.type = NULL;
273++ obuf->input_alt.name = NULL;
274++ obuf->input_alt.value = NULL;
275++ }
276+ if (obuf->in_bold) {
277+ push_tag(obuf, "</b>", HTML_N_B);
278+ obuf->in_bold = 0;
279+diff -ur w3m.orig/fm.h w3m/fm.h
280+--- w3m.orig/fm.h 2010-12-01 00:35:38.552891989 +0200
281++++ w3m/fm.h 2010-12-01 00:13:20.352955706 +0200
282+@@ -558,6 +558,13 @@
283+ #define INIT_BUFFER_WIDTH ((_INIT_BUFFER_WIDTH > 0) ? _INIT_BUFFER_WIDTH : 0)
284+ #define FOLD_BUFFER_WIDTH (FoldLine ? (INIT_BUFFER_WIDTH + 1) : -1)
285+
286++struct input_alt_attr {
287++ int hseq;
288++ int fid;
289++ int in;
290++ Str type, name, value;
291++};
292++
293+ typedef struct {
294+ int pos;
295+ int len;
296+@@ -565,6 +572,7 @@
297+ long flag;
298+ Anchor anchor;
299+ Str img_alt;
300++ struct input_alt_attr input_alt;
301+ char fontstat[FONTSTAT_SIZE];
302+ short nobr_level;
303+ Lineprop prev_ctype;
304+@@ -587,6 +595,7 @@
305+ short nobr_level;
306+ Anchor anchor;
307+ Str img_alt;
308++ struct input_alt_attr input_alt;
309+ char fontstat[FONTSTAT_SIZE];
310+ char fontstat_stack[FONT_STACK_SIZE][FONTSTAT_SIZE];
311+ int fontstat_sp;
312+diff -ur w3m.orig/html.c w3m/html.c
313+--- w3m.orig/html.c 2010-12-01 00:35:27.775973000 +0200
314++++ w3m/html.c 2010-12-01 00:25:24.402955871 +0200
315+@@ -56,6 +56,9 @@
316+ ATTR_CORE
317+ };
318+ #define MAXA_INPUT MAXA_CORE + 12
319++unsigned char ALST_BUTTON[] =
320++ { ATTR_TYPE, ATTR_VALUE, ATTR_NAME, ATTR_CORE };
321++#define MAXA_BUTTON MAXA_CORE + 3
322+ unsigned char ALST_TEXTAREA[] =
323+ { ATTR_COLS, ATTR_ROWS, ATTR_NAME, ATTR_READONLY, ATTR_CORE };
324+ #define MAXA_TEXTAREA MAXA_CORE + 4
325+@@ -235,8 +238,8 @@
326+ {"/i", NULL, 0, TFLG_END}, /* 110 HTML_N_I */
327+ {"strong", NULL, 0, 0}, /* 111 HTML_STRONG */
328+ {"/strong", NULL, 0, TFLG_END}, /* 112 HTML_N_STRONG */
329+- {NULL, NULL, 0, 0}, /* 113 Undefined */
330+- {NULL, NULL, 0, 0}, /* 114 Undefined */
331++ {"button", ALST_BUTTON, MAXA_BUTTON, 0}, /* 113 HTML_BUTTON */
332++ {"/button", NULL, 0, TFLG_END}, /* 114 HTML_N_BUTTON */
333+ {NULL, NULL, 0, 0}, /* 115 Undefined */
334+ {NULL, NULL, 0, 0}, /* 116 Undefined */
335+ {NULL, NULL, 0, 0}, /* 117 Undefined */
336+diff -ur w3m.orig/html.h w3m/html.h
337+--- w3m.orig/html.h 2010-12-01 00:35:27.775973000 +0200
338++++ w3m/html.h 2010-12-01 00:27:42.482954382 +0200
339+@@ -202,6 +202,8 @@
340+ #define HTML_N_I 110
341+ #define HTML_STRONG 111
342+ #define HTML_N_STRONG 112
343++#define HTML_BUTTON 113
344++#define HTML_N_BUTTON 114
345+
346+ /* pseudo tag */
347+ #define HTML_SELECT_INT 120
348+diff -ur w3m.orig/proto.h w3m/proto.h
349+--- w3m.orig/proto.h 2010-12-01 00:35:27.775973000 +0200
350++++ w3m/proto.h 2010-12-01 00:13:20.364142122 +0200
351+@@ -203,6 +203,8 @@
352+ extern Str process_img(struct parsed_tag *tag, int width);
353+ extern Str process_anchor(struct parsed_tag *tag, char *tagbuf);
354+ extern Str process_input(struct parsed_tag *tag);
355++extern Str process_button(struct parsed_tag *tag);
356++extern Str process_n_button(void);
357+ extern Str process_select(struct parsed_tag *tag);
358+ extern Str process_n_select(void);
359+ extern void feed_select(char *str);
360+diff -ur w3m.orig/table.c w3m/table.c
361+--- w3m.orig/table.c 2010-12-01 00:35:27.775973000 +0200
362++++ w3m/table.c 2010-12-01 00:13:20.364142122 +0200
363+@@ -2873,6 +2873,14 @@
364+ tmp = process_input(tag);
365+ feed_table1(tbl, tmp, mode, width);
366+ break;
367++ case HTML_BUTTON:
368++ tmp = process_button(tag);
369++ feed_table1(tbl, tmp, mode, width);
370++ break;
371++ case HTML_N_BUTTON:
372++ tmp = process_n_button();
373++ feed_table1(tbl, tmp, mode, width);
374++ break;
375+ case HTML_SELECT:
376+ tmp = process_select(tag);
377+ if (tmp)
378+diff -ur w3m.orig/tagtable.tab w3m/tagtable.tab
379+--- w3m.orig/tagtable.tab 2010-12-01 00:35:27.775973000 +0200
380++++ w3m/tagtable.tab 2010-12-01 00:30:05.022953889 +0200
381+@@ -62,6 +62,8 @@
382+ /samp HTML_NOP
383+ strong HTML_STRONG
384+ /strong HTML_N_STRONG
385++button HTML_BUTTON
386++/button HTML_N_BUTTON
387+ var HTML_NOP
388+ /var HTML_NOP
389+ address HTML_BR
390
391=== modified file 'debian/patches/series'
392--- debian/patches/series 2010-07-07 00:10:09 +0000
393+++ debian/patches/series 2011-01-18 10:55:22 +0000
394@@ -7,3 +7,4 @@
395 070_form-update.patch
396 080_xhtml-support.patch
397 090_simple-preserve-space.patch
398+091_button.patch

Subscribers

People subscribed via source and target branches

to all changes: