invalid. Reed, however, declared that members who were in the chamber but refused to vote would still count for the purposes of determining a quorum. Through these and other rulings, Reed ensured that the Democrats could not block the Republican agenda. The speakership reached its apogee during the term of Republican Joseph Gurney Cannon (1903–1911). Cannon exercised extraordinary control over the legislative process. He determined the agenda of the House, appointed the members of all committees, chose committee chairmen, headed the Rules Committee, and determined which committee heard each bill. He vigorously used his powers to ensure that Republican proposals were passed by the House. In 1910, however, Democrats and several dissatisfied Republicans joined together to strip Cannon of many of his powers, including the ability to name committee members and his chairmanship of the Rules Committee. Fifteen years later, Speaker Nicholas Longworth restored much, but not all, of the lost influence of the position. One of the most influential speakers in history was Democrat Sam Rayburn. Rayburn had the most cumulative time as speaker in history, holding office from 1940 to 1947, 1949 to 1953, and 1955 to 1961. He helped shape many bills, working quietly in the background with House committees. He also helped ensure the passage of several domestic measures and foreign assistance programs advocated by Presidents Franklin D. Roosevelt and Harry Truman. Rayburn's successor, Democrat John W. McCormack (served 1962–1971), was a somewhat less influential speaker, particularly because of dissent from younger members of the Democratic Party. During the mid-1970s, the power of the speakership once again grew under Democrat Carl Albert. The Committee on Rules ceased to be a semi-independent panel, as it had been since 1910. Instead, it once again became an arm of the party leadership. Moreover, in 1975, the speaker was granted the authority to appoint a majority of the members of the Rules Committee. Meanwhile, the power of committee chairmen was curtailed, further increasing the relative influence of the speaker. Albert's successor, Democrat Tip O'Neill, was a prominent speaker because of his public opposition to the policies of President Ronald Reagan. O'Neill is the longest continuously serving speaker, from 1977 through 1987. He challenged Reagan on domestic programs and on defense expenditures. Republicans made O'Neill the target of their election campaigns in 1980 and 1982 but Democrats managed to retain their majorities in both years. The roles of the parties reversed